Closed Bit0r closed 3 years ago
Good idea. I think adding support for these should be easy:
| command
&& command
if command
(command
etc.However I'm not too sure about excluding:
whatis \
apt
As I'm not sure the regex-based parsing used in tmlanguage files supports multi-line regex and lookbehinds. Still, I should give it a try. I like the idea of dropping highlighting for cat
, test
, etc. as they are often highlighted incorrectly.
Another option that could be a bigger project is to use fish_indent
to parse the file, then use that for syntax highlighting. This would be more accurate since I wouldn't have to reimplement the parser; I would just use the real parser and forward the results to VSCode. I've created https://github.com/bmalehorn/vscode-fish/issues/13 to track that.
@Bit0r I've now updated the syntax highlighting to only highlight functions like you described.
It doesn't have the backslash exclusion yet, but I'm pretty happy with the result!
very good!
I think the first field of all lines can be highlighted, because even if it is not a fish command, it can be an external command. For example, sudo, bat, dig, etc. Specifically, the first word of each line and the first word after
&&
|
||
can be highlighted. But if the end of the previous line is\
, then there is no need to highlight.