Skip to content
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

Allows editing of start/end tag simultaneously #204

Conversation

NikolasKomonen
Copy link
Contributor

Under the preference xml.autoSelectingMatchingTags

Fixes #130

Signed-off-by: Nikolas Komonen nikolaskomonen@gmail.com

src/matchingTag.ts Outdated Show resolved Hide resolved
@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

Can't get it to work. Output filled with errors like:

rejected promise not handled within 1 second: Error: Unsupported request method: xml/matchingTagPosition
extensionHostProcess.js:820
stack trace: Error: Unsupported request method: xml/matchingTagPosition
	at handleResponse (/Users/fbricon/Dev/projects/vscode-xml/dist/extension.js:6179:48)
	at processMessageQueue (/Users/fbricon/Dev/projects/vscode-xml/dist/extension.js:6006:17)
	at Immediate.<anonymous> (/Users/fbricon/Dev/projects/vscode-xml/dist/extension.js:5990:13)
	at processImmediate (internal/timers.js:439:21)

@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

When typing a space at the end of a tag, to add an attribute for instance, there's often an error logged because of cancelled request. Logs fill up pretty quickly so this should be handled more gracefully:
Dec-10-2019 16-16-23

@NikolasKomonen
Copy link
Contributor Author

When typing a space at the end of a tag, to add an attribute for instance, there's often an error logged because of cancelled request. Logs fill up pretty quickly so this should be handled more gracefully:

@fbricon I can't recreate this, but maybe it is using the bugged version of the code. I pushed the new one here, just pull the client again and hopefully this disappears.

@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

Works beautifully now, can't reproduce the issue from earlier.

That's a great feature, nice job @NikolasKomonen!

@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

Spoke too soon, I can still reproduce. add space at the end of a tag, delete, rinse, repeat until the exception shows up

@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

definitely reminds me of #149. We prolly need to make the server side more robust wrt cancelled commands

@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

I think the key here is "rejected promise not handled within 1 second". Server is too slow to respond, then client cancels the request.

@fbricon
Copy link
Collaborator

fbricon commented Dec 10, 2019

See https://stackoverflow.com/a/50124430/753170 for a potential solution

@NikolasKomonen
Copy link
Contributor Author

@fbricon
Copy link
Collaborator

fbricon commented Dec 11, 2019

No this doesn't work for me

@fbricon
Copy link
Collaborator

fbricon commented Dec 11, 2019

Now that've been playing with it, I think we need a new command to toggle the preference, so that, when bound to a keystroke, you can enter/exit quick tag edit mode

Also, the readme needs to be updated with the preference key (and documenting that new toggle command would help too)

@NikolasKomonen
Copy link
Contributor Author

I think we need a new command to toggle the preference

Right now you can press Esc to stop the edit mode. Is that good enough?

Also, I have the README updated here in the PR here: https://github.com/redhat-developer/vscode-xml/pull/206/files#diff-04c6e90faac2675aa89e2176d2eec7d8R82

@fbricon
Copy link
Collaborator

fbricon commented Dec 11, 2019

Ctrl+Shift+F2 on linux/windows, Cmd+Shift+F2 on mac, to toggle matching tag editing

package.json Outdated Show resolved Hide resolved
src/mirrorCursor.ts Outdated Show resolved Hide resolved
@NikolasKomonen NikolasKomonen force-pushed the matchingTagClient branch 2 times, most recently from 16e72e6 to 25e4b93 Compare December 11, 2019 17:45
Under the preference xml.autoSelectingMatchingTags

Fixes redhat-developer#130

Signed-off-by: Nikolas Komonen <nikolaskomonen@gmail.com>
@NikolasKomonen
Copy link
Contributor Author

@fbricon updated everything. The console error should be gone, cmd+shift+f2 should toggle the preference on your machine and a message should appear.

@fbricon
Copy link
Collaborator

fbricon commented Dec 11, 2019

please update the readme

@NikolasKomonen
Copy link
Contributor Author

please update the readme

@fbricon the readme is updated in this PR: #206

@fbricon
Copy link
Collaborator

fbricon commented Dec 12, 2019

on configuration change, toggling the new pref should add/remove the mirror cursor immediately

@@ -192,6 +192,12 @@
"description": "Enable/disable autoclosing of XML tags. \n\nIMPORTANT: Turn off editor.autoClosingTags for this to work",
"scope": "window"
},
"xml.matchingTagEditing": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about using the same name than vscode mirrorCursorOnMatchingTag ?

@xorye
Copy link

xorye commented Dec 12, 2019

on configuration change, toggling the new pref should add/remove the mirror cursor immediately

I implemented that here: https://github.com/xorye/vscode-xml/tree/matchingTagClient

@fbricon
Copy link
Collaborator

fbricon commented Dec 13, 2019

superseded by #207

@fbricon fbricon closed this Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto Rename Tag
4 participants