jlelong / vscode-latex-basics

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

environments cause erroneous syntax highlighting in dtx file #85

Closed SwitWu closed 5 months ago

SwitWu commented 6 months ago

A clear and concise description of what the bug is.

After testing in a lot of cases, I found that the first environment (whatever it is, defined or undefined) in dtx file will cause all lines after it to be highlighted erroneously.

A minimal example to reproduce the issue

test this file

% \iffalse
%<*driver>
\documentclass{whudoc}
\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{title}
% \author{author}
% \date{\today}
% \maketitle
% \tableofcontents
% \begin{tikzpicture}
%   some code
% \end{tikzpicture}
% some code
% \TeX \LaTeX abcd
image

Replace the tikzpicture with anything else and see the result. It is the same.

jlelong commented 6 months ago

This is related to the use of $self instead of $base in the LaTeX grammar. See #83 I have to think of it in depth but the only solution is probably to duplicate the LaTeX grammar inside the doctex one.

SwitWu commented 5 months ago

Thanks. When will the new .vsix package be generated?

jlelong commented 5 months ago

You can try https://github.com/James-Yu/LaTeX-Workshop/actions/runs/8937707565/artifacts/1470267334