File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/PowerShellEditorServices/Services/Symbols Expand file tree Collapse file tree 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(
345345 lineNumber ,
346346 columnNumber ) ;
347347
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 )
349353 {
350354 return null ;
351355 }
@@ -459,9 +463,12 @@ public async Task<SymbolReference> GetDefinitionOfSymbolAsync(
459463 }
460464 }
461465
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 ) )
465472 {
466473 CommandInfo cmdInfo =
467474 await CommandHelpers . GetCommandInfoAsync (
You can’t perform that action at this time.
0 commit comments