@trim21/personal-pi-extensions 0.1.570 → 0.1.571
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 +14 -1
package/package.json
CHANGED
package/src/lib/lsp/client.ts
CHANGED
|
@@ -1254,7 +1254,20 @@ export async function create(input: CreateInput): Promise<LspClient> {
|
|
|
1254
1254
|
);
|
|
1255
1255
|
const uri = pathToFileURL(resolvedPath).href;
|
|
1256
1256
|
// rename 前强制同步磁盘内容,保证服务器基于最新文本计算编辑
|
|
1257
|
-
await openDocument({ path: resolvedPath });
|
|
1257
|
+
const version = await openDocument({ path: resolvedPath });
|
|
1258
|
+
// 索引就绪栅栏:项目异步加载完成前,服务器对 references 的答复只包含当前
|
|
1259
|
+
// 打开的文件(尚未发现其它文件),而"连续两次一致"会把它误判成"索引已收
|
|
1260
|
+
// 敛",于是 rename 漏掉跨文件引用——CI 上实测到(失败那次 3.0s 返回、只改
|
|
1261
|
+
// 1 个文件,而通过的 7.9s)。服务器为本文件产生的第一份诊断报告要等项目加
|
|
1262
|
+
// 载完成,用它当就绪信号;本会话已经收到过报告(文档早已驻留)时不再等待,
|
|
1263
|
+
// 免得给常见路径白加延迟。
|
|
1264
|
+
if (!published.has(resolvedPath) && !pullDiagnostics.has(resolvedPath)) {
|
|
1265
|
+
await waitForDocumentDiagnostics({
|
|
1266
|
+
path: resolvedPath,
|
|
1267
|
+
version,
|
|
1268
|
+
signal: request.signal,
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1258
1271
|
const position = { line: request.line, character: request.character };
|
|
1259
1272
|
const at = `${resolvedPath}:${request.line + 1}:${request.character + 1}`;
|
|
1260
1273
|
const notRenameable = () =>
|