-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
[rename on type] API for languages beyond HTML #94316
Comments
This comment has been minimized.
This comment has been minimized.
I would have been very interested in this API for the XML/XSLT editor extension I’m developing. However, I’m concerned about synced regions being ‘opt in’ and also requiring other user intervention (when the command is invoked), so for the time being at least, the extension will provide its own synced XML tag renaming. People writing XML/XSLT in other editors are used to synced tag renaming just working by default and with no intervention on their part. An API feature that would be useful for this would be if Note that start tag edits are synced with end tags, but not the other way round. This follows the convention of other XML editors and helps reduce CPU load (or parsing the XML backwards which I would not relish) |
Could you better clarify what stopPattern means? Does it mean the following: If the modified range doesn't contain stopPattern, all other ranges are modified to have the same value as it. |
This looks to have been finalized in #109923 |
Yes, correct. Closing as dup of #109923 |
Can you please explain how to add more supported languages to this setting? The setting recently changed from "editor.renameOnType" to "editor.linkedEditing" and I looked for both with no success. I tried several parameters with "languages.registerLinkedEditingRangeProvider" from this comment but none worked and I can't seem to find the correct syntax (I have version 1.52.1 as suggested but in the settings.json I see "Unknown Configuration Setting") |
Yes, you have to write an extension that registers a new LinkedEditingRangeProvider for a given language selector. That's done with the API If the user settings |
Continuing #88424, which implements the Synced Region feature for HTML.
We could offer an API and I can try doing it for JSX (#85707).
I tried running this feature in real programming languages such as TypeScript, but automatic mode creates a lot of confusion. For example:
In automatic mode, when I'm deleting
b
and enteringc
to change froma.b
toa.c
,b: 1
would also be changed. This is undesirable.Nevertheless, having Cmd+Shift+F2 to live-rename in a for-loop etc would be very helpful.
This issue tracks the API proposal below:
The text was updated successfully, but these errors were encountered: