Closed Reedbeta closed 4 years ago
I got a callstack for this crash:
> ShaderTools.CodeAnalysis.Features.dll!ShaderTools.CodeAnalysis.NavigateTo.NavigateToSearchService.SearchDocumentAsync(ShaderTools.CodeAnalysis.Document document, string searchPattern, System.Threading.CancellationToken cancellationToken) Line 38 C#
ShaderTools.CodeAnalysis.EditorFeatures.dll!ShaderTools.CodeAnalysis.Editor.Implementation.NavigateTo.NavigateToItemProvider.Searcher.SearchAsyncWorker(ShaderTools.CodeAnalysis.Document document) Line 116 C#
ShaderTools.CodeAnalysis.EditorFeatures.dll!ShaderTools.CodeAnalysis.Editor.Implementation.NavigateTo.NavigateToItemProvider.Searcher.SearchAsync(ShaderTools.CodeAnalysis.Document document) C#
ShaderTools.CodeAnalysis.EditorFeatures.dll!ShaderTools.CodeAnalysis.Editor.Implementation.NavigateTo.NavigateToItemProvider.Searcher.Search() Line 83 C#
ShaderTools.CodeAnalysis.EditorFeatures.dll!ShaderTools.CodeAnalysis.Editor.Implementation.NavigateTo.NavigateToItemProvider.StartSearch(Microsoft.VisualStudio.Language.NavigateTo.Interfaces.INavigateToCallback callback, string searchValue) Line 68 C#
It stopped on this if-statement in NavigateToSearchService.SearchDocumentAsync
:
if (declaredSymbol != null
&& declaredSymbol.Kind != SymbolKind.Parameter
&& (declaredSymbol.Kind != SymbolKind.Variable || declaredSymbol.Parent == null || declaredSymbol.Parent.Kind != SymbolKind.Function)
&& Contains(declaredSymbol.Name, searchPattern))
It looks like the problem is declaredSymbol.Name
is null. The symbol in question is a Technique, and we do have many un-named techniques in our codebase. Should be easy to fix, just check for Name to be non-null.
Fixed by #176.
Opening the 'Go To All' window (Ctrl+comma) in an HLSL file and typing something will usually crash Visual Studio within a few seconds.