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
722 stars 242 forks source link

[AL Language VSC Extension] Debugging in Codespaces fails to show the code when hitting breakpoint #7649

Closed lippertmarkus closed 5 months ago

lippertmarkus commented 5 months ago

Please include the following with each issue:

1. Describe the bug When using GitHub Codespaces and a breakpoint is hit in the AL code, the execution seems to stop correctly (variables and database statistics are available in debug window), but source code isn't shown. Error:

image

2. To Reproduce Steps to reproduce the behavior:

  1. Open an AL-Go repo inside a codespace
  2. Setup your development environment and launch.json
  3. Set a breakpoint within your app code
  4. Publish the app and do the according action in the web client to hit the breakpoint
  5. Verify that the execution stopped and the debugger shows variables + database statistics but an error shows that the source code file can't be openend although it exists under the exact same path

Example Hello World App: https://github.com/lippertmarkus/MyAlGoRepoAppSource/blob/main/MyApp/HelloWorld.al#L9

3. Expected behavior Source code where the breakpoint was hit should be shown.

4. Actual behavior Error is shown:

The editor could not be opened due to an unexpected error: Unable to read file
'/workspaces/MyAlGoRepoAppSource/MyApp/HelloWorld.al'
(Unavailable (FileSystemError): Error: No file system handle registered (/workspaces))

Video:

https://github.com/microsoft/AL/assets/1463140/e1537cdd-45aa-4720-a73f-01894816d76b

5. Versions:

Final Checklist

Please remember to do the following:

lippertmarkus commented 5 months ago

Note: It also doesn't work with https://marketplace.visualstudio.com/items?itemName=StefanMaron.allanguagelinuxpatcher from @StefanMaron

StefanMaron commented 5 months ago

I noticed that it only works when accessing the codespace with local vs code running on Linux when you have a copy of the repository at the exact same location locally as it is in the codespace

lippertmarkus commented 5 months ago

Thanks for the feedback @StefanMaron. Maybe we can get a built-in fix which works everywhere from the AL-Team :)

kalberes commented 5 months ago

We do not have proper support for debugging within codespaces. One of the issue being the same file canonicalization issues you have seen. What I can tell you is that it is in the timeline. ETA: "Good question"