Skip to content

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

Merged
merged 1 commit into from
Aug 9, 2024
Merged

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Aug 1, 2024

Copy link
Contributor

@rgrunber rgrunber left a 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.

@snjeza snjeza changed the title Recognize custom file extensions [WIP] Recognize custom file extensions Aug 2, 2024
@snjeza
Copy link
Contributor Author

snjeza commented Aug 6, 2024

@rgrunber I have updated the PR.

@snjeza snjeza changed the title [WIP] Recognize custom file extensions Recognize custom file extensions Aug 6, 2024
@snjeza snjeza removed the in progress label Aug 6, 2024
Copy link
Contributor

@rgrunber rgrunber left a 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 :

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))

@snjeza snjeza changed the title Recognize custom file extensions [WIP] Recognize custom file extensions Aug 7, 2024
@snjeza snjeza force-pushed the issue-3222 branch 2 times, most recently from c1c1e16 to 6c95f75 Compare August 7, 2024 12:45
@snjeza
Copy link
Contributor Author

snjeza commented Aug 7, 2024

Of all the references to ".java" left in the language server, I think this one might be worth changing :

I have fixed it. Could you, please, review it.

@snjeza snjeza changed the title [WIP] Recognize custom file extensions Recognize custom file extensions Aug 7, 2024
@snjeza snjeza removed the in progress label Aug 7, 2024
@rgrunber rgrunber added this to the End August 2024 milestone Aug 7, 2024
@rgrunber
Copy link
Contributor

rgrunber commented Aug 8, 2024

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.mp4

Notice 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 ?

@snjeza
Copy link
Contributor Author

snjeza commented Aug 8, 2024

Notice 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. Checking... I have fixed it.
@rgrunber Could you, please, check again?

@rgrunber
Copy link
Contributor

rgrunber commented Aug 8, 2024

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.

@snjeza
Copy link
Contributor Author

snjeza commented Aug 8, 2024

How about this. Let's undo the change you made...

It is done.

Copy link
Contributor

@rgrunber rgrunber left a 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.

@snjeza snjeza merged commit ebd30cd into eclipse-jdtls:master Aug 9, 2024
6 checks passed
@rgrunber rgrunber removed this from the End August 2024 milestone Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom file extensions
2 participants