James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.47k stars 519 forks source link

chktex can not be disabled (TeXLive2024) #4206

Closed kellertuer closed 4 months ago

kellertuer commented 4 months ago

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.

  • [x] The issue has not been reported in this repository.
  • [x] The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • [x] The FAQ cannot address the issue.
  • [x] 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. (it actually just compiles fine and I get a PDF, chktex is just going frenzy)

Environment*

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

  • Operating System: MacOS 14.2.1
  • Visual Studio Code Version: 1.87.2
  • LaTeX Workshop Version: 9.19.1
  • TeX Distribution Version: TeXLive2024

The Issue*

I updated my TeXLive to 2024 today and since then on every save chktex errors with

chktex: WARNING -- Compilation of regular expression \[(?![^\]\[{}]*{(?![^\]\[{}]*}))[^\]]*\[ failed with error repetition-operator operand invalid.

which I am not sure where it is from, but I thought I would just deactivate it for a while. So I Unchecked

But the error still appears on every save.

Reproduction Steps

  1. Update to TeXLIve 2024
  2. open a LaTeX file in VS COde
  3. click save

Expected Behavior

chktex would not run if not enabled

Logs

LaTeX Workshop Output*

Please paste the whole log messages below, not parts of ones. The log should start with New log placeholder %WS1% registered.

[16:23:30.875][Logger] New log placeholder %WS1% registered for /Users/ronnber/Repositories/Papers/202301-bergmann-herzog-jasa-riemannian-bundle-method .
[16:23:30.875][Extension] Initializing LaTeX Workshop.
[16:23:30.993][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[16:23:31.018][Server] Creating LaTeX Workshop http and websocket server.
[16:23:31.140][Format][Bib] Bibtex format config: {"tab":"    ","case":"UPPERCASE","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[16:23:31.177][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":52267} .
[16:23:31.196][Extension] Extension root: /Users/ronnber/.vscode/extensions/james-yu.latex-workshop-9.19.1
[16:23:31.196][Extension] $PATH: /opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Library/TeX/texbin:/Applications/quarto/bin:/Users/ronnber/.local/bin:/Users/ronnber/bin:/opt/homebrew/opt/fzf/bin
[16:23:31.196][Extension] $SHELL: /bin/zsh
[16:23:31.197][Extension] $LANG: undefined
[16:23:31.197][Extension] $LC_ALL: undefined
[16:23:31.197][Extension] process.platform: darwin
[16:23:31.197][Extension] process.arch: arm64
[16:23:31.197][Extension] vscode.env.appName: Visual Studio Code
[16:23:31.197][Extension] vscode.env.remoteName: undefined
[16:23:31.198][Extension] vscode.env.uiKind: 1
[16:23:31.301][Config] latex-workshop.latex.recipes: [{"name":"latexmk 🔃","tools":["latexmk"]},{"name":"pdflatex ➞ biber ➞ pdflatex`×2","tools":["pdflatex","biber","pdflatex","pdflatex"]},{"name":"xelatex ➞ biber ➞ xelatex`×2","tools":["xelatex","biber","xelatex","xelatex"]},{"name":"xelatex`×2","tools":["xelatex","xelatex"]}] .
[16:23:31.302][Config] latex-workshop.latex.recipe.default: "lastUsed" .
[16:23:31.303][Config] latex-workshop.latex.tools: [{"name":"latexmk","command":"latexmk","args":["-synctex=1","-interaction=nonstopmode","-file-line-error","--shell-escape","-pdf","%DOC%"],"env":{}},{"name":"pdflatex","command":"pdflatex","args":["-synctex=1","-interaction=nonstopmode","-file-line-error","--shell-escape","--output-directory=%OUTDIR%","%DOC%"],"env":{}},{"name":"xelatex","command":"xelatex","args":["-synctex=1","-interaction=nonstopmode","--shell-escape","-file-line-error","--output-directory=%OUTDIR%","%DOC%"]},{"name":"biber","command":"biber","args":["%DOCFILE%"]}] .
[16:23:31.305][Config] latex-workshop.latex.magic.args: ["-synctex=1","-interaction=nonstopmode","-file-line-error","-shell-escape","%DOC%"] .
[16:23:31.307][Config] latex-workshop.latex.build.forceRecipeUsage: false .
[16:23:31.324][Config] latex-workshop.latex.autoBuild.run: "onSave" .
[16:23:31.325][Config] latex-workshop.latex.autoBuild.interval: 420000 .
[16:23:31.335][Config] latex-workshop.view.pdf.internal.synctex.keybinding: "double-click" .
[16:23:31.336][Config] latex-workshop.view.pdf.external.viewer.command: "/Applications/Skim.app/Contents/SharedSupport/displayline" .
[16:23:31.337][Config] latex-workshop.view.pdf.external.viewer.args: ["0","%PDF%"] .
[16:23:31.337][Config] latex-workshop.view.pdf.external.synctex.command: "/Applications/Skim.app/Contents/SharedSupport/displayline" .
[16:23:31.337][Config] latex-workshop.view.pdf.external.synctex.args: ["-r","-b","%LINE%","%PDF%","%TEX%"] .
[16:23:31.349][Config] latex-workshop.synctex.afterBuild.enabled: true .
[16:23:31.350][Config] latex-workshop.linting.chktex.convertOutput.column.enabled: false .
[16:23:31.467][Config] latex-workshop.intellisense.file.exclude: ["**/*.aux","**/*.bbl","**/*.bcf","**/*.blg","**/*.idx","**/*.ind","**/*.lof","**/*.lot","**/*.out","**/*.toc","**/*.acn","**/*.acr","**/*.alg","**/*.glg","**/*.glo","**/*.gls","**/*.ist","**/*.fls","**/*.log","**/*.nav","**/*.snm","**/*.fdb_latexmk","**/*.synctex.gz","**/*.run.xml","**/*.out.ps"] .
[16:23:31.482][Config] latex-workshop.message.error.show: false .
[16:23:31.497][Config] latex-workshop.bibtex-format.tab: "4 spaces" .
[16:23:31.497][Config] latex-workshop.bibtex-format.case: "UPPERCASE" .
[...]
[16:24:13.788][Event] FILE_CHANGED: "%WS1%/main.tex"
[16:24:14.031][Build] Finished a step in recipe with PID 42380.
[16:24:14.031][Build] Successfully built %WS1%/manuscript-mathprog.tex .
[16:24:14.031][Event] BUILD_DONE
[16:24:14.406][Cacher] Parsed LaTeX AST: %WS1%/main.tex .
[16:24:14.467][Cacher] Updated elements in 59.89 ms: %WS1%/main.tex .
[16:24:14.467][Event] FILE_PARSED: "%WS1%/main.tex"
[16:24:14.472][Structure] Structure force updated with 7 root sections for %WS1%/manuscript-mathprog.tex .
[16:24:14.472][Event] STRUCTURE_UPDATED

Developer Tools Console

Please paste the whole log messages below, not parts of ones. This console logs can sometimes be very important in many cases. To access the log, click Help -> Toggle Developer Tools -> Console.

INFO Started local extension host with pid 40959.
2notificationsAlerts.ts:42 chktex: WARNING -- Compilation of regular expression \[(?![^\]\[{}]*{(?![^\]\[{}]*}))[^\]]*\[ failed with error repetition-operator operand invalid.
c @ notificationsAlerts.ts:42
jlelong commented 4 months ago

I have made a test and I confirm that when latex-workshop.linting.chktex.enabled is unchecked, chktex is not called. When chktex is called, you should find in your logs something like

[17:14:02.555][Linter] ChkTeX lints root %WS1%/empty.tex .
[17:14:02.556][Linter][ChkTeX] Linter for ChkTeX command The command is chktex:["-wall","-e16","-n1","-n6","-n12","-n19","-n21","-n22","-n24","-n25","-n30","-n37","-n44","-n46","-q","-n45","-n36","-n2","-n3","-l","%WS1%/.chktexrc","-f%f:%l:%c:%d:%k:%n:%m\n","%WS1%/empty.tex"].

I am pretty sure the warning comes from your configuration of chktex. Do you have a .chktexrc file somewhere?

kellertuer commented 4 months ago

Hm. No nothing. and It also only started showing up (but something like every other second!) since the update. I never set up anything besides enabling it in the extension. so there is not .chktexrcfile or such.

jlelong commented 4 months ago

I have just installed TexLive 2024 and I confirm that the default chktex configuration has an issue. See https://savannah.nongnu.org/bugs/index.php?65033 No new version has been released so far. The latest release seems to go back to 2022.

Yet, unchecking latex-workshop.linting.chktex.enabled does disable chktex.

kellertuer commented 4 months ago

Thanks for the follow up. For me it did not disable the call it seems, I really tried several times. But I can check back; my impression was that the chutex was still called, maybe not for this one document open but for some other reasons and still caused the error.

kellertuer commented 4 months ago

Ah, I just saw I also have the LaTeX extension running (disabled that, not sure why I had that) – that still called chktex. So deactivating works and the error is gone, but it would of course be nice to have linting back at some time ;)

jlelong commented 4 months ago

Even with the current warning message of chktex about the invalid regex, LaTeX-Workshop is able to parse its output and displays the correct linting messagesat least on my configuration. Can you try again now that you have disabled the LaTeX extension ?

kellertuer commented 4 months ago

Ah nice, indeed, that works again. Now it would just be nice to exclude a few (46 – use ( ) instead if $ $ for example). But that is maybe something for an own configfile. Will check

jlelong commented 4 months ago

See https://github.com/James-Yu/LaTeX-Workshop/wiki/Linters#chktex To tweak the warnings displayed by chktex https://github.com/James-Yu/LaTeX-Workshop/wiki/Linters#latex-workshoplintingchktexexecargs

kellertuer commented 4 months ago

Nice, thanks, will do :)