@trim21/personal-pi-extensions 0.1.20261104045307 → 0.1.20261104214641
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/package.json +1 -1
- package/src/lib/lsp/client.ts +9 -0
package/package.json
CHANGED
package/src/lib/lsp/client.ts
CHANGED
|
@@ -679,6 +679,7 @@ export async function create(input: CreateInput): Promise<LspClient> {
|
|
|
679
679
|
|
|
680
680
|
const initialized = await withTimeout(
|
|
681
681
|
connection.sendRequest(InitializeRequest.type, {
|
|
682
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- InitializeParams.rootUri 仍是必填字段,本客户端也未声明 workspace.workspaceFolders 能力,只认它的服务器还需靠它定位 root
|
|
682
683
|
rootUri: pathToFileURL(input.root).href,
|
|
683
684
|
processId: process.pid,
|
|
684
685
|
workspaceFolders: [{ name: "workspace", uri: pathToFileURL(input.root).href }],
|
|
@@ -691,10 +692,18 @@ export async function create(input: CreateInput): Promise<LspClient> {
|
|
|
691
692
|
configuration: true,
|
|
692
693
|
didChangeWatchedFiles: { dynamicRegistration: true },
|
|
693
694
|
diagnostics: { refreshSupport: false },
|
|
695
|
+
// rename 返回的 documentChanges 里的 text edit 会被应用,文件级操作不支持
|
|
696
|
+
workspaceEdit: { documentChanges: true },
|
|
697
|
+
// 请求里已发 workspaceFolders 且会应答 workspace/workspaceFolders 请求,
|
|
698
|
+
// 能力位必须如实声明,否则按能力判断的服务器会忽略这些工作区信息
|
|
699
|
+
workspaceFolders: true,
|
|
694
700
|
},
|
|
695
701
|
textDocument: {
|
|
696
702
|
diagnostic: { dynamicRegistration: true, relatedDocumentSupport: true },
|
|
703
|
+
hover: { contentFormat: ["markdown", "plaintext"] },
|
|
697
704
|
publishDiagnostics: { versionSupport: false },
|
|
705
|
+
// 会发 textDocument/prepareRename 并使用返回的 placeholder
|
|
706
|
+
rename: { prepareSupport: true },
|
|
698
707
|
},
|
|
699
708
|
},
|
|
700
709
|
}),
|