-
Notifications
You must be signed in to change notification settings - Fork 93
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
Partial formating yields wrong intendation deep #1485
Comments
Can you check in VS Code with https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml? |
@laeubi could you share your xml file please in order we can test with the same usecase than you. |
|
the issue seen in Eclipse might be LSP4E sending the wrong indentation character to lemminx |
I trust you as the experts in this area to direct this to the right place, as a user I have no idea what all makes the difference here and can only guess it is related to Lemminx as the editr claims to be Lemminx based :-) |
@JessicaJHee could you see please the problem of @fbricon described in #1485 (comment) thanks |
@laeubi if you format the whole file in WWD and after you retry your usecase. Is it working better? |
@angelozerr I'm not sure about WWD? I'm just using Eclipse with m2e, so if you download for example the last ibuild, create a new project and copy the file into it one should be able to reproduce (and probably see what/if other components are interfering here). |
Sorry @laeubi, I'm too technical: WWD is the eclipse plugin which consumes lemminx: if you format the whole file in Eclipse IDE and after you retry your usecase. Is it working better? |
@fbricon this problem has been fixed by @JessicaJHee with #1486 |
@laeubi the problem comes from WWD WWD which doesn't allow to configure spaces / tabs, see eclipse-wildwebdeveloper/wildwebdeveloper#872 Indeed, if you show spaces / tabs you will notice that the indentation that you expect is spaces (and not tabs) As WWD cannot configure the spaces / tabs for a given language like XML, it uses the default spaces / tabs which uses tabs and not spaces. So when you format your select, the format uses tabs and not spaces. if you change to spaces It should work, but all editor will use this configuration (ex : Java, etc). It is not a trivial issue because it requires some changes to Eclipse Platform. I created a draft PR eclipse-platform/eclipse.platform.text#130 I close this issue since it is an issue of Eclipse Platform / WWD, please follow eclipse-wildwebdeveloper/wildwebdeveloper#872 @mickaelistria I think eclipse-platform/eclipse.platform.text#130 |
@angelozerr thanks for the detailed analysis. I think for partial formatting, it would be great if lemminx would just use the existing style of the document, that most likely what a user will expect and desire. |
I had this idea, we could do that for formatting, but the main problem is if you are in tabs configuration (like you are), if you press tabs, it will generate a tab although your XML sample uses spaces. |
If I format only a part of the document one gets wrong indentation, e.g.:
Current
Expected
The text was updated successfully, but these errors were encountered: