You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.PowerShell.EditorServices.Symbols.PesterSymbolReference.GetCommandType(String commandName)
at Microsoft.PowerShell.EditorServices.Symbols.PesterDocumentSymbolProvider.<>c.<Microsoft.PowerShell.EditorServices.Symbols.IDocumentSymbolProvider.ProvideDocumentSymbols>b__0_0(Ast ast)
at System.Management.Automation.Language.AstSearcher.Check(Ast ast)
at System.Management.Automation.Language.CommandAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.PipelineAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.StatementBlockAst.InternalVisit(AstVisitor visitor, ReadOnlyCollection`1 traps, ReadOnlyCollection`1 statements, AstVisitAction action)
at System.Management.Automation.Language.NamedBlockAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.ScriptBlockAst.InternalVisit(AstVisitor visitor)
at System.Management.Automation.Language.Ast.FindAll(Func`2 predicate, Boolean searchNestedScriptBlocks)
at Microsoft.PowerShell.EditorServices.Symbols.PesterDocumentSymbolProvider.Microsoft.PowerShell.EditorServices.Symbols.IDocumentSymbolProvider.ProvideDocumentSymbols(ScriptFile scriptFile)
at Microsoft.PowerShell.EditorServices.CodeLenses.PesterCodeLensProvider.ProvideCodeLenses(ScriptFile scriptFile)
The text was updated successfully, but these errors were encountered:
This change fixes an issue in the PesterDocumentSymbolProvider where
CommandAsts for dot-sourced scripts were being evaluated by the symbol
provider and causing a crash when GetCommandName() returned null. This
change causes dot-sourced commands to now be skipped and also skips any
CommandAst which returns null for GetCommandName().
ResolvesPowerShell/vscode-powershell#859
daviwil
added a commit
to daviwil/PowerShellEditorServices
that referenced
this issue
Jun 12, 2017
This change fixes an issue in the PesterDocumentSymbolProvider where
CommandAsts for dot-sourced scripts were being evaluated by the symbol
provider and causing a crash when GetCommandName() returned null. This
change causes dot-sourced commands to now be skipped and also skips any
CommandAst which returns null for GetCommandName().
ResolvesPowerShell/vscode-powershell#859
Looks like the new PesterSymbolReference.GetCommandType isn't catching null cases.
Logs provided by @muzzar78:
The text was updated successfully, but these errors were encountered: