Skip to content

Allows editing of start/end tag simultaneously - #204

Closed
NikolasKomonen wants to merge 1 commit into
redhat-developer:masterfrom
NikolasKomonen:matchingTagClient
Closed

NikolasKomonen wants to merge 1 commit into
redhat-developer:masterfrom
NikolasKomonen:matchingTagClient

Conversation

@NikolasKomonen

Copy link
Copy Markdown
Collaborator

Under the preference xml.autoSelectingMatchingTags

Fixes #130

Signed-off-by: Nikolas Komonen [email protected]

Comment thread src/matchingTag.ts Outdated
@fbricon

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator 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

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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

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

@fbricon

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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

@fbricon

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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

@fbricon

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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

fbricon commented Dec 10, 2019

Copy link
Copy Markdown
Collaborator

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

@NikolasKomonen

Copy link
Copy Markdown
Collaborator Author

@fbricon

fbricon commented Dec 11, 2019

Copy link
Copy Markdown
Collaborator

No this doesn't work for me

@fbricon

fbricon commented Dec 11, 2019

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator 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

fbricon commented Dec 11, 2019

Copy link
Copy Markdown
Collaborator

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

Comment thread package.json Outdated
Comment thread src/mirrorCursor.ts Outdated
@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 <[email protected]>
@NikolasKomonen

Copy link
Copy Markdown
Collaborator 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

fbricon commented Dec 11, 2019

Copy link
Copy Markdown
Collaborator

please update the readme

@NikolasKomonen

Copy link
Copy Markdown
Collaborator Author

please update the readme

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

@fbricon

fbricon commented Dec 12, 2019

Copy link
Copy Markdown
Collaborator

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

Comment thread package.json
"description": "Enable/disable autoclosing of XML tags. \n\nIMPORTANT: Turn off editor.autoClosingTags for this to work",
"scope": "window"
},
"xml.matchingTagEditing": {

Copy link
Copy Markdown
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

xorye commented Dec 12, 2019

Copy link
Copy Markdown

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

fbricon commented Dec 13, 2019

Copy link
Copy Markdown
Collaborator

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