-
Notifications
You must be signed in to change notification settings - Fork 382
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
Questions about string literal highlighting and hover #1543
Comments
I would prefer:
where Hover:
where However since there is only one |
Interpolated strings are not meant to overlap with An additional reason that is not mentioned there is that if you escape your string literals with a custom the delimiters should definitely be colored, not sure which coloring is more natural between keyword or function, but the goal of coloring it is to make it more obvious what is and what isn't interpolated when using them with raw strings
|
|
Yeah that's a mistake, whoopsies |
Since there's not much discussion, here are my opinions:
Not until we have a proposal for a refined collection of decorations, and ideally a 2-tier hierarchy so that lean, small, clients can implement the bottom layer of the hierarchy without much work (like the current 5-constructor datatype), but the top layer can refine for the benefit of more sophisticated clients. (#1343 could be a good place to discuss it, or in a new proposal.)
That's a decent option, and I'm comfortable with it for the time being, once the current bug where interpolated string is erroneously included in the string.
Perhaps. I'm not sure how interpolated strings are desugared into
Based on
If two delimiters cause one "\{"Hello"}\{"there"}"
kkkdddddddfffdddddddkk The answers to these questions combine for all kinds of edge cases, so I say we should resolve all of them before starting to implement this. For example, in case we decide to support a 'StringLiteral' semantic category in the top tier of decorations, then we need to highlight the whole string as below in the lower tier, and in the higher tier to highlight the string's delimiters with that decoration, and the string text itself with the 'StringLiteral' decoration (marked as
|
I'm not quite sure how to implement that. I think I could make it the same color is the fromString but you are suggesting something more complex. I think I understand how to implement the rest. |
|
I don't understand @andrevidela 's answer. |
If I understand @andrevidela correctly, there is inherent ambiguity on where |
@ohad Are you saying |
I'm saying: if a "\{"Hello"}\{"there"}!"
lower tier: kkkdddddddfffdddddddfdd because I think this dedsugars into: original: "\{"Hello"}\{"there" }!"
desugar : "Hello" ++"there" ++ "!"
ddddddd ffddddddd ff ddd as you can see, some characters in the original string don't correspond to anything in the desugaring code. I proposed to highlight them as keywords. Another option is not to highlight them at all. |
I am going to make string literal highlights not overlap the highlights in betweenThis ended up being more complex that I anticipated and I might not get to it for some time.\{
and}
. Before I start I want to know if anyone wants other changes.Should string literals have their own color?
Should string literals stay as data?
Should they be highlighted based on
fromString
?Should
\{
and}
be highlighted differently? Based on++
? Keyword?Should
"
be highlighted as keyword?What should hovering over a string literals show?
The type of
fromString
?Should
\{
and}
show the type of++
?What should hovering over
"
show?The text was updated successfully, but these errors were encountered: