jlelong / vscode-latex-basics

LaTeX grammars for Visual Studio Code
MIT License
19 stars 10 forks source link

Julia environments are not correctly highlighted unless using empty options `[]` #41

Closed JamieMair closed 1 year ago

JamieMair commented 1 year ago

Syntax highlighting for Julia environments do not work. I thought this was fixed in https://github.com/jlelong/vscode-latex-basics/pull/15 but it does not seem to work now. Syntax highlighting in https://github.com/jlelong/vscode-latex-basics/commit/de12bcd961c686e147190f15a951b4336f0128e4 is working correctly, but is broken in the latest release.

The code:

\begin{juliaconsole}
a = rand(1024)
@btime sum($a)
\end{juliaconsole}
Some additional text here.

Used to have correct highlighting. Note the $ character does not cause highlighting to spill over past the end of the environment. As shown in the screenshot: image

Now, the highlighting fix has reverted with the screenshot on the current version of master: image

JamieMair commented 1 year ago

I used git bisect to find the commit that introduced this bug -https://github.com/jlelong/vscode-latex-basics/commit/a741034f0d88fa0d24790ca5531a041024a12f0f. I will investigate a bit further.

JamieMair commented 1 year ago

The problem seems to be that you currently must have [] after the environment, even with no arguments for this to parse correctly. The following has correct parsing: image I have tried to make the [] optional, but I haven't been able to get it work. I am sure this will probably be a quick fix.