You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is related to a problem with the first command in shellsession not being highlighted correctly (shikijs/shiki#616)
I reported the above issue upstream (jeff-hykin/better-shell-syntax#79) and found that fixing this issue requires action in this repository, so here I am.
First, from a maintenance standpoint, I was told that it would be difficult to update the shellscript grammar to fix the issue. Also, the original shellsession grammar assumes that the grammar file in linguist is used to parse shellscript, not better-shell-syntax used in VS Code. If linguist is used to parse shellscript, shellsession will work correctly.
Therefore, there are two ways to fix this issue.
use linguist instead of better-shell-syntax as the shellscript grammar
fork the better-shell-syntax and shellscript grammars and modify each
I have confirmed that both options will fix the issue. The easiest to work with is option 1, but the possibility of breaking compatibility with other grammars cannot be ruled out. I would like to hear your opinion on this matter.
PS: It seems that only a very few commands are highlighted when linguist is used. Therefore, option 2 may be better if you do not consider the hassle.
The text was updated successfully, but these errors were encountered:
Thanks for your effort in investigating and reporting. Unfortunately, neither of the options seems considerable to me. I think it's easier for Shiki to align with VS Code as much as possible (so we could count on the VS Code team to make sure the grammars are up to date and well maintained).
It would be hard to take immediate action about grammar on our side, as Shiki is about the highlighter, and we can't take care of all grammar for different languages.
I suggest you forget about the grammars Shiki has builtin for a moment. Instead you could provide your own grammars as documented https://shiki.style/guide/load-lang, to use another grammar one or fork your own - until VS Code fixes it and get synced down to Shiki.
Thank you for your kind response. I will use custom grammar.
For others who are interested in this issue: I created a project that automatically patches the VS Code grammar to generate a custom grammar for shellsession. If you need it, you can use it from here: https://github.com/Robot-Inventor/shell-session-syntax/
This issue is related to a problem with the first command in
shellsession
not being highlighted correctly (shikijs/shiki#616)I reported the above issue upstream (jeff-hykin/better-shell-syntax#79) and found that fixing this issue requires action in this repository, so here I am.
First, from a maintenance standpoint, I was told that it would be difficult to update the
shellscript
grammar to fix the issue. Also, the originalshellsession
grammar assumes that the grammar file in linguist is used to parseshellscript
, notbetter-shell-syntax
used in VS Code. If linguist is used to parseshellscript
,shellsession
will work correctly.Therefore, there are two ways to fix this issue.
better-shell-syntax
as theshellscript
grammarbetter-shell-syntax
andshellscript
grammars and modify eachI have confirmed that both options will fix the issue. The easiest to work with is option 1, but the possibility of breaking compatibility with other grammars cannot be ruled out. I would like to hear your opinion on this matter.
PS: It seems that only a very few commands are highlighted when linguist is used. Therefore, option 2 may be better if you do not consider the hassle.
The text was updated successfully, but these errors were encountered: