fix: Add context/getSymbolsForFiles endpoint in JetBrains and handle symbol retrieval errors

This commit is contained in:
liuk 2024-11-29 23:34:45 +08:00
parent 315f75e75e
commit ba1fdf7bac
2 changed files with 7 additions and 1 deletions

View file

@ -290,7 +290,12 @@ export async function getSymbolsForManyFiles(
const filesAndSymbols = await Promise.all(
uris.map(async (uri): Promise<[string, SymbolWithRange[]]> => {
const contents = await ide.readFile(uri);
const symbols = await getSymbolsForFile(uri, contents);
let symbols = undefined;
try {
symbols = await getSymbolsForFile(uri, contents);
} catch (e) {
console.error(`Failed to get symbols for ${uri}:`, e);
}
return [uri, symbols ?? []];
}),
);

View file

@ -66,6 +66,7 @@ class ContinueBrowser(val project: Project, url: String) {
"config/listProfiles",
"profiles/switch",
"didChangeSelectedProfile",
"context/getSymbolsForFiles",
)
private fun registerAppSchemeHandler() {