Add receiver type to document symbol browser.
Note that this will only display the receiver type for users who update to the latest `github.com/lukehoban/go-outline`. We don't currently have a way to force/suggest that.
Fixes #18.
diff --git a/src/goOutline.ts b/src/goOutline.ts
index 0518372..a7d7848 100644
--- a/src/goOutline.ts
+++ b/src/goOutline.ts
@@ -19,6 +19,7 @@
interface GoOutlineDeclaration {
label: string;
type: string;
+ receiverType?: string;
icon?: string; // icon class or null to use the default images based on the type
start: number;
end: number;
@@ -59,8 +60,12 @@
private convertToCodeSymbols(document: vscode.TextDocument, decls: GoOutlineDeclaration[], symbols: vscode.SymbolInformation[], containerName: string): void {
decls.forEach(decl => {
+ let label = decl.label;
+ if (decl.receiverType) {
+ label = '(' + decl.receiverType + ').' + label;
+ }
let symbolInfo = new vscode.SymbolInformation(
- decl.label,
+ label,
this.goKindToCodeKind[decl.type],
new vscode.Range(document.positionAt(decl.start), document.positionAt(decl.end - 1)),
undefined,