-
Notifications
You must be signed in to change notification settings - Fork 13
Add support for extensionless documents to the parametric language server #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
71d6e42 to
eee3004
Compare
DavyLandman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm impressed how little changes there are on the java side. So let's indeed make sure our tests have some coverage of this feature, such that we know it works properly.
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/parametric/ParametricTextDocumentService.java
Outdated
Show resolved
Hide resolved
d56434a to
27910b5
Compare
DavyLandman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the test succeed, I think this is ready to merge.
The new test fails on MacOS. The steps were basically copied from
|
|
In general we've found that there are cases where the test need some extra retries (ignore failures and friends). We've worked hard to make sure that the current tests succeed in every run, if you're stuck on this, please let me know, I'll ask someone to take a look and see if they can figure out why it's failing. |
Please have someone else take a look. |
rodinaarssen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @urbanfly.
What a remarkably small PR for this feature! Your test issues are caused by a combination of two factors:
- The parametric text document service did not properly clear out diagnostics of "transient files", such as the unsaved untitled files you are playing with. I've submitted a PR (#902) to fix that.
- I think the special-casing of extensionless files you added in this PR should be applied at another method; I took the liberty of adding a suggestion in this review.
With these two things fixed, it "works on my machine". After the merge of the aforementioned PR, could you update your branch and see whether the test issues are resolved? Thanks!
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/parametric/ParametricTextDocumentService.java
Outdated
Show resolved
Hide resolved
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/parametric/ParametricTextDocumentService.java
Outdated
Show resolved
Hide resolved
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/parametric/ParametricTextDocumentService.java
Outdated
Show resolved
Hide resolved
|
Thanks for the help, @rodinaarssen. Can you help me understand how "not clearing diagnostics" was causing my test to fail on MacOS? Also, why is the change to
|
Co-authored-by: Rodin Aarssen <[email protected]>
The stack traces in the CI logs and the screenshots indicated to me that the uncleared diagnostics were causing UX issues in the IDE. In this case, a parse error would not be cleared upon closing the untitled file, and it would be reinstated by VS Code when a new untitled file (with the same "name") would be opened, and it would even persist with correct pico. I hope that solving this issue will make the test succeed, but if not, we'll have to dive deeper. At the very least then, this attempt to fix your test will have fixed an actual bug.
Playing the devil's advocate a bit: isn't it, in essence, the same lie as in
I don't think there's any guarantee that the argument of
I agree that |
The test doesn't assert "no red squiggles", though.
One is asking an explicit question "Is this language registered?"; the other is saying "give me the language for this document - if you can figure it out". I don't see the change to
@DavyLandman and I experimented with this a bit and I think we agreed that removing the condition is fine. It will be called for unmanaged files, but there should be no harm in telling VS Code "we don't have any diags for this file" |
|
I updated the code after discussing with @DavyLandman and made this branch up-to-date.
|
|
Unfortunately, it seems to have been a red herring (although the logs identified an actual bug). We'll dig deeper to see whether we can pinpoint what's causing this particular test to fail on macOS; we know that the test framework sometimes behaves differently on macOS than on Windows/Ubuntu. |
When there is only one language contributed and the document has no extension, use the single language.
Fixes #862
Fixes #868