Closed Bit0r closed 4 years ago
Technically, the fish extension highlights does recognize --description
as different than plains strings. The extension labels options as string.other.option.fish
. But the default VSCode Dark+ theme does not have a special case for string.other.option.fish
and highlights it as just a string
.
https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#scope-inspector
So it's not highlighted correctly because the default VSCode theme does not have a color for command-line option.
I could work around this by instead inaccurately labeling the string as string.regexp
. This would get a distinct color, but might mislead users into thinking it was a regexp:
A third option is to do no special highlighting:
@Bit0r What do you think would make the most sense?
Is there any difference between the second picture and the third picture, is the wrong picture uploaded?
But I think it can be highlighted as a label
or macro
?
Latest fish also supports logical operators such as &&
||
!
, hope to add highlighting support :)
There are also two special symbols &
|
, which can be highlighted as bit operators (although they are not bit operations, they can be done)
Is there any difference between the second picture and the third picture, is the wrong picture uploaded? Ah yup, I uploaded the wrong picture. I've now uploaded the correct picture.
Latest fish also supports logical operators such as
&&
||
!
, hope to add highlighting support :) There are also two special symbols&
|
, which can be highlighted as bit operators (although they are not bit operations, they can be done)
Ah, fish does correctly label &&
, ||
, !
, &
and |
! But the default Dark+ theme highlights them as plain white text. It does the same thing in JavaScript code - &&
is highlighted as plain white text. However some themes do highlight it:
Dark+ (default dark) | Monokai |
---|---|
So it's not a problem of vscode-fish not labeling the text correctly, but rather that the Dark+ theme does not highlight every scope with a different color. I'd recommend trying out different themes to see if you can find one that highlights what you want.
But I think it can be highlighted as a
label
ormacro
?
It looks like labels aren't highlighted any differently, but macros are:
Still, I'm kind of leaning towards removing the syntax highlighting entirely on --option
flags. They don't mean anything special in fish, --option
is no different than option
, it just has a conventional meeting. So the most accurate thing might be to not highlight it at all. Thoughts?
I think this is a good idea
--description
is highlighted as a string, not a parameter