Repository navigation
Auto Rename Tag #130
Description
Activity
@angelozerr @xorye @NikolasKomonen that feature is now available for HTML tags: microsoft/vscode#47069. Would be nice to extend it to XML as well.
Thanks @fbricon for this great news! It seems we should support
- a custom request
MatchingTagPositionRequeston LSP4XML (server side) - that we should consume on vscode-xml (on client side).
See commit at microsoft/vscode@0d25d0a
But pay attention with this feature, it seems that there are some trouble microsoft/vscode#85715
- a custom request
@angelozerr The bugs you pointed are already fixed. To implement this feature for XML, you can support
MatchingTagPositionRequeston the server and reference the implementation in our HTML server.The bugs you pointed are already fixed.
Thanks for the information!
To implement this feature for XML, you can support MatchingTagPositionRequest on the server and reference the implementation in our HTML server.
What do you mean with
reference the implementation in our HTML server?@fbricon I think we should really implement this very cool feature.
@angelozerr https://github.com/microsoft/vscode/blob/master/extensions/html-language-features/client/src/mirrorCursor.ts
There's nothing in LSP that correspond to adding a cursor. So if you want to implement this, the best you can do is to use VS Code's API like the html language client is currently doing.
Please note that
MatchingTagPositionRequestis not an official name.- added 4 commits that reference this issue
on Dec 10, 2019 6 remaining items
- added 2 commits that reference this issue
on Dec 13, 2019 Feature doesn't work (see #211 )
I can't repro the problem in HTML though. Are you doing anything XML specific?
One feature that was specific to vscode-xml was that we added the ability to toggle the
xml.mirrorCursorOnMatchingTagfeature with Ctrl/Cmd + shift + f2.A new listener was added to detect changes to
xml.mirrorCursorOnMatchingTagand called theonDidChangeTextEditorSelection()function in order to update the cursor immediately on toggle.I'm guessing that we had problems because we didn't have
if (event.textEditor.document?.languageId !== 'xml' ) { return; }in our
onDidChangeTextEditorSelection()function.There is also some discussion going on here: VSCode: Improve mirror cursor implementation with Synced Regions #88424
Thanks @bmix for this great information!
@xorye we should manage synced region in LemMinx side and consume it. See HTML Language server commit microsoft/vscode@01e01b1 but I suggest you see for each files the master code (if there are some fixes)
Fixed with LSP Lineked Editing, see https://github.com/redhat-developer/vscode-xml/blob/master/docs/Features/XMLFeatures.md#linked-editing
I just realized, with the help of @angelozerr at lsp4xml/#362, that synced renaming and deletion of two tags, that belong together, may best be done via some simple text manipulation on the client side. I now have installed a little extension into VSCode, that does just that (minus paired delete, sadly), but it may well fit also into your project, so to keep things together.