AL
AL copied to clipboard
Go to definition does no longer work on event subscribers (BC 23 / runtime 12)
Please include the following with each issue:
1. Describe the bug When an event subscriber is declared, the Ctrl + Click (or Go to definition) to navigate to the source event publisher does no longer work. It opens the file, but the cursor is positioned on top of the file, instead of at the event publisher definition.
2. To Reproduce
3. Expected behavior Go to definition on an event subscribers should navigate to the publisher definition if the source al file.
4. Actual behavior
5. Versions:
Name: AL Language extension for Microsoft Dynamics 365 Business Central Id: ms-dynamics-smb.al Description: Development tools for Dynamics 365 Business Central Version: 12.3.900902 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al
- Visual Studio Code:
- Business Central: BC 23.0
- List of Visual Studio Code extensions that you have installed:
This is only the case for EventSubscribers on Tables via Database::XYZ and only if they are defined as "identifier" events.
[EventSubscriber(ObjectType::Table, Database::"Sales Line", OnAfterAssignGLAccountValues, '', false, false)]
If you write them as argument literal, the "Go to Definition" will still work.
[EventSubscriber(ObjectType::Table, Database::"Sales Line", 'OnAfterAssignGLAccountValues', '', false, false)]
@fvet , @dannoe - Can you provide more information about the project you are using. How does your manifest look like? Are you in a workspace? Which version of the Base Application are you compiling against?
I was not able to reproduce this issue on the latest version of the compiler when compiling against a preview version of Base App (version 24.x.y.z), see below:
Microsoft_Base Application_23.3.14876.15726
Here is a test project: ALProject23.zip
I disabled all extensions except AL and disabled all user settings.
Retested with latest vsix v12.6.936426
(Did not use the pre-release, as it still contains various other issues, failing to compile our apps. See https://github.com/StefanMaron/BusinessCentral.LinterCop/issues/523#issuecomment-1948478211)
App.json
"platform": "23.0.0.0",
"application": "23.1.0.0",
"runtime": "12.1",
Not using workspaces
Settings.json
Alpackages are located in another directory
"al.packageCachePath": "C:\\Projects\\xxx\\.alpackages",
Findings
On codeunits, all is ok, only for tables (with namespaces), the Go To Definition fails to find the correct position of the event publisher.
+1, encountering the same issue.
I couldnt repro this issue using the latest version of the AL extension and the provided alproject. Can you verify if you still can repro the issue?