microsoft / microsoft/AL

VS Copilot creates AL Language Crash with workspaces

Open
#8,304 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug
Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

✅

Please include the following with each issue:

1. Describe the bug
VS Code (latest version) and VS Copilot, an AL workspace (Symbols are in .alpackages)
Asking copilot some question leads to the error and the chat hangs forever (at least not using any credits...)

Image

[Error - 11:22:36] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'al/symbolSearch' failed with error: 'Object reference not set to an instance of an object.'
Details:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ReferenceKeySymbol.AppendFieldMembers(PooledNameObjectDictionary1 fields, ContainerSymbol table) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\Reference\ReferenceKeySymbol.cs:line 83 at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ReferenceKeySymbol.GetLazyFields() in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\Reference\ReferenceKeySymbol.cs:line 60 at System.Lazy1.CreateValue()
at Microsoft.Dynamics.Nav.CodeAnalysis.SymbolDisplayVisitor.VisitKey(KeySymbol symbol) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\SymbolDisplay\SymbolDisplayVisitor.cs:line 897
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.LanguageModelTools.SymbolSearch.SymbolSearchService.SymbolDescriptor.Create(Symbol symbol, Symbol containerSymbol, SymbolSearchScope scope, Boolean isTopLevel, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\LanguageModelTools\SymbolSearch\SymbolSearchService.cs:line 606
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.LanguageModelTools.SymbolSearch.SymbolSearchService.AppendMembers(Builder builder, ContainerSymbol container, Symbol rootContainer, SymbolSearchScope scope, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\LanguageModelTools\SymbolSearch\SymbolSearchService.cs:line 202
at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.LanguageModelTools.SymbolSearch.SymbolSearchService.BuildDescriptors(IEnumerable1 topLevelSymbols, SymbolSearchScope scope, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\LanguageModelTools\SymbolSearch\SymbolSearchService.cs:line 184 at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.LanguageModelTools.SymbolSearch.SymbolSearchService.GetDependencyDescriptorsAsync(Compilation compilation, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\LanguageModelTools\SymbolSearch\SymbolSearchService.cs:line 152 at Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces.LanguageModelTools.SymbolSearch.SymbolSearchService.SearchAsync(ProjectId projectId, SymbolSearchParameters parameters, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\LanguageModelTools\SymbolSearch\SymbolSearchService.cs:line 76 at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.SymbolSearchRequestHandler.HandleAsync(SymbolSearchRequest request, Int32 requestId, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\Tools\SymbolSearchRequestHandler.cs:line 39 at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 85
at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in X:\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 84

2. To Reproduce
Steps to reproduce the behavior:
I have testet without an workspace, and disabled all extensions. even deleting all symbols from the directory did not help - so it is not any problem with the symbols itself (runtimeversions or similar issues)

AL code snippet that demonstrates the issue or a link to a code repository the developers can easily pull down to recreate the issue locally.

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior
The Copilot symbol search should work the same way if a workspace is used or not. I hope the error callstack will help to provide more information
(Object reference not set to an instance of an object.
at Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.ReferenceKeySymbol.AppendFieldMembers(PooledNameObjectDictionary`1 fields, ContainerSymbol table) in X:\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Symbols\Reference\ReferenceKeySymbol.cs:line 83)

4. Actual behavior
Copilot is unusable because it hangs forever. the al error always occures at the same time the copilot shows "Searching for al version"
5. Versions:

  • AL Language: latest 17.0.2273547 (already tested the 28 preview)
  • Visual Studio Code:
    Version: 1.131.0 (user setup)
    Commit: e4c7e7b1d6d060162f4aa7f8225271b67ce1df75
    Datum: 2026-07-28T10:51:25Z
    Electron: 42.7.0
    ElectronBuildId: 14710161
    Chromium: 148.0.7778.280
    Node.js: 24.18.0
    V8: 14.8.178.38-electron.0
    Betriebssystem: Windows_NT x64 10.0.26200
  • Business Central: 28.3 symbols
  • List of Visual Studio Code extensions that you have installed:
    AL Language: latest 17.0.2273547
  • Operating System:
    • Windows
    • Linux
    • MacOS
Final Checklist

Please remember to do the following:

  • [X ] Search the issue repository to ensure you are reporting a new issue

  • [ X] Reproduce the issue after disabling all extensions except the AL Language extension

  • [not possible ] Simplify your code around the issue to better isolate the problem

Internal work item: AB#646418

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported stack trace at ReferenceKeySymbol.cs line 83, then follow SymbolSearchService and SymbolSearchRequestHandler for the al/symbolSearch path. Reproduce the Copilot query in a workspace with symbols in .alpackages and compare it with a non-workspace setup. Done means symbol search no longer raises the null-reference error or leaves Copilot hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.