Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[Scala] Tweak string and interpolation scopes

Open deathaxe opened this issue 1 year ago • 2 comments

This commit tweaks string and interpolation related scopes after the scheme of Python and ShellScript.

  1. from python use meta.string.interpolated and string.quoted.double.block

  2. from shell use interpolation scopes.

    Scope guidelines request punctuation.section.interpolation.[begin|end], but $ variables are historically scoped punctuation.definition.variable.

    This commit (as shellscript) attempt to satisfy both.

    Hence $ in ${} is scoped punctuation.definition.variable, which may appear odd in the first place.

    Actually $ is some sort of expansion operator, which adds a variable's or expression's result into containing string. Perl calls it dereferencing operator.

    Most core syntaxes supporting that kind of syntax struggle with it, currently.

    TL;TR This commit aligns scopes with existing core syntaxes even though there are still some caveats. Solving them is however a bigger task affecting various syntaxes. Good consistent alternatives are required first.

deathaxe avatar Jan 07 '25 18:01 deathaxe

Reverted triple-quoted scope to string.quoted.triple as it is also used in C# and Java.

deathaxe avatar Jan 07 '25 19:01 deathaxe

FYI, I will probably not have the time to review this in at least the next 2 weeks.

FichteFoll avatar Feb 20 '25 12:02 FichteFoll