Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit a731fe1

Browse files
bylevelramya-rao-a
authored andcommitted
Fixes #465 outline offset problem in No-English language (#699)
1 parent 575b373 commit a731fe1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/goOutline.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,15 @@ export class GoDocumentSymbolProvider implements vscode.DocumentSymbolProvider {
8181
if (decl.receiverType) {
8282
label = '(' + decl.receiverType + ').' + label;
8383
}
84+
85+
let codeBuf = new Buffer(document.getText());
86+
let start = codeBuf.slice(0, decl.start - 1).toString().length;
87+
let end = codeBuf.slice(0, decl.end - 1).toString().length;
88+
8489
let symbolInfo = new vscode.SymbolInformation(
8590
label,
8691
this.goKindToCodeKind[decl.type],
87-
new vscode.Range(document.positionAt(decl.start), document.positionAt(decl.end - 1)),
92+
new vscode.Range(document.positionAt(start), document.positionAt(end)),
8893
undefined,
8994
containerName);
9095
symbols.push(symbolInfo);

0 commit comments

Comments
 (0)