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

wrap element around xml with schema based suggestions #605

Closed
otichy opened this issue Oct 17, 2021 · 9 comments
Closed

wrap element around xml with schema based suggestions #605

otichy opened this issue Oct 17, 2021 · 9 comments

Comments

@otichy
Copy link

otichy commented Oct 17, 2021

It would be great to have the oXygen like ability to wrap a selected text with an xml element.

This is currently partly implemented in VS Code as "Emmet: Wrap with abbreviation" command, but it lacks suggestions/completion based on the associated schema.

@angelozerr
Copy link
Contributor

Could you give us more explanation about this feature please.

@otichy
Copy link
Author

otichy commented Jan 31, 2022

Maybe it's best if I describe it functionally: I wan to tag data in an XML file with a schema attached. The way oXygen deals with it, is that you select the text/string you want tagged, press a hotkey and a selection of element names valid for that position pops up. Selecting an element name surrounds the selected text/string with that element.

@angelozerr
Copy link
Contributor

Sorry there is no XML and XSD attached.

@otichy
Copy link
Author

otichy commented Jan 31, 2022

Sorry, but this is a general remark, not about a specific XML file or a specific XSD. Maybe if what I am saying is not clear, try opening any XML in VSCode, select a piece of text and use the "Emmet: Wrap with Abbreviation" in the Command Palette. This is exactly what I am looking for, but instead of manually entering the element name, I would like a selection of valid element names based on an attached schema.

@angelozerr
Copy link
Contributor

angelozerr commented Feb 3, 2022

Indeed it should be nice to have that, but I don't know when we will have time to implement it.

I think we should implement an Emmet engine on XML Language server side to provide emmet support but based on XSD, DTD. It's a very long and hard task.

@otichy
Copy link
Author

otichy commented Feb 3, 2022

OK, it seemed simple for a user perspective, since schema based suggestions for tag completion is already implemented, but I know that the developer perspective may be very different here. Thanks for looking into it and perhaps one day!

@angelozerr
Copy link
Contributor

The main problem is that Emmet support from vscode is not customizable; we have not the capability to say "hey please provides those given elements"

It means that we must re-implement Emet support inside the XML Language Server which is written in Java (although Emet is written in JS)

@otichy
Copy link
Author

otichy commented Feb 3, 2022

Right, that does not sound good. However, I gave the emmet function just as an example of how it should work, but it certainly does not have to be implemented through that. If you could just make VScode wrap an element with an element whose name would be selectable from valid schema based choices, maybe emmet does not have to be involved at all.

@datho7561
Copy link
Contributor

Closed in #813. The prerelease that contains the feature should be out on December 9th, please let us know if you run into any issues.

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

No branches or pull requests

3 participants