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

Fix outline offset problem in No-English language #699

Merged
merged 1 commit into from
Dec 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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