Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go To Definition does not work for macros defined in packages #855

Open
real-or-random opened this issue Feb 21, 2023 · 2 comments
Open

Comments

@real-or-random
Copy link

When I want to look up definitions for macros defined in packages (e.g., \addbibresource in biblatex.sty, or \tnorm in cryptocode.sty), this doesn't work. The lsp-io-logs show that the server returns an empty result. But jumping to definitions works fine for macros that I define in my own tex files.

First of all, is this supposed to work? If yes, how can I get this working or debug this?

I'm using TeXLive 2022 on Arch Linux, lsp-mode in emacs, and texlab 5.2.0.

Thanks for this great server, by the way.

@pfoerster
Copy link
Member

First of all, is this supposed to work?

No, not really at the moment. The feature is currently limited to the source code of the document and custom/local packages that are not directly part of the TeX distro. To provide auto completion for commands, texlab uses a precomputed list (latex-completion-data) but this file does not include the positions in the source file (and in fact, we do not know where how exactly it is defined).

Our approach to identifying command definitions in the server is very limited. Applying the same logic to packages requires a macro expansion engine.

Thanks for this great server, by the way.

Thanks for the kind words :)

@real-or-random
Copy link
Author

Oh, I see. I noticed that it's supported for local packages, and then I assumed that it's also supported for distro packages. It may be a good idea to document this somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants