-
Notifications
You must be signed in to change notification settings - Fork 414
Recognize custom file extensions #3230
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
Conversation
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.
Overall, change looks pretty good. I tried it out and seemed to be working well. Just one small thing regarding whether we can react to setting changes without a restart, and what patterns we should support.
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/BaseInitHandler.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/BaseInitHandler.java
Outdated
Show resolved
Hide resolved
@rgrunber I have updated the PR. |
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.
Of all the references to ".java" left in the language server, I think this one might be worth changing :
Line 390 in b7998dc
String newUri = documentUri.replace(oldName, newName + ".java"); |
It handles how a file gets renamed when we modify the underlying type declaration. See the original example I gave at redhat-developer/vscode-java#3731 (comment) .
(Also, don't worry about touching any ".java" references in PasteEventHandler
. I interpret that as a case where if we get to decide what to call a new file, we should choose the "default" file extension (ie. .java
))
c1c1e16
to
6c95f75
Compare
I have fixed it. Could you, please, review it. |
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/PreferenceManager.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
Overall, I think this is ready to merge. Initially I wanted the warning to be in the form of a popup on the client-side so users know immediately their file association is not valid, but we can live with this. It should be very clear it isn't working. I noticed some odd behaviour though. Screencast.from.2024-08-08.12-29-11.mp4Notice how diagnostics while typing only begin to happen after the file is saved that initial time. Is there a reason for that ? Is there some aspect of the support that doesn't get updated until after a save occurs ? |
I can reproduce it. |
How about this. Let's undo the change you made in https://github.com/eclipse-jdtls/eclipse.jdt.ls/compare/2ae2cf648731e5d568199c325769d60307bfe74a..883d155fb1a67bb4b17eefd413675bcfc6df0450 and i'll just review the issue while ignoring that. I think it's worth asking on vscode-languageserver-node about this, and we should probably avoid embedding something too VS Code-specific into the language server. |
It is done. |
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.
Just one minor thing. Once fixed, feel free to merge this.
Fixes #3222
Requires redhat-developer/vscode-java#3731