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

Fix bug with selection formatting outside of range #1486

Merged

Conversation

JessicaJHee
Copy link
Contributor

Fixes #1485

Peek 2023-02-17 12-43

Signed-off-by: Jessica He <jhe@redhat.com>
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works very well! Thanks, Jessica!

@datho7561
Copy link
Contributor

This PR addresses the issue Fred pointed out in his comment #1485 (comment), but I think the issue
Christoph pointed out might be related to the limitations of lsp4e with regards to managing spaces vs. tabs (it can't be managed on a per-file type basis from what I understand).

@datho7561 datho7561 merged commit d30d667 into eclipse-lemminx:main Feb 17, 2023
@laeubi
Copy link
Contributor

laeubi commented Feb 20, 2023

@datho7561 I always wondered if not simply the current file style could be used when doing partial formats? I can't think about a use case where a mixed style is desirable (except the file is already mixed type).

@angelozerr
Copy link
Contributor

For formatting it will work, but if you pres tabs (and your configuration is tab), it will generate a tab although you would like to have 2 spaces.

@laeubi
Copy link
Contributor

laeubi commented Feb 20, 2023

I must confess I never really "configured" this :-)
Just from an users POV, the editor should be smart enough by default to simply translate this, let it be partial (or even full!) format or pressing a key that means "indent it some bit". But if it is only partially supported, even that could help, because at least I mostly use auto format rather than start intended the code/xml myself...

@angelozerr
Copy link
Contributor

Before the pom.xml used WTP XML Editor. You can open it with:

image

And I think you should have this settings:

image

Today, the Maven POM Editor uses Generic Editor which uses for XML, lemminx, but badly GenericEditor cannot be configured with custom XML tabs / spaces for a given language.

@JessicaJHee JessicaJHee deleted the 1485-range-formatting-bug branch February 21, 2023 16:22
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.

Partial formating yields wrong intendation deep
4 participants