Skip to content

Wrap selection in XML element #794

Closed
@adunning

Description

@adunning

Most XML editors have a feature to wrap the current selection in an XML element, providing completion to suggest valid tags at that point in a file.

Within VS Code, the built-in 'Emmet: Wrap with Abbreviation' function provides part of this, but it is not XML-aware and does not give a list of the allowed tags in the current context. It would thus be brilliant if the XML extension could provide this.

There are at least two ways to implement this:

  1. Inline: TextMate allows the user to make a selection, then type Ctrl + < to insert open/close tags around it, balancing the element name as the user types. The VS Code XML plugin could use this approach to immediately provide a list of options identical to the current functionality when typing <.
  2. With a dialogue box: Similar to the existing Emmet function but with autocompletion. The Oxygen XML Editor, for example, provides such a dialogue with the shortcut Ctrl + E. The Scholarly XML extension for VS Code has an implementation of this, but it conflicts with this XML plugin.

Many thanks for your work on this project and considering this request!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions