Skip to content

Commit bbcc3fd

Browse files
authored
Fix Go to Symbol in Workspace (#6795)
* Fix Go to Symbol in Workspace
1 parent 781e813 commit bbcc3fd

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Extension/src/LanguageServer/Providers/workspaceSymbolProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
2828
if (suffix.length) {
2929
name = name + ' (' + suffix + ')';
3030
}
31+
const range: vscode.Range = new vscode.Range(symbol.location.range.start.line, symbol.location.range.start.character, symbol.location.range.end.line, symbol.location.range.end.character);
32+
const uri: vscode.Uri = vscode.Uri.parse(symbol.location.uri.toString());
3133
const vscodeSymbol: vscode.SymbolInformation = new vscode.SymbolInformation(
3234
name,
3335
symbol.kind,
3436
symbol.containerName,
35-
symbol.location
37+
new vscode.Location(uri, range)
3638
);
3739
resultSymbols.push(vscodeSymbol);
3840
});

Extension/src/LanguageServer/client.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,16 @@ export interface LocalizeDocumentSymbol {
302302
children: LocalizeDocumentSymbol[];
303303
}
304304

305+
/** Differs from vscode.Location, which has a uri of type vscode.Uri. */
306+
interface Location {
307+
uri: string;
308+
range: Range;
309+
}
310+
305311
interface LocalizeSymbolInformation {
306312
name: string;
307313
kind: vscode.SymbolKind;
308-
location: vscode.Location;
314+
location: Location;
309315
containerName: string;
310316
suffix: LocalizeStringParams;
311317
}

Extension/src/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ export function getInstalledBinaryPlatform(): string | undefined {
516516
return installedPlatform;
517517
}
518518

519-
/* Check if the core binaries exists in extension's installation folder */
519+
/** Check if the core binaries exists in extension's installation folder */
520520
export async function checkInstallBinariesExist(): Promise<boolean> {
521521
if (!checkInstallLockFile()) {
522522
return false;
@@ -540,7 +540,7 @@ export async function checkInstallBinariesExist(): Promise<boolean> {
540540
return installBinariesExist;
541541
}
542542

543-
/* Check if the core Json files exists in extension's installation folder */
543+
/** Check if the core Json files exists in extension's installation folder */
544544
export async function checkInstallJsonsExist(): Promise<boolean> {
545545
let installJsonsExist: boolean = true;
546546
const jsonFiles: string[] = [

0 commit comments

Comments
 (0)