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

Commit

Permalink
Do not show blank identifiers in file outline
Browse files Browse the repository at this point in the history
  • Loading branch information
ragurney committed Aug 30, 2018
1 parent 292b29d commit 7068517
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 @@ -110,12 +110,17 @@ export class GoDocumentSymbolProvider implements vscode.DocumentSymbolProvider {
symbols: vscode.SymbolInformation[],
containerName: string,
byteOffsetToDocumentOffset: (byteOffset: number) => number): void {

const ignoredSymbols = ['_'];
let gotoSymbolConfig = vscode.workspace.getConfiguration('go', document.uri)['gotoSymbol'];
let includeImports = gotoSymbolConfig ? gotoSymbolConfig['includeImports'] : false;

(decls || []).forEach(decl => {
if (!includeImports && decl.type === 'import') return;

let label = decl.label;

if (ignoredSymbols.indexOf(label) !== -1 && decl.type === 'variable') return;

if (decl.receiverType) {
label = '(' + decl.receiverType + ').' + label;
}
Expand Down

0 comments on commit 7068517

Please sign in to comment.