
|
If you were logged in you would be able to see more operations.
|
|
|
When injection spans multiple fragments, I want to access and/or edit the whole injected range, without all the noise from the containing language.
Consider a HQL query spanning multiple string literals:
- I cannot easily copy the query (although a simple intention action could provide this)
- More importantly, I cannot easily edit
Here's a first sketch:
- For multi-fragment injections, provide an an intention action, or a regular action (my preference, since it's one keystroke instead of at least two for an intention)
- Action or intention shows a simple dialog, containing multi-line EditorTextField hosting combined injected fragment and Cancel/Ok buttons
- Provide automatic escaping/unescaping (\n, \uxxxx etc for injection in Java literals, entities for injection in XML
- To preserve original outer+inner language text structure as much as possible:
- Add range markers indicating ranges that correspond to original framents of the injection
- When applying editing changes to original text, use the markers to place edited regions in original locations if possible
- When marker is invalid join the range with an adjacent range (or something like that
).
Quite often injected language fragments will not contain linefeeds:
- The result is that the edited injected language will be presented as one long line, making reading/editing harder
- For such situations, something like "smart linefeed conversion" could be done:
- Provide an option to take linefeeds from outer language and add them to the value in the EditorTextField (but not part of the range markers mentioned above, so they will disappear when "applying"
The "IntelliLang" plugin (by the great SW) provides a simple precursor to this (although it doesn't support multi-fragment injections or the formatting stuff mentioned).
These are just some first ideas, but I hope that the basic wish is clear:
- IDEA should make it as easy as possible to "access"/"edit" multi-fragment injected languages
- A secondary goal is to preserve formatting as much as possible
- A third goal is to assist with the specific scenario where line breaks are in outer language instead of inner one
Regular code editing actions (Ctrl-Q, completion, Ctrl-Shift-F7, formatting, etc) should be available ("navigate" does not make sense however).
For extra points: a right editor gutter containing error/"highlight usages" stripes.
|
|
Description
|
When injection spans multiple fragments, I want to access and/or edit the whole injected range, without all the noise from the containing language.
Consider a HQL query spanning multiple string literals:
- I cannot easily copy the query (although a simple intention action could provide this)
- More importantly, I cannot easily edit
Here's a first sketch:
- For multi-fragment injections, provide an an intention action, or a regular action (my preference, since it's one keystroke instead of at least two for an intention)
- Action or intention shows a simple dialog, containing multi-line EditorTextField hosting combined injected fragment and Cancel/Ok buttons
- Provide automatic escaping/unescaping (\n, \uxxxx etc for injection in Java literals, entities for injection in XML
- To preserve original outer+inner language text structure as much as possible:
- Add range markers indicating ranges that correspond to original framents of the injection
- When applying editing changes to original text, use the markers to place edited regions in original locations if possible
- When marker is invalid join the range with an adjacent range (or something like that
).
Quite often injected language fragments will not contain linefeeds:
- The result is that the edited injected language will be presented as one long line, making reading/editing harder
- For such situations, something like "smart linefeed conversion" could be done:
- Provide an option to take linefeeds from outer language and add them to the value in the EditorTextField (but not part of the range markers mentioned above, so they will disappear when "applying"
The "IntelliLang" plugin (by the great SW) provides a simple precursor to this (although it doesn't support multi-fragment injections or the formatting stuff mentioned).
These are just some first ideas, but I hope that the basic wish is clear:
- IDEA should make it as easy as possible to "access"/"edit" multi-fragment injected languages
- A secondary goal is to preserve formatting as much as possible
- A third goal is to assist with the specific scenario where line breaks are in outer language instead of inner one
Regular code editing actions (Ctrl-Q, completion, Ctrl-Shift-F7, formatting, etc) should be available ("navigate" does not make sense however).
For extra points: a right editor gutter containing error/"highlight usages" stripes. |
Show » |
| There are no comments yet on this issue.
|
|