Closed charbelnicolas closed 2 years ago
Hmm. Interesting observation. I will look into this further. I think its doable while easily.
I think this has to do with your Neovim color scheme. Mine works perfectly well as you requested.
Hi Himu, yes, it works if you set TSKeyword to be the same color as TSConditional but then you also end up changing colors for something else.
I thought it would be cleaner to let tree-sitter know that {#if} is a conditional statement but I don't know if that is exactly possible.
Thank you either way, it was worth the shot.
Its fine bringing this issue up. The queries are the reason why this is happening.
:
is a character in the tree-sitter highlighting language. In your color scheme, the color for keyword (if
) and character is the same. Its the reason why the two pictures differ. Don't think its worth the extra effort.
@elianiva Can you chip in on this?
I think you can query for the #
, :
or /
characters inside the if
statement if the node is separated. i.e #
and if
are two different node, so then you can target them individually by creating a custom query. You'd need to use #match?
, kinda similar to this query:
I'm sorry but I think that's the only advice I can give you. I haven't used neovim as much as I did for a few months now, I don't even have TS playground installed to try it out myself.
Thanks @elianiva .
@charbelnicolas This separation of nodes is already there. Its just a matter of which node is represented with which theme in your config.
Thanks @elianiva .
@charbelnicolas This separation of nodes is already there. Its just a matter of which node is represented with which theme in your config.
Alright, thank you.
Hello Himu, I have a small suggestion, I hope it's not too difficult to implement. It would be nice if the
{#if}
block could get some highlighting like normal ifs similar to what we have in VS Code:instead of what we have now:
It definitely adds readability to the code when having the if with a highlight.
I hope you consider it, thank you.