Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect syntax highlight for .dtx files concerning \iffalse #4231

Closed
4 tasks done
NemoYuan2008 opened this issue Apr 13, 2024 · 3 comments
Closed
4 tasks done

Incorrect syntax highlight for .dtx files concerning \iffalse #4231

NemoYuan2008 opened this issue Apr 13, 2024 · 3 comments
Assignees
Labels
bug Issue identified by LW maintainers as bug grammar Issue related to the language grammar

Comments

@NemoYuan2008
Copy link

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • The issue has not been reported in this repository.
  • The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • The FAQ cannot address the issue.
  • The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: Windows 11
  • Visual Studio Code Version: 1.88.1
  • LaTeX Workshop Version: 9.19.2
  • TeX Distribution Version: TeX Live 2024

The Issue*

The syntax highlight is incorrect for the following simple .dtx file, the \fi on line 5 is not matched with \iffalse on line 1.
image

% \iffalse meta-comment
%
% Some comments and Copyright info
%
% \fi
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{mypkg}
%
%<*driver>
\documentclass{ltxdoc}
\begin{document}
\DocInput{⟨package⟩.dtx}
\end{document}
%</driver>
% \fi
%
% \title{Some Title}
% \author{name}
%
% \maketitle
%
% \begin{abstract}
% Some text here.
% \end{abstract}
%
% \section{Introduction}
% Some text here.
%
%    \begin{macrocode}
\newcommand{\YOURMACRO}{}
%    \end{macrocode}

Logs

LaTeX Workshop Output*

[22:17:12.792][Logger] New log placeholder %WS1% registered for d:\Study\restatablethm .
[22:17:12.792][Extension] Initializing LaTeX Workshop.
[22:17:12.934][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[22:17:12.995][Server] Creating LaTeX Workshop http and websocket server.
[22:17:13.066][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[22:17:13.116][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":55722} .
[22:17:13.128][Extension] Extension root: c:\Users\yuan\.vscode\extensions\james-yu.latex-workshop-9.19.2
[22:17:13.128][Extension] $PATH: D:\Program Files (x86)\VMware\VMware Player\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;d:\Program Files\Git\cmd;D:\Apps\conda;D:\Apps\conda\Library\mingw-w64\bin;D:\Apps\conda\Library\usr\bin;D:\Apps\conda\Library\bin;D:\Apps\conda\Scripts;C:\Users\yuan\AppData\Local\Microsoft\WindowsApps;D:\Program Files\Microsoft VS Code\bin;C:\Users\yuan\AppData\Local\JetBrains\Toolbox\scripts;D:\Program Files\texlive\2024\bin\windows
[22:17:13.129][Extension] $SHELL: undefined
[22:17:13.129][Extension] $LANG: undefined
[22:17:13.129][Extension] $LC_ALL: undefined
[22:17:13.129][Extension] process.platform: win32
[22:17:13.129][Extension] process.arch: x64
[22:17:13.129][Extension] vscode.env.appName: Visual Studio Code
[22:17:13.129][Extension] vscode.env.remoteName: undefined
[22:17:13.129][Extension] vscode.env.uiKind: 1
[22:17:13.132][Config] latex-workshop.latex.recipe.default: "lastUsed" .
[22:17:13.170][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[22:17:13.171][Root] Current workspace folders: ["file:///d:/Study/restatablethm"]
[22:17:13.171][Extension] LaTeX Workshop initialized.
[22:17:13.172][Root] Found root file from active editor: %WS1%\test.dtx
[22:17:13.172][Root] Root file changed: from %WS1%\test.dtx to %WS1%\test.dtx, langID doctex . Refresh dependencies
[22:17:13.172][Event] ROOT_FILE_CHANGED: "d:\\Study\\restatablethm\\test.dtx"
[22:17:13.173][Cacher][Watcher] Reset.
[22:17:13.173][Cacher][Watcher] Reset.
[22:17:13.175][Cacher] Adding %WS1%\test.dtx .
[22:17:13.175][Cacher][Watcher] Watched %WS1%\test.dtx with a new .* watcher on %WS1% .
[22:17:13.175][Event] FILE_WATCHED: "d:\\Study\\restatablethm\\test.dtx"
[22:17:13.177][Event] ROOT_FILE_SEARCHED
[22:17:13.188][Server] valdOrigin is http://127.0.0.1:55722
@jlelong jlelong self-assigned this Apr 16, 2024
@suzizecat
Copy link

suzizecat commented Apr 18, 2024

Hi ! To add on this issue, I encountered the same problem on a .sty file when using the following syntaxes (which are technically the same):

% Simple let
\let\iftoto\iffalse

% Let with indirection
\def\@varname{iftoto}
\expandafter\let\csname\@varname\endcsname\iffalse\relax

I am using:

  • Operating System: Ubuntu 22.04 through Windows 11 (WSL 2.0)
  • Visual Studio Code Version: 1.88.1
  • LaTeX Workshop Version: 9.20.0
  • TeX Distribution Version: TeX Live 2022

@Cube707
Copy link

Cube707 commented Apr 18, 2024

just encountered this myself. this seems to be a regression in v9.19.2

v9.19.1 v9.19.2

@jlelong
Copy link
Collaborator

jlelong commented Apr 18, 2024

This is related to jlelong/vscode-latex-basics#78. I will look at it shortly.

@jlelong jlelong added bug Issue identified by LW maintainers as bug grammar Issue related to the language grammar labels Apr 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by LW maintainers as bug grammar Issue related to the language grammar
Projects
None yet
Development

No branches or pull requests

4 participants