tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
474 stars 28 forks source link

Could not find definition for (any tex command) #386

Closed dzx-dzx closed 10 months ago

dzx-dzx commented 1 year ago

Describe the bug

Right click and select Go to definition on any command prompts Could not find definition.

To Reproduce

Steps to reproduce the behaviour:

  1. Right click on tex command
  2. Click on Go to definition
  3. See error

Expected behaviour

A new tab opening the source definition appears.

Logs

LaTeX Workshop Output Nothing
LaTeX Utilities Output ``` [14:15:31] Running command texdef --source --Find --tex latex --class article \section [14:15:34] Took 2997ms to find definition for \section [14:15:34] Could not find definition for \section ```
Developer Tools Console ``` texdef: Version 1.9 -- 2020/09/27 ```

Screenshots

Desktop

Additional context

Running texdef --source --Find --tex latex --class "article" \section from the console directly gives:

Source code definition of '\section' could not be found.
".ection first defined in "c:\texlive\2023\texmf-dist\tex\latex\base\article.cls

:

Tex Live is the 2023 edition, and no package has been upgraded since installation.

It is similar to https://github.com/tecosaur/LaTeX-Utilities/issues/122 and https://github.com/tecosaur/LaTeX-Utilities/issues/381.

q-wertz commented 12 months ago

For me most of the commands work, but e.g. lVert, rVert are not…

As this seems a more general issue I just add it here and not in #122 or #381 as they are for specific cases.

LaTeX Utilities output:

[10:36:40] Running command texdef --source --Find --tex latex --class [APA,STIX1COL]ION-APA-Template \rVert
[10:36:40] Could not find definition for \rVert

[10:38:11] Running command texdef --source --Find --tex latex --class [APA,STIX1COL]ION-APA-Template \lVert
[10:38:11] Could not find definition for \lVert

To make sure it is not an issue of the document type:

$ texdef --source --Find --tex latex --class [10pt,a4paper]article \lVert
zsh: no matches found: [10pt,a4paper]article
leoleoasd commented 10 months ago

You need to escape [] or wrap them in " in zsh. However:

$ texdef --source --Find --tex latex --class "[10pt,a4paper]article" \lVert

\lVert:
undefined

I think this is an issue with texdef rather than this extension.