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

Commit

Permalink
Fixes #465 outline offset problem in No-English language (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
bylevel authored and ramya-rao-a committed Dec 30, 2016
1 parent 575b373 commit a731fe1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/goOutline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ export class GoDocumentSymbolProvider implements vscode.DocumentSymbolProvider {
if (decl.receiverType) {
label = '(' + decl.receiverType + ').' + label;
}

let codeBuf = new Buffer(document.getText());
let start = codeBuf.slice(0, decl.start - 1).toString().length;
let end = codeBuf.slice(0, decl.end - 1).toString().length;

let symbolInfo = new vscode.SymbolInformation(
label,
this.goKindToCodeKind[decl.type],
new vscode.Range(document.positionAt(decl.start), document.positionAt(decl.end - 1)),
new vscode.Range(document.positionAt(start), document.positionAt(end)),
undefined,
containerName);
symbols.push(symbolInfo);
Expand Down

0 comments on commit a731fe1

Please sign in to comment.