Skip to content

Commit

Permalink
Wrap selection in XML element
Browse files Browse the repository at this point in the history
Fixes redhat-developer#794

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Dec 6, 2022
1 parent 6244279 commit 8183f86
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 33 deletions.
48 changes: 24 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 47 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@types/fs-extra": "^8.1.2",
"@types/glob": "^7.1.4",
"@types/node": "^10.14.16",
"@types/vscode": "^1.37.0",
"@types/vscode": "^1.73.1",
"@types/yauzl": "^2.9.1",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
Expand Down Expand Up @@ -684,17 +684,61 @@
"command": "xml.restart.language.server",
"title": "Restart XML Language Server",
"category": "XML"
},
{
"command": "xml.refactor.surround.with.tags",
"title": "Surround with Tags (Wrap)",
"category": "XML"
},
{
"command": "xml.refactor.surround.with.comments",
"title": "Surround with Comments",
"category": "XML"
},
{
"command": "xml.refactor.surround.with.cdata",
"title": "Surround with CDATA",
"category": "XML"
}
],
"menus": {
"commandPalette": [
{
"command": "xml.validation.current.file",
"when": "editorLangId == xml"
"when": "editorLangId == xml || editorLangId == dtd || editorLangId == xsl || editorLangId == svg"
},
{
"command": "xml.command.bind.grammar",
"when": "resourceFilename =~ /xml/ && editorIsOpen"
},
{
"command": "xml.refactor.surround.with.tags",
"when": "editorLangId == xml || editorLangId == xsl || editorLangId == svg"
},
{
"command": "xml.refactor.surround.with.comments",
"when": "editorLangId == xml || editorLangId == xsl || editorLangId == svg"
},
{
"command": "xml.refactor.surround.with.cdata",
"when": "editorLangId == xml || editorLangId == xsl || editorLangId == svg"
}
],
"editor/context": [
{
"command": "xml.refactor.surround.with.tags",
"when": "editorLangId == xml || editorLangId == xsl || editorLangId == svg",
"group": "1_xmlactions"
},
{
"command": "xml.refactor.surround.with.comments",
"when": "editorLangId == xml || editorLangId == xsl || editorLangId == svg",
"group": "1_xmlactions"
},
{
"command": "xml.refactor.surround.with.cdata",
"when": "editorLangId == xml || editorLangId == xsl || editorLangId == svg",
"group": "1_xmlactions"
}
]
},
Expand All @@ -705,4 +749,4 @@
}
]
}
}
}
11 changes: 10 additions & 1 deletion src/commands/clientCommandConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,13 @@ export const EXECUTE_WORKSPACE_COMMAND = 'xml.workspace.executeCommand';
/**
* Command to restart connection to language server.
*/
export const RESTART_LANGUAGE_SERVER = 'xml.restart.language.server';
export const RESTART_LANGUAGE_SERVER = 'xml.restart.language.server';

/**
* Command to wrap element.
*/
export const REFACTOR_SURROUND_WITH_TAGS = 'xml.refactor.surround.with.tags';

export const REFACTOR_SURROUND_WITH_COMMENTS = 'xml.refactor.surround.with.comments';

export const REFACTOR_SURROUND_WITH_CDATA = 'xml.refactor.surround.with.cdata';
Loading

0 comments on commit 8183f86

Please sign in to comment.