Skip to content

Commit b2f06cc

Browse files
committed
src/goImpl: use quickpick description and handle symbol with .
If user searches with 'io.Reader' for more specific workspace symbol search, the new interface returns 'io.Reader' as the symbol name. Passing it to impl as it is will cause an error. Use only the part after '.' as a heuristic. Change-Id: I7935ad9ef59be50db0bc09890b9532c8e0ba32b6
1 parent 6994d90 commit b2f06cc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/goImpl.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import vscode = require('vscode');
1717

1818
class InterfaceItem implements vscode.QuickPickItem {
1919
public label: string;
20+
public description: string;
2021
public name: string;
2122
public package: string;
22-
public location: vscode.Location;
2323

24-
constructor(public symbol: vscode.SymbolInformation) {
25-
this.label = symbol.name + ' ' + symbol.containerName;
26-
this.name = symbol.name;
24+
constructor(symbol: vscode.SymbolInformation) {
25+
this.label = symbol.name;
26+
this.description = symbol.containerName;
27+
this.name = symbol.name.split('.').pop(); // in case, symbol contains package name.
2728
this.package = symbol.containerName;
28-
this.location = symbol.location;
2929
}
3030
}
3131

@@ -37,7 +37,7 @@ export function implCursor() {
3737
}
3838
const cursor = editor.selection;
3939
const quickPick = vscode.window.createQuickPick();
40-
quickPick.placeholder = 'Input interface name (e.g. client)';
40+
quickPick.placeholder = 'Input interface name (e.g. Client)';
4141

4242
const search = function (keyword: string) {
4343
quickPick.busy = true;

0 commit comments

Comments
 (0)