File tree 1 file changed +11
-4
lines changed
src/PowerShellEditorServices/Services/Symbols
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -345,7 +345,11 @@ public async Task<ParameterSetSignatures> FindParameterSetsInFileAsync(
345
345
lineNumber ,
346
346
columnNumber ) ;
347
347
348
- if ( foundSymbol == null )
348
+ // If we are not possibly looking at a Function, we don't
349
+ // need to continue because we won't be able to get the
350
+ // CommandInfo object.
351
+ if ( foundSymbol ? . SymbolType != SymbolType . Function
352
+ && foundSymbol ? . SymbolType != SymbolType . Unknown )
349
353
{
350
354
return null ;
351
355
}
@@ -459,9 +463,12 @@ public async Task<SymbolReference> GetDefinitionOfSymbolAsync(
459
463
}
460
464
}
461
465
462
- // if definition is not found in file in the workspace
463
- // look for it in the builtin commands
464
- if ( foundDefinition == null )
466
+ // if the definition is not found in a file in the workspace
467
+ // look for it in the builtin commands but only if the symbol
468
+ // we are looking at is possibly a Function.
469
+ if ( foundDefinition == null
470
+ && ( foundSymbol . SymbolType == SymbolType . Function
471
+ || foundSymbol . SymbolType == SymbolType . Unknown ) )
465
472
{
466
473
CommandInfo cmdInfo =
467
474
await CommandHelpers . GetCommandInfoAsync (
You can’t perform that action at this time.
0 commit comments