-
Notifications
You must be signed in to change notification settings - Fork 82
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
Mirror cursors #213
Mirror cursors #213
Conversation
@xorye IMHO (but not sure if it's possible?), I think we should keep the original mirrorCursor.ts from vscode and update it by adding comments (// updated for vscode-xml) because:
@fbricon what do you think about that? |
new version seems way safer |
Signed-off-by: David <[email protected]>
fixed |
The reason why it works for the HTML language server is that for their completion requests, the new text that is being inserted is only the tag name (ie, LSP4XML provides the brackets, start tag and end tag on completion, (ie |
As @xorye LSP4XML generate the start and end tag when completion is applied (like Eclipse WTP) although HTML Language server generates only the start tag. An idea of fix is to check if mirror cursor is activated and send this settings to the LSP4XML. In this case, the end tag should not be generated and we will have the same context than HTML language server. |
I think you can check whether the tag is closed or not, whether mirror cursors is enabled or not |
Ideally we should do that, but I don't know if it's possible to do that, need more investigation. |
See related microsoft/vscode#88424 |
Closing in favour of #304, since HTML doesn't use the old mirror cursors implementation that this PR was based on. |
Here is some work for #130
Everything that works for the html mirror tags, should work with this PR.
Toggle is available with ctrl+shift+f2.
How it works:
There is a listener that listens for changes in the
xml.mirrorCursorOnMatchingTag
config. This listener is active as long as vscode-xml is activated.If
xml.mirrorCursorOnMatchingTag
is turned on, a MirrorCursors object is created. This object creates more listeners.When
xml.mirrorCursorOnMatchingTag
is turned off, the MirrorCursors object (if exists) is disposed, along with the listeners it created.I must clean the code and play around with it more.
Please feel free to test things out as it is.