File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,28 @@ import { ISymbolAliasExtractor, SymbolInfo } from "../extractors";
22
33export class PythonSymbolAliasExtractor implements ISymbolAliasExtractor {
44 public extractAliases ( symbol : SymbolInfo ) : string [ ] {
5- var folders = symbol . id . split ( "/" ) ;
65 let aliases = [ ] ;
7- //aliases.push(symbol.id);
6+
7+ const folderAndName = symbol . id . split ( "$_$" ) ;
8+ if ( folderAndName . length < 2 ) {
9+ return [ ] ;
10+ }
11+ const folderOnly = folderAndName [ 0 ] ;
12+ var folders = folderOnly . split ( "/" ) ;
13+
14+ if ( symbol . name != symbol . displayName ) {
15+ aliases . push ( folderOnly + "$_$" + symbol . displayName ) ;
16+ }
17+ //aliases.push(symbol.id);
818 for ( let i = 1 ; i < folders . length ; i ++ ) {
9- aliases . push ( folders . slice ( i , folders . length ) . join ( "/" ) ) ;
19+ aliases . push ( folders . slice ( i , folders . length ) . join ( "/" ) + "$_$" + symbol . name ) ;
20+ if ( symbol . name != symbol . displayName ) {
21+ aliases . push ( folders . slice ( i , folders . length ) . join ( "/" ) + "$_$" + symbol . displayName ) ;
22+
23+ }
1024 }
25+
26+
1127 return aliases ;
1228 }
1329}
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ export class SymbolProvider
150150 const extractedMethods = await Promise . all (
151151 methodExtractors . map ( async ( x ) => await x . extractMethods ( document , allDocSymbols , tokens ) )
152152 ) ;
153- const methods = extractedMethods . flat ( )
153+ const methods = extractedMethods . flat ( ) ;
154154 return methods ;
155155 }
156156 else {
You can’t perform that action at this time.
0 commit comments