microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
728 stars 241 forks source link

"Go to Definition" inside an *.dal file opens an new unnecessary duplicate #7611

Open dannoe opened 8 months ago

dannoe commented 8 months ago

1. Describe the bug If you navigate to code inside a dal file and try to navigate even further a new unnecessary duplicate tab is opened.

2. To Reproduce

Path of the first tab: grafik Path of the second unnecessary tab: grafik

3. Expected behavior The vsx should notice that the dal file is already open and not open another dal file with the same name (but other path).

4. Actual behavior It just opens a new tab with the same content.

5. Versions:

BazookaMusic commented 8 months ago

The path looks wrong on the second tab, so maybe this is why this is happening

dannoe commented 8 months ago

My tests were all done in a multi project workspace.

The default "Go to definition" is using the parent folder name (as in the windows explorer) as the first path segment: app in my case

The "AL Explorer" is opening yet another path. It is using the app-id (guid) without dashes: grafik

And AZ AL Dev Tools is using the workspace folder name (which can be changed in the workspace file via name) grafik (Also in AZ AL Dev Tools: Name is URL encoded, space to +, slash to %2F, etc.).

After some time my breakpoints are getting cluttered, looks something like this but more mixed up: grafik

JMA1972 commented 8 months ago

I like it that way, seeing the calling and the called procedure parallel is a boon.

dannoe commented 8 months ago

I like it that way, seeing the calling and the called procedure parallel is a boon.

To switch between the caller and called position I use Alt-LeftArrow or Alt-RightArrow If you want to open it in a split view you can press Alt+F12 then Ctrl+Enter

someC0d3r commented 8 months ago

My tests were all done in a multi project workspace.

The default "Go to definition" is using the parent folder name (as in the windows explorer) as the first path segment: app in my case

The "AL Explorer" is opening yet another path. It is using the app-id (guid) without dashes: grafik

And AZ AL Dev Tools is using the workspace folder name (which can be changed in the workspace file via name) grafik (Also in AZ AL Dev Tools: Name is URL encoded, space to +, slash to %2F, etc.).

After some time my breakpoints are getting cluttered, looks something like this but more mixed up: grafik

Experienced the same thing. A problem is: If you are setting a breakpoint in the duplicated file the breakpoint will not be shown in the actual .dal file. It is a bit confusing as you re-run the process you want to debug and the debugger hooks to the line of code in the "not-duplicated" file but it doesn't show the breakpoint indicator before the line (red circle) in the editor - so you are asking yourself, why the debugger hooked there.