ltex-ls icon indicating copy to clipboard operation
ltex-ls copied to clipboard

Add support for `\cpageref`, `\labelcref` and variants

Open loicreynier opened this issue 11 months ago • 0 comments

This adds support for the \cpageref, \cpagerefrange, \labelcrefand \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 Jimmyin 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.

loicreynier avatar Jul 27 '23 13:07 loicreynier