James-Yu / LaTeX-Workshop

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

"View Documentation" on hover not working #3737

Closed MBerman9 closed 1 year ago

MBerman9 commented 1 year 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*

The Issue*

Hover a \usepackage{...} and click on "view documentation", or run "LaTex Workshop: Show package documentation" or "LaTex Workshop: Show package documentation actually used". When the default pdf viewer is set to VScode, all of these do nothing. When the pdf viewer is set to anything else (I tried Microsoft Edge and Adobe Acrobat Reader), it opens the pdf. Using texdoc in the terminal also opens the pdf even when the default pdf viewer is VScode.

Reproduction Steps

  1. Set default app for .pdf files to VSCode in Windows settings
  2. hover on package name and click "View Documentation

Expected Behavior

The pdf of the documentation opening in a new tab (like when using texdoc in the terminal).

Logs

LaTeX Workshop Output*

The logs at 16:46:16-17 are from clicking "View Documention". The logs after that are from using texdoc in the terminal

[16:45:16][Logger] New log placeholder %WS1% registered for c:\Users\berma\OneDrive\Desktop\LatexWorkshopTest .
[16:45:16][Config] Configuration for workspace: file:///c:/Users/berma/OneDrive/Desktop/LatexWorkshopTest .
[16:45:16][Config] editor.acceptSuggestionOnEnter: "off" .
[16:45:16][Config] latex-workshop.bind.enter.key: true .
[16:45:16][Config] latex-workshop.docker.enabled: false .
[16:45:16][Config] latex-workshop.docker.image.latex: "" .
[16:45:16][Config] latex-workshop.hover.preview.mathjax.extensions: [] .
[16:45:16][Config] latex-workshop.intellisense.package.enabled: true .
[16:45:16][Config] latex-workshop.intellisense.update.aggressive.enabled: false .
[16:45:16][Config] latex-workshop.intellisense.update.delay: 1000 .
[16:45:16][Config] latex-workshop.latex.autoBuild.run: "onFileChange" .
[16:45:16][Config] latex-workshop.latex.build.forceRecipeUsage: true .
[16:45:16][Config] latex-workshop.latex.outDir: "%DIR%" .
[16:45:16][Config] latex-workshop.latex.recipes: [
 {
  "name": "latexmk",
  "tools": [
   "latexmk"
  ]
 },
 {
  "name": "latexmk (latexmkrc)",
  "tools": [
   "latexmk_rconly"
  ]
 },
 {
  "name": "latexmk (lualatex)",
  "tools": [
   "lualatexmk"
  ]
 },
 {
  "name": "latexmk (xelatex)",
  "tools": [
   "xelatexmk"
  ]
 },
 {
  "name": "pdflatex -> bibtex -> pdflatex * 2",
  "tools": [
   "pdflatex",
   "bibtex",
   "pdflatex",
   "pdflatex"
  ]
 },
 {
  "name": "Compile Rnw files",
  "tools": [
   "rnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "Compile Jnw files",
  "tools": [
   "jnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "Compile Pnw files",
  "tools": [
   "pnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "tectonic",
  "tools": [
   "tectonic"
  ]
 }
] .
[16:45:16][Config] latex-workshop.latex.tools: [
 {
  "name": "latexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "--shell-escape",
   "-pdf",
   "%DOC%"
  ]
 },
 {
  "name": "pdflatex",
  "command": "pdflatex",
  "args": [
   "--shell-escape",
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "%DOC%"
  ]
 },
 {
  "name": "bibtex",
  "command": "bibtex",
  "args": [
   "%DOCFILE%"
  ],
  "env": {}
 }
] .
[16:45:16][Config] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto" .
[16:45:16][Manager] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[16:45:17][Server] Creating LaTeX Workshop http and websocket server.
[16:45:17][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":60190} .
[16:45:17][Extension] Initializing LaTeX Workshop.
[16:45:17][Extension] Extension root: c:\Users\berma\.vscode\extensions\james-yu.latex-workshop-9.7.0
[16:45:17][Extension] $PATH: C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Wolfram Research\WolframScript\;C:\Program Files\PowerShell\7\;C:\Users\berma\AppData\Local\Microsoft\WindowsApps;;C:\Users\berma\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\berma\.dotnet\tools;C:\Users\berma\Documents\QuartusIIWebEdition\modelsim_ase\win32aloem;C:\Users\berma\AppData\Local\Pandoc\;C:\texlive\2022\bin\win32
[16:45:17][Extension] $SHELL: undefined
[16:45:17][Extension] $LANG: undefined
[16:45:17][Extension] $LC_ALL: undefined
[16:45:17][Extension] process.platform: win32
[16:45:17][Extension] process.arch: x64
[16:45:17][Extension] vscode.env.appName: Visual Studio Code
[16:45:17][Extension] vscode.env.remoteName: undefined
[16:45:17][Extension] vscode.env.uiKind: 1
[16:45:17][Extension] LaTeX Workshop initialized.
[16:45:17][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[16:45:17][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[16:45:17][Manager] Current workspace folders: ["file:///c:/Users/berma/OneDrive/Desktop/LatexWorkshopTest"]
[16:45:17][Manager] Found root file from active editor: %WS1%\test.tex
[16:45:17][Manager] Root file changed: from undefined to %WS1%\test.tex
[16:45:17][Manager] Start to find all dependencies.
[16:45:17][Manager] Root file languageId: latex
[16:45:17][Cacher][Watcher] Reset.
[16:45:17][Cacher] Adding %WS1%\test.tex .
[16:45:17][Cacher][Watcher] Watched %WS1%\test.tex with a new watcher on %WS1% .
[16:45:17][Cacher] Caching %WS1%\test.tex .
[16:45:17][Cacher] Updated inputs of %WS1%\test.tex .
[16:45:17][Server] valdOrigin is http://127.0.0.1:60190
[16:45:17][DupLabel] Checking for duplicate labels: %WS1%\test.tex .
[16:45:17][Cacher] Updated elements of %WS1%\test.tex .
[16:45:17][Cacher] Updated bibs of %WS1%\test.tex .
[16:45:18][Cacher] Cached %WS1%\test.tex .
[16:45:18][Cacher] Parsing .fls %WS1%\test.fls .
[16:45:18][Cacher] Found .aux %WS1%\test.tex from .fls %WS1%\test.fls , parsing.
[16:45:18][Cacher] Parsed .aux %WS1%\test.tex .
[16:45:18][Cacher] Parsed .fls %WS1%\test.fls .
[16:45:18][Structure] Structure force updated with 0 root sections for %WS1%\test.tex .
[16:46:16][TeXDoc] Run texdoc command The command is texdoc:["--view","amsmath"].
[16:46:17][TeXDoc] Opening documentation for amsmath.
[16:46:17][TeXDoc] texdoc stdout: 
[16:46:17][TeXDoc] texdoc stderr: 
[16:46:35][Viewer][Panel] Internal PDF viewer at http://127.0.0.1:60190/viewer.html?file=pdf..ZmlsZSUzQSUyRiUyRiUyRmMlM0ElMkZ0ZXhsaXZlJTJGMjAyMiUyRnRleG1mLWRpc3QlMkZkb2MlMkZsYXRleCUyRmFtc21hdGglMkZhbXNsZG9jLnBkZg .
[16:46:35][Cacher][Watcher] Watched c:\texlive\2022\texmf-dist\doc\latex\amsmath\amsldoc.pdf with a new watcher on c:\texlive\2022\texmf-dist\doc\latex\amsmath .
[16:46:35][Viewer] Open PDF tab for file:///c:/texlive/2022/texmf-dist/doc/latex/amsmath/amsldoc.pdf
[16:46:35][Viewer] Handle data type: open
[16:46:35][Server] Preview PDF file: file:///c:/texlive/2022/texmf-dist/doc/latex/amsmath/amsldoc.pdf
[16:46:35][Viewer] Handle data type: loaded
[16:46:35][Viewer] SyncTex after build invoked.
[16:46:35][Locator] No active editor found.

Developer Tools Console

In the message bellow, everything up to and including the line workbench.desktop.main.js:616 INFO [perf] Render performance baseline is 39ms was there as soon as I opened the window. Everything after did not appear until I used texdoc in the terminal (which worked).

workbench.desktop.main.js:616  WARN Via 'product.json#extensionEnabledApiProposals' extension 'github.vscode-pull-request-github' wants API proposal 'commentsResolvedState' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
workbench.desktop.main.js:1920 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///c%3A/Users/berma/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///c%3A/Users/berma/.vscode/extensions/james-yu.latex-workshop-9.7.0/syntax/TeX.tmLanguage.json
register @ workbench.desktop.main.js:1920
workbench.desktop.main.js:1920 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///c%3A/Users/berma/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json.
New grammar file: file:///c%3A/Users/berma/.vscode/extensions/james-yu.latex-workshop-9.7.0/syntax/LaTeX.tmLanguage.json
register @ workbench.desktop.main.js:1920
workbench.desktop.main.js:1920 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///c%3A/Users/berma/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json.
New grammar file: file:///c%3A/Users/berma/.vscode/extensions/james-yu.latex-workshop-9.7.0/syntax/Bibtex.tmLanguage.json
register @ workbench.desktop.main.js:1920
workbench.desktop.main.js:1920 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined.
Old grammar file: file:///c%3A/Users/berma/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.
New grammar file: file:///c%3A/Users/berma/.vscode/extensions/james-yu.latex-workshop-9.7.0/syntax/markdown-latex-combined.tmLanguage.json
register @ workbench.desktop.main.js:1920
workbench.desktop.main.js:1920 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///c%3A/Users/berma/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///c%3A/Users/berma/.vscode/extensions/james-yu.latex-workshop-9.7.0/syntax/cpp-grammar-bailout.tmLanguage.json
register @ workbench.desktop.main.js:1920
workbench.desktop.main.js:616  INFO [perf] Render performance baseline is 39ms
DevTools failed to load source map: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/441438abd1ac652551dbe4d408dfcec8a499b8bf/core/vs/workbench/workbench.desktop.main.js.map: Load canceled due to load timeout
DevTools failed to load source map: Could not load content for http://127.0.0.1:60728/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:60728/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:60728/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:60728/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:60728/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:60728/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:60728/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:60728/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:60728/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:60728/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:60728/build/pdf.worker.js.map: Fetch through target failed: Target not supported; Fallback: Unknown error

Anything Else?

This problem might be similar to bug #2437, but it seems different.

James-Yu commented 1 year ago
[16:46:16][TeXDoc] Run texdoc command The command is texdoc:["--view","amsmath"].
[16:46:17][TeXDoc] Opening documentation for amsmath.

The extension has passed the proper arguments to texdoc. It looks like a coordination issue between texdoc and vscode, which is beyond the reach of this extension.