usethesource / rascal-language-servers

An LSP server for Rascal which includes an easy-to-use LSP generator for languages implemented in Rascal, and an interactive terminal REPL.
BSD 2-Clause "Simplified" License
10 stars 7 forks source link

VS Code is interpretting location in debugger view incorrectly. #372

Open koenvanwijk opened 2 months ago

koenvanwijk commented 2 months ago

Describe the bug

The location links in the debugger variable window fail to load the correct file.

To Reproduce image

Steps to reproduce the behavior:

  1. Start the debugger
  2. Ctrl-click any location link.

Expected behavior I expect the file to open and highlight the correct location.

Screenshots

Stack traces

Literally copy stacktraces from the console, or from the Eclipse Error log here.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

DavyLandman commented 2 months ago

True this is an open issue, it's a variant of this generic #293.

When writing the debugger last year, it was not possible to provide custom actions for debug values, but there is a new API announced that we should take a look at, that would allow us to provide custom debug value viewers etc.

koenvanwijk commented 2 months ago

Who is stripping the begin and end character?

DavyLandman commented 2 months ago

VS Code is automatically detecting a 'bare' URI inside of the rascal location. And in other places (like the terminal) VS code has an extension point for us to explain: no actually, that's a location and this is where it points to in the file etc. they've recently added this click feature to debugger values, so we should figure out if we can teach vs code about source locations.

(I'm allocating some time in the near future to figure out what's possible)

DavyLandman commented 2 months ago

Ok, it's a proposed API (so not available yet for general extensions, but tends to be used internally).

Looks like once it's finished, we'll be able to add visualizers for ParseTrees and locations and the rest of the values.