GNOME Bugzilla – Bug 749221
Improve sh variable substitution highlighting
Last modified: 2021-07-05 11:02:09 UTC
${x}y and $0x are highlighted as whole substitutions, while only ${x} and $0 should be highlighted. I've tried to extend syntax with posix specification for handling braces and one-char variables.
Created attachment 303207 [details] [review] Proposed patch
Review of attachment 303207 [details] [review]: It would be better to give more meaningful names to the two variable contexts, instead of 'variable1' and 'variable2'. Can you provide examples to tests/syntax-highlighting/ ? ::: data/language-specs/sh.lang @@ +193,3 @@ + <!-- <context ref="arithmetic-expansion"/> --> + <!-- <context ref="command-substitution"/> --> + <!-- <context ref="variable-expansion"/> --> If those commented contexts must not be included, it's better to remove them altogether. Or add a comment to explain why they are not included.
These contexts should be included, but are not implemented yet.
Ah ok, so it was a work-in-progress. For the first patch it's better to not include them (even if they are commented). And then for a later patch you can add them (or having everything in the same patch, as you like).
Created attachment 303349 [details] [review] Proposed patch, better context names, tests
Review of attachment 303349 [details] [review]: Looks good.
Comment on attachment 303349 [details] [review] Proposed patch, better context names, tests Pushed to the master branch: https://git.gnome.org/browse/gtksourceview/commit/?id=835df2b3774c478847a7e06032ebc5caf4dfc7cb (added the bug URL at the end of the commit)
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/ Thank you for your understanding and your help.