dsh-vscode-mode 0.1.36 → 0.1.43
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/lib/client.js +730 -29
- package/lib/client.js.map +1 -1
- package/lib/index.js +699 -88
- package/lib/index.js.map +1 -1
- package/package.json +1 -5
- package/src/client/monaco/loader.ts +12 -1
- package/src/client/monaco/lsp/lspClient.ts +65 -11
- package/src/client/monaco/lsp/providers.ts +34 -1
- package/src/client/monaco/theme.ts +229 -0
- package/src/client/ui/EditorView.ts +21 -2
- package/src/client/ui/LspSettings.ts +39 -7
- package/src/client/ui/McpSettings.ts +5 -1
- package/src/compat.ts +46 -5
- package/src/dshVersion.ts +121 -0
- package/src/fileOpenSettings.ts +143 -24
- package/src/host-deps.d.ts +5 -5
- package/src/index.ts +2 -1
- package/src/lsp/client.ts +29 -2
- package/src/lsp/manager.ts +15 -0
- package/src/lsp/providers.ts +203 -24
- package/src/lsp/rpc.ts +86 -4
- package/src/lsp/server.ts +80 -3
- package/src/lsp/settings.ts +12 -6
- package/src/paths.ts +7 -0
- package/src/rpc.ts +4 -1
- package/src/shared/compat.ts +9 -3
- package/src/shared/lsp.ts +24 -0
- package/src/shared/rpc.ts +6 -2
package/src/shared/lsp.ts
CHANGED
|
@@ -49,6 +49,26 @@ export interface LspHover {
|
|
|
49
49
|
range?: LspRange
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/** LSP semantic token 标准类型(host 归一化后,client 与 Monaco 共用)。 */
|
|
53
|
+
export const LSP_SEMANTIC_TOKEN_TYPES = [
|
|
54
|
+
'namespace', 'type', 'class', 'enum', 'interface', 'struct', 'typeParameter',
|
|
55
|
+
'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method',
|
|
56
|
+
'macro', 'label', 'comment', 'string', 'keyword', 'number', 'regexp', 'operator',
|
|
57
|
+
'decorator',
|
|
58
|
+
] as const
|
|
59
|
+
|
|
60
|
+
/** LSP semantic token 标准修饰符(host 归一化后,client 与 Monaco 共用)。 */
|
|
61
|
+
export const LSP_SEMANTIC_TOKEN_MODIFIERS = [
|
|
62
|
+
'declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract',
|
|
63
|
+
'async', 'modification', 'documentation', 'defaultLibrary', 'global', 'local', 'mutable',
|
|
64
|
+
] as const
|
|
65
|
+
|
|
66
|
+
/** 归一化后的 LSP semanticTokens/full 结果(data 使用 LSP delta 编码)。 */
|
|
67
|
+
export interface LspSemanticTokens {
|
|
68
|
+
data: number[]
|
|
69
|
+
resultId?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
52
72
|
/** LSP 服务器能力子集:本插件会用到的方法。 */
|
|
53
73
|
export interface LspServerCapabilities {
|
|
54
74
|
definition: boolean
|
|
@@ -56,6 +76,9 @@ export interface LspServerCapabilities {
|
|
|
56
76
|
documentSymbol: boolean
|
|
57
77
|
workspaceSymbol: boolean
|
|
58
78
|
hover: boolean
|
|
79
|
+
semanticTokens: boolean
|
|
80
|
+
semanticTokenTypes?: string[]
|
|
81
|
+
semanticTokenModifiers?: string[]
|
|
59
82
|
}
|
|
60
83
|
|
|
61
84
|
/** 服务器进程/会话状态。 */
|
|
@@ -77,6 +100,7 @@ export interface LspServerStatus {
|
|
|
77
100
|
progress?: number // LSP 工作区解析进度(0–100,未知时省略)
|
|
78
101
|
progressMessage?: string
|
|
79
102
|
root?: string // 绑定工作区根(相对显示)
|
|
103
|
+
providerName?: string // provider 名称(如 EmmyLua / LuaLS)
|
|
80
104
|
}
|
|
81
105
|
|
|
82
106
|
/**
|
package/src/shared/rpc.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
} from './types.js'
|
|
15
15
|
import type { MpcConfig, MpcProject, MpcProjectSaveInput, MpcServer } from './mcp.js'
|
|
16
16
|
import type { CompatReport, DevFormInfo } from './compat.js'
|
|
17
|
-
import type { LspExtInfo, LspExtUpdate, LspHover, LspLocation, LspMarketItem, LspPosition, LspServerStatus, LspSymbol } from './lsp.js'
|
|
17
|
+
import type { LspExtInfo, LspExtUpdate, LspHover, LspLocation, LspMarketItem, LspPosition, LspSemanticTokens, LspServerStatus, LspSymbol } from './lsp.js'
|
|
18
18
|
|
|
19
19
|
/** webServer 精确路由。 */
|
|
20
20
|
export const RPC_PATH = '/edrv/rpc'
|
|
@@ -143,6 +143,8 @@ export interface RpcRequestMap {
|
|
|
143
143
|
'edrv.lsp.documentSymbol': { sessionId?: string; path: string }
|
|
144
144
|
'edrv.lsp.workspaceSymbol': { sessionId?: string; query: string }
|
|
145
145
|
'edrv.lsp.hover': { sessionId?: string; path: string; position: LspPosition }
|
|
146
|
+
'edrv.lsp.semanticTokens': { sessionId?: string; path: string }
|
|
147
|
+
'edrv.lsp.redetect': { languageId: string }
|
|
146
148
|
'edrv.lsp.configGet': {}
|
|
147
149
|
'edrv.lsp.configUpdate': { languageId: string; enabled?: boolean; command?: string; path?: string }
|
|
148
150
|
'edrv.lsp.ext.list': {}
|
|
@@ -205,8 +207,10 @@ export interface RpcOkMap {
|
|
|
205
207
|
'edrv.lsp.documentSymbol': { symbols: LspSymbol[] }
|
|
206
208
|
'edrv.lsp.workspaceSymbol': { symbols: LspSymbol[]; truncated?: boolean }
|
|
207
209
|
'edrv.lsp.hover': { hover?: LspHover }
|
|
210
|
+
'edrv.lsp.semanticTokens': { tokens?: LspSemanticTokens }
|
|
211
|
+
'edrv.lsp.redetect': { servers: LspServerStatus[] }
|
|
208
212
|
'edrv.lsp.configGet': { config: Record<string, unknown> }
|
|
209
|
-
'edrv.lsp.configUpdate': { config: Record<string, unknown
|
|
213
|
+
'edrv.lsp.configUpdate': { config: Record<string, unknown>; servers?: LspServerStatus[] }
|
|
210
214
|
'edrv.lsp.ext.list': { extensions: LspExtInfo[] }
|
|
211
215
|
'edrv.lsp.ext.install': { extension: LspExtInfo; updated?: boolean }
|
|
212
216
|
'edrv.lsp.ext.uninstall': object
|