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

Custom command not detected #618

Closed
mw88-personal opened this issue Feb 25, 2022 · 2 comments
Closed

Custom command not detected #618

mw88-personal opened this issue Feb 25, 2022 · 2 comments
Labels

Comments

@mw88-personal
Copy link

I'm having some unexpected behaviour with this code:

    \documentclass{article}

    \newcommand\firsttest[1][defaultONE]{%
        \textbf{#1}%
    }%
    \newcommand{\secondtest}[1][defaultTWO]{%
        \texttt{#1}
    }%

    \begin{document}
        \firsttest[firsttest]
        \secondtest[secondtest]
    \end{document}

It defines two new commands, with one optional argument each, and uses them in the document. Notice, the only difference is, that in \firsttest the macro name is not wrapped in braces. In the definition of the second macro, the macro name is wrapped in braces, which is the documented LaTeX way to do it.

I expect the following behaviour using texlab-vscode:

  • Intellisense suggesting completion of firsttest when typing \firs
  • Intellisense suggesting completion of secondtest, when typing \seco

Instead, the observed behaviour is:

  • completion to \firsttest works as expected
  • no Intellisense suggestion for \secondtest.

I specifically ensured, that the document was saved after the definitions and before trying autocompletion in the document environment.
I think, that not recognizing the second definition is a bug.

pfoerster added a commit to latex-lsp/texlab that referenced this issue Feb 25, 2022
@pfoerster pfoerster added the bug label Feb 25, 2022
@pfoerster
Copy link
Member

Thanks for the report. This is a bug in the texlab server, which has been fixed with latex-lsp/texlab@470aa85.

I will publish a new patch release along with other fixes tomorrow.

@pfoerster
Copy link
Member

texlab 3.3.2 has been released 🚀

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

No branches or pull requests

2 participants