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

XML editor: select enclosing element not working #1140

Closed
dstango opened this issue Mar 18, 2023 · 9 comments
Closed

XML editor: select enclosing element not working #1140

dstango opened this issue Mar 18, 2023 · 9 comments
Assignees

Comments

@dstango
Copy link

dstango commented Mar 18, 2023

I first noticed this issue in the m2e-pom-editor and was pointed to post it here (see eclipse-m2e/m2e-core#1315):

The "regular" XML-Editor of Eclipse has the handy feature of "select enclosing element":

  • Alt-Shift-Up: expands the current selection, e.g. (| representing the cursor, [ ] a range selection):
    <maven.compiler.source>1|.8</maven.compiler.source> --> <maven.compiler.source>[1.8]</maven.compiler.source> --> [<maven.compiler.source>1.8</maven.compiler.source>]
  • Alt-Shift-Down: does the opposite (restore last selection):
    [<maven.compiler.source>1.8</maven.compiler.source>] --> <maven.compiler.source>[1.8]</maven.compiler.source> --> <maven.compiler.source>1|.8</maven.compiler.source>

This does not work in the m2e-pom editor, which is supposed to use the wildwebdeveloper-xml-editor as a component.

@angelozerr
Copy link
Contributor

angelozerr commented Mar 19, 2023

I think it is a LSP4E feature since XML language servier LemMinX support this feature with textDocument/selectionRange.

I created the issue eclipse/lsp4e#561

@dstango
Copy link
Author

dstango commented Mar 19, 2023

Thanks. Do you think the "regular" XML-Editor (available in "Eclipse for Java developers", offering a context menu "Open with/XML Editor") doesn't use LSP4E? Because there it's working fine ...

@angelozerr
Copy link
Contributor

The XML editor comes from WTP plugin and it doesnt use LSP4E.

We need to support that in LSP4E.

@angelozerr
Copy link
Contributor

angelozerr commented Mar 19, 2023

See selectionRange on vscode which uses XML language server LemMinX https://github.com/redhat-developer/vscode-xml/blob/main/docs/Features/XMLFeatures.md#selection-range

@dstango
Copy link
Author

dstango commented Mar 19, 2023

Thanks for the clarification. There are other shortcuts, that don't seem work like in other editors, like Ctrl-2+R or Alt-Shift-R for renaming. Yet the link you provided shows the language server seems to provide support for it.
Shall I open a seperate issue for that, now that I seem to have found the right repository?

@angelozerr
Copy link
Contributor

There are other shortcuts, that don't seem work like in other editors, like Ctrl-2+R or Alt-Shift-R for renaming.

Alt-Shift-R should work? But as you should have auto rename tag activated by default https://github.com/redhat-developer/vscode-xml/blob/main/docs/Features/XMLFeatures.md#auto-rename-tag you should not need the rename I think.

@dstango
Copy link
Author

dstango commented Mar 19, 2023

thanks, I just checked, and your point is valid: auto rename tag seems to be activated by default (didn't find a way to deactivate ;-)...). It seems to need a bit of a moment to kick in though. And when pressing ESC it's deactivated and I wouldn't know how to activate it again. But no big deal.

Alt-Shift-R/Ctrl-R+2 doesn't work though. Actually it would be especially nice for renaming maven properties, but I guess that would be a request to go back to m2e, right?

@angelozerr
Copy link
Contributor

 find a way to deactivate ;

Indeed it is not possible. Please create an issue to lsp4e to provide for instance a push button in the toolbar like we have for highlight

And when pressing ESC it's deactivated and I wouldn't know how to activate it again. But no big deal.

I suggest that you create an another issue in lsp4e

Alt-Shift-R/Ctrl-R+2 doesn't work though.

I suggest that you create a new issue in lsp4e

Actually it would be especially nice for renaming maven properties

Isuggest that you create an issue in lemminx-maven github project which is an extension of the xml language server lemminx for maven

@vrubezhny
Copy link
Contributor

Closing as fixed - when using Generic Text Editor (m2e-core Editor Lemminx) for editing a POM file - select enclosing actions and keybinding shortcuts work as expected. The problem still happens when using the Maven POM Editor (multipage) .

See: eclipse-m2e/m2e-core#1502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants