Skip to content

Commit 46164be

Browse files
authored
Remove parentheses from value-method name (#138)
* Remove parentheses from value-method name * Fixed pointer-method
1 parent e310c84 commit 46164be

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/services/languages/go/methodExtractor.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@ export class GoMethodExtractor implements IMethodExtractor{
5959
}
6060

6161
const methods: SymbolInfo[] = methodSymbols.map(s => {
62+
// "AuthController.Error" => "AuthController.Error"
63+
// "(*AuthController).Error" => "(*AuthController).Error"
64+
// "(AuthController).Error" => "AuthController.Error"
65+
let name = s.name.replace(/\(([^*]+)\)\.(.+)/, "$1.$2")
6266
return {
63-
id: packageDefinitionName === "main" ? packagePath + '$_$' + `main.${s.name}` : packagePath + '$_$' + s.name,
64-
name: s.name,
65-
displayName: packagePath.split('/').lastOrDefault() + '.' + s.name,
67+
id: packageDefinitionName === "main" ? packagePath + '$_$' + `main.${name}` : packagePath + '$_$' + name,
68+
name: name,
69+
displayName: packagePath.split('/').lastOrDefault() + '.' + name,
6670
documentUri: document.uri,
6771
codeLocation: packagePath,
6872
range: new vscode.Range(

0 commit comments

Comments
 (0)