latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.55k stars 53 forks source link

Complete `cite=` in acros \DeclareAcronym #324

Closed obreitwi closed 3 years ago

obreitwi commented 3 years ago

The acro package allows for a cite=-key to reference a citation to be printed when the acronym is first introduced.

It would be nice if texlab could perform the same expansion for cite=-keys as it does for "regular" citation-related commands.

I tried simply adding cite= as citation command in data/lang_data.json, but that seems to fail because texlab expects citationCommands to be commands and not entries in \DeclareAcronym.

Note: I am using texlab via coc-texlab

Any pointers would be appreciated. Thank you!

pfoerster commented 3 years ago

Thanks for the report!

It would be nice if texlab could perform the same expansion for cite=-keys as it does for "regular" citation-related commands.

I tried simply adding cite= as citation command in data/lang_data.json, but that seems to fail because texlab expects citationCommands to be commands and not entries in \DeclareAcronym.

Yeah, the problem at the moment is that we do not currently parse key value pairs in command arguments and treat them like text instead. This needs to be fixed in order to implement this feature. As I said in #323, I am currently working on the LaTeX and BibTeX parsers, making them incremental, and I will add key value pair parsing for LaTeX as well. Once this is done, we can take a look at this issue. Just give me a little bit more time and I will get back to you. Thank you for contributing!

pfoerster commented 3 years ago

This feature has now shipped with texlab 3.x.

obreitwi commented 3 years ago

Thank you very much! Works like a charm <3