-
Notifications
You must be signed in to change notification settings - Fork 13
Description
When a new, untitled file is assigned to the Parametric Lang, the didOpen executes with params.getTextDocument().getUri() == "untitled:Untitled-1". A new TextDocumentState is created with a Java-side URI like |untitled:///:Untitled-1|.
When parse errors are reported back to VS Code, they appear in the Problems pane with a title like ":Untitled-1", but NOT as red squiggles in the open, untitled document. Clicking the problem opens a 2nd untitled document:
To Reproduce
Steps to reproduce the behavior:
- Launch the 2nd-level VS Code
- Load the PICO language via REPL
- Open new untitled document
- Set the document language to Parametric Rascal LSP
- Any invalid program will generate parse errors in the Problems pane
- An empty document is an invalid program
- Click the "problem" to navigate to the document
- A 2nd, blank "Plain Text" untitled document will open.
Expected behavior
Errors found in untitled documents (or other custom URI formats?) can be navigated to and cause red squiggles to appear.
Desktop:
- Context: VS Code w/ Rascal Metaprogramming Language 0.12.2
- DSL Extension using
- rascal v0.40.17
- rascal-lsp v2.21.1 (with changes from Add support for extensionless documents to the parametric language server #894)
Additional context
This appears to be related to special fallback logic in Locations.java toLoc(String uri) where the untitled:Untitled-1 URI fails with the "Opaque URI" message and is then converted to untitled:///:Untitled-1 (notice there are two colons).
I tried removing the 2nd colon, which I think is a mistake, but it doesn't solve the problem. I also tried using a single / instead of ///. None of these worked - probably because "untitlted:Untitled-1" <> "untitlted:/Untitled-1" within VS Code.