James-Yu / LaTeX-Workshop

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

Intellisense dynamically add environments after use (again) #4053

Closed arkandias closed 11 months ago

arkandias commented 11 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. (There was indeed a bug report but it's closed and cannot be reopened.)
  • [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: macOS 14.1
  • Visual Studio Code Version: 1.84.0
  • LaTeX Workshop Version: 9.14.1
  • TeX Distribution Version: TeX Live 2023

Please list the environment and version number if you are using VSCodium, Snap or Flatpack versions of Visual Studio Code, and/or Visual Studio Code Remote Containers/SSH/WSL.

The Issue*

Please briefly describe the issue you come across.

I am getting the exact same bug as described here. Intellisense does not add dynamically new environment. I am using various custom environments throughout my tex files (e.g., theo, prop, coro...) but they never show up as a suggestion when I add a new environment (see the screenshot below).

Capture d’écran 2023-11-02 à 12 16 20

Reproduction Steps

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

  1. Copy/paste the few lines of code from the screenshot.

Expected Behavior

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

  • I would expect Intellisense to add prop in the environment suggestions.

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.

[13:48:38.395][Format][TeX] Start formatting with latexindent.
[13:48:38.397][Format][TeX] Formatting LaTeX. The command is latexindent:["-c","%WS1%/","%WS1%/__latexindent_temp_03_formes_quadratiques.tex","-y=defaultIndent: '    '","-m","-l"].
[13:48:38.671][Format][TeX] Formatted %WS1%/03_formes_quadratiques.tex
[13:48:38.703][Extension] onDidSaveTextDocument triggered: file://%WS1%/03_formes_quadratiques.tex
[13:48:38.841][Cacher][Watcher] "change" emitted on %WS1%/03_formes_quadratiques.tex .
[13:48:38.843][Cacher] Caching %WS1%/03_formes_quadratiques.tex .
[13:48:38.845][Cacher] Updated inputs of %WS1%/03_formes_quadratiques.tex .
[13:48:38.845][Cacher] Parse LaTeX AST: %WS1%/03_formes_quadratiques.tex .
[13:48:38.845][Builder] Auto build started detecting the change of a file: %WS1%/03_formes_quadratiques.tex .
[13:48:38.845][Event] AUTO_BUILD_INITIATED: {"type":"onChange","file":"%WS1%/03_formes_quadratiques.tex"}
[13:48:38.845][Commander] BUILD command invoked.
[13:48:38.846][Commander] The document of the active editor: file://%WS1%/03_formes_quadratiques.tex
[13:48:38.846][Commander] The languageId of the document: latex
[13:48:38.846][Commander] Building root file: %WS1%/grp-geo.tex
[13:48:38.846][Builder] Build root file %WS1%/grp-geo.tex
[13:48:38.846][Event] FILE_CHANGED: "%WS1%/03_formes_quadratiques.tex"
[13:48:38.848][Builder] outDir: %WS1% .
[13:48:38.849][Builder] Found TeX program by magic comment: pdflatexmk.
[13:48:38.850][Builder] Found BIB program by magic comment: biber.
[13:48:38.850][Builder] Preparing to run recipe: latexmk.
[13:48:38.851][Builder] Prepared 1 tools.
[13:48:38.852][Builder] Recipe step 1 The command is latexmk:["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=%WS1%","%WS1%/grp-geo"].
[13:48:38.852][Builder] env: {}
[13:48:38.852][Builder] root: %WS1%/grp-geo.tex
[13:48:38.853][Builder] cwd: %WS1%
[13:48:38.856][Builder] LaTeX build process spawned with PID 35030.
[13:48:38.893][Cacher] Parsed LaTeX AST: %WS1%/03_formes_quadratiques.tex .
[13:48:38.895][Cacher] Updated elements in 1.13 ms: %WS1%/03_formes_quadratiques.tex .
[13:48:38.895][Event] FILE_PARSED: "%WS1%/03_formes_quadratiques.tex"
[13:48:38.921][Structure] Structure force updated with 5 root sections for %WS1%/grp-geo.tex .
[13:48:38.923][Event] STRUCTURE_UPDATED
[13:48:45.440][Cacher][Watcher] "create" emitted on %WS1%/grp-geo.pdf after polling for 252 ms.
[13:48:45.441][Event] FILE_CHANGED: "%WS1%/grp-geo.pdf"
[13:48:45.488][Parser][TexLog] Logged 2 messages.
[13:48:45.489][Builder] Finished a step in recipe with PID 35030.
[13:48:45.490][Builder] Successfully built %WS1%/grp-geo.tex .
[13:48:45.490][Event] BUILD_DONE
[13:48:45.490][Viewer] Call refreshExistingViewer: "%WS1%/grp-geo.pdf" .
[13:48:45.491][Viewer] Refresh PDF viewer: %WS1%/grp-geo.pdf
[13:48:45.492][Cacher][Path] Non-existent .fls for %WS1%/grp-geo.tex .
[13:48:45.502][Server] Preview PDF file: file://%WS1%/grp-geo.pdf
[13:48:45.666][Viewer] Handle data type: loaded
[13:48:45.667][Event] VIEWER_PAGE_LOADED
[13:48:48.464][Cacher][Watcher] "change" emitted on %WS1%/grp-geo.pdf after polling for 253 ms.
[13:48:48.465][Event] FILE_CHANGED: "%WS1%/grp-geo.pdf"

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.

log.ts:431  WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-dotnettools.dotnet-interactive-vscode' wants API proposal 'languageConfigurationAutoClosingPairs' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/TeX.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/LaTeX.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/Bibtex.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/markdown-latex-combined.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/cpp-grammar-bailout.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/redhat.vscode-yaml-1.14.0/syntaxes/yaml.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/TeX.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/LaTeX.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/Bibtex.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/markdown-latex-combined.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/james-yu.latex-workshop-9.14.1/syntax/cpp-grammar-bailout.tmLanguage.json
register @ TMScopeRegistry.ts:46
TMScopeRegistry.ts:46 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///Users/[redacted]/.vscode/extensions/redhat.vscode-yaml-1.14.0/syntaxes/yaml.tmLanguage.json
register @ TMScopeRegistry.ts:46
webviewElement.ts:512 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:512
viewer.js:13419 #editor_alt_text_dialog_label is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_dialog_description is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_add_description_label is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_add_description_description is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_textarea is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_mark_decorative_label is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_mark_decorative_description is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_cancel_button is undefined.
translateElement @ viewer.js:13419
viewer.js:13419 #editor_alt_text_save_button is undefined.
translateElement @ viewer.js:13419
log.ts:421  INFO [perf] Render performance baseline is 31ms
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/latexworkshop.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/connection.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/build/pdf.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/synctex.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/htmleditor.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/utils.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/pagetrimmer.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/externalpromise.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/out/viewer/components/viewerhistory.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/viewer/viewer.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for http://127.0.0.1:61057/build/pdf.worker.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error

Anything Else?

Add any other context about the problem below.

James-Yu commented 11 months ago
image

Did you save the document?

arkandias commented 11 months ago

Thanks for your answer (and apologies for my late reply). The document was saved indeed.

I tried with a minimal example (as in your example) and it worked as expected. The document concerned with the issue is a book with several files, so I wanted to do some more tests to understand at which point exactly the bug happened, but the last release of LaTeX-Workshop in VS Code just fixed it. If it happens again I will try to give you a minimal example of the problem.