Skip to content
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

Add workspace/configuration handler that recognizes insertSpaces/tabSize #40

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

mfussenegger
Copy link
Owner

If using a eclipse.jdt.ls version that includes
eclipse-jdtls/eclipse.jdt.ls#1657 this will finally
make code-actions respect the clients shiftwidth/expandtab options and
no longer include tabs when the user uses spaces.

The alternative to overriding the handler would have been to document
that users should include these options in their config.settings, but
given that there is no good reason that I can think of where you don't
want to respond with your local editor settings it seems justified to
include this out of the box instead of requiring every user to add this.

If using a eclipse.jdt.ls version that includes
eclipse-jdtls/eclipse.jdt.ls#1657 this will finally
make code-actions respect the clients shiftwidth/expandtab options and
no longer include tabs when the user uses spaces.

The alternative to overriding the handler would have been to document
that users should include these options in their `config.settings`, but
given that there is no good reason that I can think of where you don't
want to respond with your local editor settings it seems justified to
include this out of the box instead of requiring every user to add this.
@mfussenegger mfussenegger merged commit 373fb66 into master Feb 24, 2021
@mfussenegger mfussenegger deleted the workspace-configuration branch February 24, 2021 16:39
@Jumziey
Copy link

Jumziey commented Feb 13, 2022

Being one who work on different java project with different standards, it was really confusing why the jdtls wouldn't pick up the tabsize and insertSpace settings of the format.xml that was specific for the project. Now i know why at least... This should at least be documented in the readme 😅 (sure would have saved me a few evenings).

Granted you probably want to have these settings set the same, since it will be a bit yanky otherwise. But if you're dumb as me and start of with the formatting rules and then get annoyed at the editor settings and fix them, it can be rather confusing 😂

Psst: freakin' awesome work with this plugin, this together with your blog post have actually made java development enjoyable form me.

@mfussenegger
Copy link
Owner Author

Not really sure where to put this as I don't document the format.xml at all but instead refer to the eclipse.jdt.ls wiki.

Any suggestions? I'm thinking of adding an item to the troubleshooting list.

@Jumziey
Copy link

Jumziey commented Mar 4, 2022

Troubleshooting list is fine IMO :)

It's that or perhaps a note about it where you refer to the eclipse.jdt.ls wiki ^^

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.

2 participants