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

Add hyperlink detector for our location notation in VScode's editors that behaves the same as our terminal hyperlink detectors. #293

Open linuswagner opened 1 year ago

linuswagner commented 1 year ago

I want to access the link |project://mapper/src/main/rascal/DebugUtil/weird.xml|(40,8,<2,15>,<2,23>). In the terminal that works fine.

If I paste this link into a text file and try to access it, the position part at the end is ignored and I jump to the file instead of the exact position in the file. This is also highlighted visually, as only the location part inside |...| is underlined.

jurgenvinju commented 1 year ago

Ah yes. the reason is that we are not using a common representation for offsets into a file. That has been added later in VScode and github, but everybody uses a different standard. So "plain" text editor simply only see a URI or a URL and go for that.

We could fix it by registering a language server for Rascal values for a specific file extension and parsing the input and resolving the links ourselves. We used to have such a language in Eclipse as well I believe.

There is also vis::Basic with which you can browse Rascal values. All source locations are proper links in that visualization.

I'm leaving this one open for discussion.

DavyLandman commented 12 months ago

I think this issue is on the wrong repo.

In VS Code we actually have a custom hyperlink detector for the terminal, that overrides the default.

linuswagner commented 12 months ago

I think this issue is on the wrong repo.

In VS Code we actually have a custom hyperlink detector for the terminal, that overrides the default.

Is this not something that is related to what VS Code identifies as a hyperlink and how it handles that? Where else would it be suited?

DavyLandman commented 12 months ago

True, but this is the vallang repo. I'll try to move it to vscode

On Wed, 13 Sep 2023, 22:41 Linus Wagner, @.***> wrote:

I think this issue is on the wrong repo.

In VS Code we actually have a custom hyperlink detector for the terminal, that overrides the default.

Is this not something that is related to what VS Code identifies as a hyperlink and how it handles that? Where else would it be suited?

— Reply to this email directly, view it on GitHub https://github.com/usethesource/rascal-language-servers/issues/293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABL3E5CYQ2J4CNRDXW5CPTX2IK7LANCNFSM6AAAAAAZRSTJZ4 . You are receiving this because you commented.Message ID: @.***>

linuswagner commented 12 months ago

:facepalm:

jurgenvinju commented 12 months ago

We can summarize as follows: add a hyperlink detector for Rascal files but also other (text) files in VScode that can recognize our offsets/lengths, lines and columns. And try to see how we do not interact with the other existing detectors.