Open Arthi-Dev opened 1 year ago
If I download symbols with I receive the following error:
[Error - 8:20:43 AM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'codeLens/resolve' failed with error: 'One or more errors occurred. (Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.TableClassTypeSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.TableTypeSymbol'.)'
Details:
System.AggregateException: One or more errors occurred. (Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.TableClassTypeSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.TableTypeSymbol'.)
---> System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.TableClassTypeSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.TableTypeSymbol'.
at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxTreeSemanticModel.GetFieldSymbolFromTableExtensionSyntax(SyntaxNode node, TableExtensionSyntax tableExt) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SyntaxTreeSemanticModel.cs:line 396
at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxTreeSemanticModel.GetSemanticInfoSymbolInNonMemberContext(SyntaxNode node) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SyntaxTreeSemanticModel.cs:line 283
at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxTreeSemanticModel.GetSymbolInfoWorker(SyntaxNode node, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SyntaxTreeSemanticModel.cs:line 133
at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 565
at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfoFromNode(SyntaxNode node, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 400
at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfo(SyntaxNode node, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 96
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindSymbols.FindReferenceCache.<>c__DisplayClass3_0.<GetSymbolInfo>b__0(SyntaxNode n) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindSymbols\FindReferenceCache.cs:line 37
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindSymbols.FindReferenceCache.GetSymbolInfo(SemanticModel model, SyntaxNode node, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindSymbols\FindReferenceCache.cs:line 37
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.AbstractReferenceFinder.<>c__DisplayClass12_0.<GetStandardSymbolsNodeMatchFunction>b__0(SyntaxNode node, SemanticModel model) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\Finders\AbstractReferenceFinder.cs:line 132
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.AbstractReferenceFinder.<>c__DisplayClass11_0.<GetStandardSymbolsMatchFunction>b__1(SyntaxToken token, SemanticModel model) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\Finders\AbstractReferenceFinder.cs:line 124
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.AbstractReferenceFinder.FindReferencesInTokensAsync(Document document, IEnumerable`1 tokens, Func`2 tokensMatch, Func`3 symbolsMatch, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\Finders\AbstractReferenceFinder.cs:line 163
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.AbstractReferenceFinder.FindReferencesInDocumentUsingIdentifierAsync(String identifier, Document document, Func`2 tokensMatch, Func`3 symbolsMatch, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\Finders\AbstractReferenceFinder.cs:line 116
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessDocumentAsync(Document document, SymbolAndProjectId symbolAndProjectId, IReferenceFinder finder) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_DocumentProcessing.cs:line 59
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessDocumentAsync(Document document, SymbolAndProjectId symbolAndProjectId, IReferenceFinder finder) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_DocumentProcessing.cs:line 68
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessDocumentQueueAsync(Document document, ValueSet documentQueue) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_DocumentProcessing.cs:line 40
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessDocumentQueueAsync(Document document, ValueSet documentQueue) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_DocumentProcessing.cs:line 47
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessProjectAsync(Project project, MultiDictionary`2 documentMap) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_ProjectProcessing.cs:line 96
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessProjectAsync(Project project, Dictionary`2 projectToDocumentMap) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_ProjectProcessing.cs:line 73
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessProjectAsync(ProjectId projectId, Dictionary`2 projectToDocumentMap, HashSet`1 visitedProjects) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_ProjectProcessing.cs:line 56
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessProjectsAsync(IEnumerable`1 connectedProjectSet, Dictionary`2 projectToDocumentMap) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine_ProjectProcessing.cs:line 36
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.ProcessAsync(Dictionary`2 projectToDocumentMap) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine.cs:line 106
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.FindReferencesAsync(SymbolAndProjectId symbolAndProjectId) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine.cs:line 71
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesSearchEngine.FindReferencesAsync(SymbolAndProjectId symbolAndProjectId) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesSearchEngine.cs:line 71
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindSymbols.SymbolFinder.FindReferencesAsync(SymbolAndProjectId symbolAndProjectId, Solution solution, IStreamingFindReferencesProgress progress, IImmutableSet`1 documents, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindSymbols\SymbolFinder_References.cs:line 57
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindSymbols.SymbolFinder.FindReferencesAsync(ISymbol symbol, Solution solution, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindSymbols\SymbolFinder_References.cs:line 28
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesService.FindReferencedSymbolsInternalAsync(Document document, Int32 position, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesService.cs:line 46
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.Utilities.TaskExtensions.WaitAndGetResult[T](Task`1 task, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\Utilities\TaskExtensions.cs:line 33
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.FindReferences.FindReferencesService.FindReferencedSymbolsAsync(Document document, Int32 position, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\FindReferences\FindReferencesService.cs:line 25
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.CodeLensResolveRequestHandler.CreateReferencesCodeLens(CodeLensResolveRequest request, CodeLens response, Document document, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\CodeLensResolveRequestHandler.cs:line 94
at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.CodeLensResolveRequestHandler.HandleAsync(CodeLensResolveRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\CodeLensResolveRequestHandler.cs:line 80
at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 103
at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\_work\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 108
After disabling the extension, the error is gone.
Current version is not compatible with the AL Language Extension recent update. I get Object definition is not available error as well as Source tables not listed in the New Query Wizard. Works fine with the previous version of AL Language Extension.![image](https://user-images.githubusercontent.com/129790141/229602724-3dc48451-6064-45b0-9821-815677d99812.png)