ltex-ls
ltex-ls copied to clipboard
Add support for `\cpageref`, `\labelcref` and variants
This adds support for the \cpageref
, \cpagerefrange
, \labelcref
and \labelcpageref
commands of the cleveref
package. The main command, \cref
, already had support. I used the same line as in the \cref
support, that is:
LatexCommandSignature("\\cpagerefrange{}{}", LatexCommandSignature.Action.Dummy),
If I understand correctly, LatexCommandSignature.Action.Dummy
raises a dummy warning when the command is parsed by replacing the command by Jimmy
in the text. I am not sure if this should be the default behavior for those commands that are used a lot in documents.
Edit
I just understood the relevance of replacing with Jimmy
. It is necessary to replace the command with a term to avoid gaps in the sentences that would also lead to errors.
Jimmy
works very well in English, but in French, as we often add a gendered determinant before commands of the type cref
, it is less versatile and leads to a concordance error.