AL icon indicating copy to clipboard operation
AL copied to clipboard

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

Open dannoe opened this issue 2 years ago • 5 comments

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

  • Search for a record variable inside your app, e.g. Record "Prod. Order Line".
  • Execute the "Go to Definition" on the "Prod. Order Line"
  • A new tab opens with the "Prod. Order Line"
  • Select a line with a local reference, e.g. TestField("Finished Quantity", 0);
  • Place your cursor inside "Finished Quantity" and execute "Go to Definition"
  • A new (unnecessary) tab opens and shows the field definition of "Finished Quantity".

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:

  • AL Language: v12.3.900902
  • Visual Studio Code: 1.84.2
  • List of Visual Studio Code extensions that you have installed: Deactivated all except AL

dannoe avatar Dec 04 '23 14:12 dannoe

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

BazookaMusic avatar Dec 04 '23 16:12 BazookaMusic

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

dannoe avatar Dec 04 '23 17:12 dannoe

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

JMA1972 avatar Dec 05 '23 11:12 JMA1972

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

dannoe avatar Dec 05 '23 13:12 dannoe

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.

someC0d3r avatar Dec 07 '23 15:12 someC0d3r