dsh-vscode-mode 0.14.13 → 0.15.2
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/README.md +7 -3
- package/lib/client.js +2967 -1329
- package/lib/client.js.map +1 -1
- package/lib/index.js +217 -5
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/paths.ts +2 -0
- package/src/client/state/documentStore.ts +148 -0
- package/src/client/state/editorLayout.ts +179 -0
- package/src/client/state/modelCache.ts +16 -7
- package/src/client/styles/editor.css +33 -3
- package/src/client/svnNotice.ts +1 -1
- package/src/client/tabDrag.ts +137 -0
- package/src/client/tabMenu.ts +15 -3
- package/src/client/ui/EditorPane.ts +130 -0
- package/src/client/ui/EditorView.ts +358 -97
- package/src/client/ui/FloatingEditor.ts +87 -0
- package/src/client/ui/SvnUpdateDialog.ts +143 -29
- package/src/client/ui/svnUpdateModel.ts +45 -1
- package/src/shared/rpc.ts +5 -1
- package/src/shared/svn.ts +10 -0
- package/src/svn.ts +70 -5
- package/src/svnResolve.ts +33 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SvnConflictState, SvnResolveAccept } from './shared/svn.js'
|
|
2
|
+
import { attrOf, scanXmlTags } from './svnXml.js'
|
|
3
|
+
|
|
4
|
+
/** @public @author ddj 2026年10月14号 @param value Requested strategy. @returns Whether SVN accepts this explicit strategy. */
|
|
5
|
+
export function validAccept(value: unknown): value is SvnResolveAccept {
|
|
6
|
+
return value === 'mine-full' || value === 'theirs-full' || value === 'working'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** @public @author ddj 2026年10月14号 @param value Untrusted relative target. @returns Whether the path names exactly one non-root workspace target. */
|
|
10
|
+
export function validTarget(value: unknown): value is string {
|
|
11
|
+
if (typeof value !== 'string' || !value || /[\u0000-\u001f]/.test(value) || /^[A-Za-z]:|^[\\/]/.test(value)) return false
|
|
12
|
+
return value.replace(/\\/g, '/').split('/').every((part) => Boolean(part) && part !== '.' && part !== '..' && part.toLowerCase() !== '.svn')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** @public @author ddj 2026年10月14号 @param path Exact relative target. @returns Peg-safe SVN argument. */
|
|
16
|
+
export function pegTarget(path: string): string { return path.includes('@') ? path + '@' : path }
|
|
17
|
+
|
|
18
|
+
/** @public @author ddj 2026年10月14号 @param xml Verbose depth-empty status. @param path Client target identity. @returns Confirmed conflict evidence. @throws Missing or incomplete status evidence. */
|
|
19
|
+
export function conflictOf(xml: string, path: string): SvnConflictState {
|
|
20
|
+
if (!/^\s*(?:<\?xml[^>]*>\s*)?<status\b/.test(xml) || !/<\/status>\s*$/.test(xml)) {
|
|
21
|
+
throw new Error('SVN 冲突状态输出为空或不完整,状态未确认')
|
|
22
|
+
}
|
|
23
|
+
const statuses = [...scanXmlTags(xml, ['wc-status'])].filter((hit) => !hit.closing)
|
|
24
|
+
if (statuses.length !== 1) throw new Error('SVN 未返回唯一目标状态,状态未确认')
|
|
25
|
+
const attrs = statuses[0].attrs
|
|
26
|
+
const item = attrOf(attrs, 'item')
|
|
27
|
+
if (!item) throw new Error('SVN 目标状态缺失,状态未确认')
|
|
28
|
+
return { path, text: item === 'conflicted', props: attrOf(attrs, 'props') === 'conflicted',
|
|
29
|
+
tree: attrOf(attrs, 'tree-conflicted') === 'true', versioned: !['unversioned', 'ignored', 'external', 'none'].includes(item) }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** @public @author ddj 2026年10月14号 @param state Confirmed target evidence. @returns Whether any conflict remains. */
|
|
33
|
+
export function hasConflict(state: SvnConflictState): boolean { return state.text || state.props || state.tree }
|