James-Yu / LaTeX-Workshop

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

No Intellisense within unstarred commands of derivative package (only) when importing generated JSON with Intellisense commands #4319

Closed kevinbbbb closed 1 month ago

kevinbbbb commented 1 month 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.

Environment*

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

  • Operating System: Ubuntu 22.04 LTS
  • Visual Studio Code Version: 1.91.1
  • LaTeX Workshop Version: 10.1.0
  • TeX Distribution Version: TexLive 2024

The Issue*

Please briefly describe the issue you come across.

  • within some commands of the derivative package (e.g. \pdv{}{} or \odif{}), Intellisense is not working when a generated .JSON-file (for Intellisense) for the derivative package is imported
  • the affected commands seem to be the unstarred commands, i.e., not commands like \pdv*{}{} or \odif*{}
  • it doesn't make a difference, wether I am still within the scope of the derivative-command-macro (here: \pdv{}{}), i.e., when I can switch between input fields with Tab grafik
  • or wether I wrote \pdv{}{} myself, move the cursor and try to execute commands grafik
  • when not importing a .JSON file, Intellisense within derivative-commands works as expected grafik

Reproduction Steps

Please list out the steps to reproduce your bug. Include relevant environmental variables or any other configuration.

  1. Generate a .JSON-file from the .cwl for the derivative package (see my previous issue https://github.com/James-Yu/LaTeX-Workshop/issues/4258)
  2. Write any command from the derivative package (with help of intellisense or without) and try to type other commands within that command

Expected Behavior

What were you expecting to see? Include any relevant examples or documentation links.

  • Intellisense should be working within other commands (nested commands)
  • It works for the starred commands of the derivative package (but not for the unstarred) grafik
  • It works for other packages, where the .JSON come with the extension grafik
  • It also works for (at least one) other package, where I generated the .JSON myself from the .cwlfile (I am using the minutes package). (So it can't be a general problem with generated .JSON-files; although I haven't tested other packages.) grafik

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.

[19:20:19.950][Logger] New log placeholder %WS1% registered for /home/kevin/Dokumente/Studium/Master_Physik/KEP - Kern- und Energiephysik (SS 24)/Latex_KEP .
[19:20:19.950][Extension] Initializing LaTeX Workshop.
[19:20:20.080][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[19:20:20.080][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_PATH: "docker"
[19:20:20.132][Server] Creating LaTeX Workshop http and websocket server.
[19:20:20.250][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[19:20:20.317][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":44447} .
[19:20:20.336][Extension] Extension root: /home/kevin/.vscode/extensions/james-yu.latex-workshop-10.1.0
[19:20:20.337][Extension] $PATH: /usr/local/texlive/2024/bin/x86_64-linux:/home/kevin/.local/bin:/usr/local/texlive/2024/bin/x86_64-linux:/usr/local/texlive/2024/bin/x86_64-linux:/home/kevin/.juliaup/bin:/home/kevin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[19:20:20.337][Extension] $SHELL: /bin/bash
[19:20:20.338][Extension] $LANG: de_DE.UTF-8
[19:20:20.338][Extension] $LC_ALL: undefined
[19:20:20.338][Extension] process.platform: linux
[19:20:20.339][Extension] process.arch: x64
[19:20:20.340][Extension] vscode.env.appName: Visual Studio Code
[19:20:20.341][Extension] vscode.env.remoteName: undefined
[19:20:20.342][Extension] vscode.env.uiKind: 1
[19:20:20.346][Config] latex-workshop.latex.recipes: [{"name":"pdflatexX2","tools":["pdflatex","pdflatex"]},{"name":"pdflatex ➞ biber ➞ pdflatexX2","tools":["pdflatex","biber","pdflatex","pdflatex"]}] .
[19:20:20.347][Config] latex-workshop.latex.tools: [{"name":"pdflatex","command":"pdflatex","args":["-synctex=1","-interaction=nonstopmode","-file-line-error","%DOC%"],"env":{}},{"name":"biber","command":"biber","args":["%DOCFILE%"],"env":{}}] .
[19:20:20.361][Config] latex-workshop.latex.autoBuild.run: "never" .
[19:20:20.403][Config] latex-workshop.view.pdf.zoom: "page-width" .
[19:20:20.411][Config] latex-workshop.view.pdf.trim: 17 .
[19:20:20.464][Config] latex-workshop.intellisense.package.dirs: ["","/home/kevin/Latex_Workshop_Intellisense/JSON_Intellsense/"] .
[19:20:20.467][Config] latex-workshop.intellisense.optionalArgsEntries.enabled: false .
[19:20:20.479][Config] latex-workshop.bibtex-format.sort.enabled: true .
[19:20:20.487][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{","}"]
[19:20:20.491][Root] Current workspace folders: ["file://%WS1%"]
[19:20:20.494][Root] Found magic root %WS1%/main.tex
[19:20:20.495][Extension] LaTeX Workshop initialized.
[19:20:20.698][Server] valdOrigin is http://127.0.0.1:44447
[19:20:20.916][Root] Finalized magic root %WS1%/main.tex .
[19:20:20.917][Root] Root file changed: from %WS1%/main.tex to %WS1%/main.tex, langID latex . Refresh dependencies
[19:20:20.917][Event] ROOT_FILE_CHANGED: "%WS1%/main.tex"
[19:20:20.917][Cacher][Watcher] Reset.
[19:20:20.917][Cacher][Watcher] Reset.
[19:20:20.922][Cacher] Adding %WS1%/main.tex .
[19:20:20.923][Cacher][Watcher] Watched %WS1%/main.tex with a new .* watcher on %WS1% .
[19:20:20.923][Event] FILE_WATCHED: "%WS1%/main.tex"
[19:20:20.925][Cacher] Caching %WS1%/main.tex .
[19:20:20.926][Event] ROOT_FILE_SEARCHED
[19:20:20.980][Cacher] Input %WS1%/config.tex from %WS1%/main.tex .
[19:20:20.981][Cacher] Adding %WS1%/config.tex .
[19:20:20.982][Cacher][Watcher] Watched %WS1%/config.tex by the .* watcher.
[19:20:20.982][Event] FILE_WATCHED: "%WS1%/config.tex"
[19:20:20.983][Cacher] Caching %WS1%/config.tex .
[19:20:21.049][Cacher] Input %WS1%/acronyms.tex from %WS1%/main.tex .
[19:20:21.050][Cacher] Adding %WS1%/acronyms.tex .
[19:20:21.051][Cacher][Watcher] Watched %WS1%/acronyms.tex by the .* watcher.
[19:20:21.052][Event] FILE_WATCHED: "%WS1%/acronyms.tex"
[19:20:21.054][Cacher] Caching %WS1%/acronyms.tex .
[19:20:21.091][Cacher] Input %WS1%/commands.tex from %WS1%/main.tex .
[19:20:21.093][Cacher] Adding %WS1%/commands.tex .
[19:20:21.094][Cacher][Watcher] Watched %WS1%/commands.tex by the .* watcher.
[19:20:21.094][Event] FILE_WATCHED: "%WS1%/commands.tex"
[19:20:21.095][Cacher] Caching %WS1%/commands.tex .
[19:20:21.104][Cacher] Updated inputs of %WS1%/config.tex .
[19:20:21.104][Cacher] Parse LaTeX AST: %WS1%/config.tex .
[19:20:21.111][Cacher] Updated inputs of %WS1%/acronyms.tex .
[19:20:21.112][Cacher] Parse LaTeX AST: %WS1%/acronyms.tex .
[19:20:21.380][Cacher] Parsed LaTeX AST in 275.29 ms: %WS1%/config.tex .
[19:20:21.389][Cacher] Updated elements in 8.32 ms: %WS1%/config.tex .
[19:20:21.390][Event] FILE_PARSED: "%WS1%/config.tex"
[19:20:21.485][Cacher] Input %WS1%/titlepage.tex from %WS1%/main.tex .
[19:20:21.486][Cacher] Adding %WS1%/titlepage.tex .
[19:20:21.488][Cacher][Watcher] Watched %WS1%/titlepage.tex by the .* watcher.
[19:20:21.488][Event] FILE_WATCHED: "%WS1%/titlepage.tex"
[19:20:21.491][Cacher] Caching %WS1%/titlepage.tex .
[19:20:21.514][Cacher] Parsed LaTeX AST in 401.70 ms: %WS1%/acronyms.tex .
[19:20:21.516][Cacher] Updated elements in 1.18 ms: %WS1%/acronyms.tex .
[19:20:21.517][Event] FILE_PARSED: "%WS1%/acronyms.tex"
[19:20:21.544][Cacher] Updated inputs of %WS1%/commands.tex .
[19:20:21.545][Cacher] Parse LaTeX AST: %WS1%/commands.tex .
[19:20:21.569][Cacher] Parsed LaTeX AST in 23.80 ms: %WS1%/commands.tex .
[19:20:21.570][Cacher] Updated elements in 0.63 ms: %WS1%/commands.tex .
[19:20:21.571][Event] FILE_PARSED: "%WS1%/commands.tex"
[19:20:21.852][Cacher] Input %WS1%/content/literatur.tex from %WS1%/main.tex .
[19:20:21.853][Cacher] Adding %WS1%/content/literatur.tex .
[19:20:21.854][Cacher][Watcher] Watched %WS1%/content/literatur.tex with a new .* watcher on %WS1%/content .
[19:20:21.854][Event] FILE_WATCHED: "%WS1%/content/literatur.tex"
[19:20:21.855][Cacher] Caching %WS1%/content/literatur.tex .
[19:20:21.857][Cacher] Updated inputs of %WS1%/titlepage.tex .
[19:20:21.857][Cacher] Parse LaTeX AST: %WS1%/titlepage.tex .
[19:20:21.868][Cacher] Parsed LaTeX AST in 9.84 ms: %WS1%/titlepage.tex .
[19:20:21.872][Cacher] Updated elements in 2.48 ms: %WS1%/titlepage.tex .
[19:20:21.873][Event] FILE_PARSED: "%WS1%/titlepage.tex"
[19:20:21.984][Cacher] Input %WS1%/content/grundlagen.tex from %WS1%/main.tex .
[19:20:21.985][Cacher] Adding %WS1%/content/grundlagen.tex .
[19:20:21.985][Cacher][Watcher] Watched %WS1%/content/grundlagen.tex by the .* watcher.
[19:20:21.986][Event] FILE_WATCHED: "%WS1%/content/grundlagen.tex"
[19:20:21.987][Cacher] Caching %WS1%/content/grundlagen.tex .
[19:20:21.990][Cacher] Updated inputs of %WS1%/content/grundlagen.tex .
[19:20:21.991][Cacher] Parse LaTeX AST: %WS1%/content/grundlagen.tex .
[19:20:21.994][Cacher] Updated inputs of %WS1%/content/literatur.tex .
[19:20:21.994][Cacher] Parse LaTeX AST: %WS1%/content/literatur.tex .
[19:20:22.200][Cacher] Input %WS1%/content/kernspaltung.tex from %WS1%/main.tex .
[19:20:22.202][Cacher] Adding %WS1%/content/kernspaltung.tex .
[19:20:22.202][Cacher][Watcher] Watched %WS1%/content/kernspaltung.tex by the .* watcher.
[19:20:22.204][Event] FILE_WATCHED: "%WS1%/content/kernspaltung.tex"
[19:20:22.206][Cacher] Caching %WS1%/content/kernspaltung.tex .
[19:20:22.222][Cacher] Input %WS1%/content/reaktortechnik.tex from %WS1%/main.tex .
[19:20:22.223][Cacher] Adding %WS1%/content/reaktortechnik.tex .
[19:20:22.224][Cacher][Watcher] Watched %WS1%/content/reaktortechnik.tex by the .* watcher.
[19:20:22.224][Event] FILE_WATCHED: "%WS1%/content/reaktortechnik.tex"
[19:20:22.226][Cacher] Caching %WS1%/content/reaktortechnik.tex .
[19:20:22.230][Cacher] Updated inputs of %WS1%/content/kernspaltung.tex .
[19:20:22.230][Cacher] Parse LaTeX AST: %WS1%/content/kernspaltung.tex .
[19:20:22.247][Cacher] Input %WS1%/content/kernfusion.tex from %WS1%/main.tex .
[19:20:22.248][Cacher] Adding %WS1%/content/kernfusion.tex .
[19:20:22.248][Cacher][Watcher] Watched %WS1%/content/kernfusion.tex by the .* watcher.
[19:20:22.248][Event] FILE_WATCHED: "%WS1%/content/kernfusion.tex"
[19:20:22.249][Cacher] Caching %WS1%/content/kernfusion.tex .
[19:20:22.252][Cacher] Updated inputs of %WS1%/content/reaktortechnik.tex .
[19:20:22.253][Cacher] Parse LaTeX AST: %WS1%/content/reaktortechnik.tex .
[19:20:22.302][Cacher] Input %WS1%/content/photovoltaik.tex from %WS1%/main.tex .
[19:20:22.305][Cacher] Adding %WS1%/content/photovoltaik.tex .
[19:20:22.306][Cacher][Watcher] Watched %WS1%/content/photovoltaik.tex by the .* watcher.
[19:20:22.306][Event] FILE_WATCHED: "%WS1%/content/photovoltaik.tex"
[19:20:22.307][Cacher] Caching %WS1%/content/photovoltaik.tex .
[19:20:22.310][Cacher] Updated inputs of %WS1%/content/kernfusion.tex .
[19:20:22.311][Cacher] Parse LaTeX AST: %WS1%/content/kernfusion.tex .
[19:20:22.441][Cacher] Input %WS1%/content/windenergie.tex from %WS1%/main.tex .
[19:20:22.442][Cacher] Adding %WS1%/content/windenergie.tex .
[19:20:22.443][Cacher][Watcher] Watched %WS1%/content/windenergie.tex by the .* watcher.
[19:20:22.443][Event] FILE_WATCHED: "%WS1%/content/windenergie.tex"
[19:20:22.443][Cacher] Caching %WS1%/content/windenergie.tex .
[19:20:22.444][Cacher] Updated inputs of %WS1%/main.tex .
[19:20:22.444][Cacher] Parse LaTeX AST: %WS1%/main.tex .
[19:20:22.446][Cacher] Updated inputs of %WS1%/content/photovoltaik.tex .
[19:20:22.446][Cacher] Parse LaTeX AST: %WS1%/content/photovoltaik.tex .
[19:20:22.523][Cacher] Updated inputs of %WS1%/content/windenergie.tex .
[19:20:22.524][Cacher] Parse LaTeX AST: %WS1%/content/windenergie.tex .
[19:20:22.802][Cacher] Parsed LaTeX AST in 810.49 ms: %WS1%/content/grundlagen.tex .
[19:20:22.908][Cacher] Updated elements in 106.35 ms: %WS1%/content/grundlagen.tex .
[19:20:22.909][Event] FILE_PARSED: "%WS1%/content/grundlagen.tex"
[19:20:22.931][Cacher] Parsed LaTeX AST in 935.99 ms: %WS1%/content/literatur.tex .
[19:20:22.932][Cacher] Updated elements in 0.31 ms: %WS1%/content/literatur.tex .
[19:20:22.932][Event] FILE_PARSED: "%WS1%/content/literatur.tex"
[19:20:23.148][Cacher] Parsed LaTeX AST in 917.48 ms: %WS1%/content/kernspaltung.tex .
[19:20:23.178][Cacher] Updated elements in 29.06 ms: %WS1%/content/kernspaltung.tex .
[19:20:23.179][Event] FILE_PARSED: "%WS1%/content/kernspaltung.tex"
[19:20:23.359][Cacher] Parsed LaTeX AST in 1105.51 ms: %WS1%/content/reaktortechnik.tex .
[19:20:23.387][Cacher] Updated elements in 27.17 ms: %WS1%/content/reaktortechnik.tex .
[19:20:23.389][Event] FILE_PARSED: "%WS1%/content/reaktortechnik.tex"
[19:20:23.543][Cacher] Parsed LaTeX AST in 1231.85 ms: %WS1%/content/kernfusion.tex .
[19:20:23.559][Cacher] Updated elements in 15.43 ms: %WS1%/content/kernfusion.tex .
[19:20:23.561][Event] FILE_PARSED: "%WS1%/content/kernfusion.tex"
[19:20:23.564][Cacher] Parsed LaTeX AST in 1118.89 ms: %WS1%/main.tex .
[19:20:23.565][File] Calling kpsewhich to resolve scrbook.cls .
[19:20:23.938][File] kpsewhich returned with '/usr/local/texlive/2024/texmf-dist/tex/latex/koma-script/scrbook.cls'.
[19:20:23.942][Cacher] Updated elements in 377.51 ms: %WS1%/main.tex .
[19:20:23.943][Event] FILE_PARSED: "%WS1%/main.tex"
[19:20:23.988][Cacher] Parsed LaTeX AST in 1541.24 ms: %WS1%/content/photovoltaik.tex .
[19:20:24.014][Cacher] Updated elements in 25.42 ms: %WS1%/content/photovoltaik.tex .
[19:20:24.014][Event] FILE_PARSED: "%WS1%/content/photovoltaik.tex"
[19:20:24.134][Cacher] Parsed LaTeX AST in 1609.20 ms: %WS1%/content/windenergie.tex .
[19:20:24.151][Cacher] Updated elements in 16.78 ms: %WS1%/content/windenergie.tex .
[19:20:24.152][Event] FILE_PARSED: "%WS1%/content/windenergie.tex"
[19:20:24.175][Structure] Structure force updated with 0 root sections for %WS1%/main.tex .
[19:20:24.176][Event] STRUCTURE_UPDATED
[19:20:36.224][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.


Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///usr/share/code/resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///home/kevin/.vscode/extensions/james-yu.latex-workshop-10.1.0/syntax/TeX.tmLanguage.json

Overwriting grammar scope name to file mapping for scope text.tex.latex. Old grammar file: file:///usr/share/code/resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json. New grammar file: file:///home/kevin/.vscode/extensions/james-yu.latex-workshop-10.1.0/syntax/LaTeX.tmLanguage.json

Overwriting grammar scope name to file mapping for scope text.bibtex. Old grammar file: file:///usr/share/code/resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json. New grammar file: file:///home/kevin/.vscode/extensions/james-yu.latex-workshop-10.1.0/syntax/Bibtex.tmLanguage.json

Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined. Old grammar file: file:///usr/share/code/resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json. New grammar file: file:///home/kevin/.vscode/extensions/james-yu.latex-workshop-10.1.0/syntax/markdown-latex-combined.tmLanguage.json

Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex. Old grammar file: file:///usr/share/code/resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json. New grammar file: file:///home/kevin/.vscode/extensions/james-yu.latex-workshop-10.1.0/syntax/cpp-grammar-bailout.tmLanguage.json



## Anything Else?
> _Add any other context about the problem below._
- I generated a new `.JSON`-file but that didn't change anything.
James-Yu commented 1 month ago

You need to exit snippet editing mode by pressing esc, or it might be a vscode issue.

You may post the bugged macro in your generated json file for further debug, though I suspect it may not be related.

kevinbbbb commented 1 month ago

I'm not sure what you mean by snippet editing mode. Could you please explain?

kevinbbbb commented 1 month ago

I updated my initial comment. Apparently, it's only the unstarred command like \pdv{}{} that are affected. Intellisense within the starred commands (e.g. \pdv*{}{}) works perfectly fine. Unfortunately, it's not a solution to use the starred commands as they produce different outputs.

I had a look in the .JSON but I can't find a flaw. Here are the macros for \pdv{}{} and \pdv*{}{}from the .JSON (I inserted dots where other macros are defined):

...
    "pdv{}{}": {
      "snippet": "pdv{${1:function}}{${2:variables}}"
    },
...
    "pdv*{}{}": {
      "snippet": "pdv*{${1:function}}{${2:variables}}"
    },
...