Closed jharbig closed 1 week ago
The extension does not parse \def
. You may consider report the issue to unified-latex
as this extension relies on that package to parse LaTeX.
Generally, \def
is anti-pattern.
Further, we won't parse randomly appeared macros in the document, as it can be to convolute to parse its argument signature.
Pre-checks*
The Missed*
When you create commands with
\def
there are no autocompletion suggestions.I created the following minimal example to demonstrate this:
As you can see in the following image, there are no suggestions.
The Solution*
It would be nice to have autocompletion similar to commands created with
newcommand
.I also suggest including the non-letter character after the command in the suggestion because LaTeX requires this character in the usage (e.g.
\def\myCommand/{something}
can only be used `\myCommand/). So, in effect, this character is part of the command (more details below).If it is complicated to include a command from \def, it would be helpful when the autocompletion suggests commands that were used before.
Anything Else?
I considered refactoring all my commands from \def to \newcommand. Unfortunately, there is a different behavior, especially with a space after a command. I usually define commands with a slash afterward (e.g.,
\def\myCommand/{something}
such that you do not forget to add a space after a command. See https://tex.stackexchange.com/questions/31091/space-after-latex-commands or page 204 of "The TEXbook" for more info on that behavior/problem.