dsh-vscode-mode 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/shared/rpc.ts CHANGED
@@ -25,6 +25,7 @@ import { DAP_ACTIONS } from './dap.js'
25
25
  import { appUrl } from './appUrl.js'
26
26
  import type { LoggerLevel } from './logger.js'
27
27
  import type { SvnViewRequest, SvnViewPayload } from './svnExplorer.js'
28
+ import type { DecideReview, ReviewDetail, ReviewPage, ReviewRequest } from './review.js'
28
29
 
29
30
  /** webServer 精确路由。 */
30
31
  export const RPC_PATH = '/edrv/rpc'
@@ -368,6 +369,9 @@ export interface UiStatePatchInput {
368
369
 
369
370
  /** 每个方法的请求参数(sessionId 为公共可选字段)。 */
370
371
  export interface RpcRequestMap {
372
+ 'edrv.review.list': ReviewRequest & { cursor?: number; history?: boolean; path?: string }
373
+ 'edrv.review.detail': ReviewRequest & { id: string }
374
+ 'edrv.review.decide': DecideReview
371
375
  'edrv.list': { sessionId?: string; callIds?: string[]; skipStale?: boolean }
372
376
  'edrv.accept': { sessionId?: string; callId: string; scope?: RpcScope; hunkIndex?: number }
373
377
  'edrv.reject': { sessionId?: string; callId: string; scope?: RpcScope; hunkIndex?: number }
@@ -537,6 +541,9 @@ export type RpcMethod = keyof RpcRequestMap
537
541
 
538
542
  /** 每个方法成功(ok:true)时的附加载荷。 */
539
543
  export interface RpcOkMap {
544
+ 'edrv.review.list': { page: ReviewPage }
545
+ 'edrv.review.detail': { detail: ReviewDetail }
546
+ 'edrv.review.decide': { revision: number }
540
547
  'edrv.list': { records: RecordView[] }
541
548
  'edrv.accept': { record: RecordView }
542
549
  'edrv.reject': { record: RecordView }
package/src/store.ts CHANGED
@@ -221,10 +221,10 @@ export async function readForCache(ctx: Ctx, session: Session, cache: Map<string
221
221
  */
222
222
  export async function recordIsStale(ctx: Ctx, session: Session, cache: Map<string, ReadState>, rec: DiffRecord): Promise<boolean> {
223
223
  if (rec.superseded === true) return true
224
- if (!Array.isArray(rec.hunks) || !rec.hunks.length) return true
224
+ if (!Array.isArray(rec.hunks) || !rec.hunks.length) { rec.conflict = true; return false }
225
225
  const state = await readForCache(ctx, session, cache, rec.path)
226
226
  if (state.kind === 'unavailable') return false
227
- if (state.kind === 'missing') return true
227
+ if (state.kind === 'missing') { rec.conflict = true; return false }
228
228
  if (rec.create === true) return false
229
229
  const pending = rec.hunks.map((_, idx) => ({ idx, hunk: preciseHunk(rec, idx), status: rec.decisions.perHunk[idx] ?? rec.decisions.call }))
230
230
  .filter((item) => item.status === 'pending' && item.hunk && !isNoopHunk(item.hunk))