You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@angelozerr The bugs you pointed are already fixed. To implement this feature for XML, you can support MatchingTagPositionRequest on the server and reference the implementation in our HTML server.
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 MatchingTagPositionRequest is not an official name.
One feature that was specific to vscode-xml was that we added the ability to toggle the xml.mirrorCursorOnMatchingTag feature with Ctrl/Cmd + shift + f2.
A new listener was added to detect changes to xml.mirrorCursorOnMatchingTag and called the onDidChangeTextEditorSelection() 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;
}
@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)
Activity
fbricon commentedon Nov 29, 2019
@angelozerr @xorye @NikolasKomonen that feature is now available for HTML tags: microsoft/vscode#47069. Would be nice to extend it to XML as well.
angelozerr commentedon Nov 29, 2019
Thanks @fbricon for this great news! It seems we should support
MatchingTagPositionRequeston LSP4XML (server side)See commit at microsoft/vscode@0d25d0a
But pay attention with this feature, it seems that there are some trouble microsoft/vscode#85715
octref commentedon Dec 6, 2019
@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.angelozerr commentedon Dec 6, 2019
Thanks for the information!
What do you mean with
reference the implementation in our HTML server?@fbricon I think we should really implement this very cool feature.
octref commentedon Dec 6, 2019
@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.Adds editin of start/end tag simultaneously
Allows editing of start/end tag simultaneously
Adds editing of start/end tag simultaneously
Allows editing of start/end tag simultaneously
Allows editing of start/end tag simultaneously
Allows editing of start/end tag simultaneously
Allows editing of start/end tag simultaneously
6 remaining items
Allows editing of start/end tag simultaneously
Adds editing of start/end tag simultaneously
fbricon commentedon Dec 18, 2019
Feature doesn't work (see #211 )
octref commentedon Dec 20, 2019
I can't repro the problem in HTML though. Are you doing anything XML specific?
xorye commentedon Dec 20, 2019
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
in our
onDidChangeTextEditorSelection()function.bmix commentedon Mar 10, 2020
There is also some discussion going on here: VSCode: Improve mirror cursor implementation with Synced Regions #88424
angelozerr commentedon Mar 10, 2020
Thanks @bmix for this great information!
angelozerr commentedon Apr 22, 2020
@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)
angelozerr commentedon Jun 10, 2021
Fixed with LSP Lineked Editing, see https://github.com/redhat-developer/vscode-xml/blob/master/docs/Features/XMLFeatures.md#linked-editing