@trim21/personal-pi-extensions 0.1.531 → 0.1.532
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/lsp.ts +6 -5
package/package.json
CHANGED
package/src/lib/lsp/lsp.ts
CHANGED
|
@@ -307,16 +307,17 @@ export function mergeConfig(globalConfig: LspConfig, localConfig: LspConfig): Ls
|
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
/**
|
|
310
|
+
/**
|
|
311
|
+
* 读取全局 + 本地配置,合并并解析为生效配置;未知字段警告经 onWarning 上报。
|
|
312
|
+
* 顺序读取两份配置,让警告顺序稳定为全局在前、本地在后。
|
|
313
|
+
*/
|
|
311
314
|
export async function loadLspConfig(
|
|
312
315
|
cwd: string,
|
|
313
316
|
globalConfigPath: string = join(homedir(), ".pi", "agent", "lsp.json"),
|
|
314
317
|
onWarning?: (message: string) => void,
|
|
315
318
|
): Promise<ResolvedLspConfig> {
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
readConfigFile(join(cwd, ".pi", "lsp.json"), onWarning),
|
|
319
|
-
]);
|
|
319
|
+
const globalConfig = await readConfigFile(globalConfigPath, onWarning);
|
|
320
|
+
const localConfig = await readConfigFile(join(cwd, ".pi", "lsp.json"), onWarning);
|
|
320
321
|
return resolveConfig(mergeConfig(globalConfig, localConfig));
|
|
321
322
|
}
|
|
322
323
|
|