Skip to content

Commit

Permalink
Fix false positives when using siunitx
Browse files Browse the repository at this point in the history
Fixes #134.
  • Loading branch information
valentjn committed Dec 18, 2021
1 parent 570d516 commit 28caa7c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<action type="add" issue="vscode-ltex#490">
Add support for `\newcaptionname` etc. from KOMA-Script and `\DefineBibliographyStrings` from BibLaTeX (LaTeX)
</action>
<action type="fix" issue="#134">
Fix false positives when using siunitx (LaTeX)
</action>
</release>
<release version="15.2.0" date="2021-11-28">
<action type="add" issue="#120">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\algdef{}[]{}{}"),
LatexCommandSignature("\\algnewcommand{}{}"),
LatexCommandSignature("\\algrenewcommand{}{}"),
LatexCommandSignature("\\ampere", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\arabic{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\arcminute", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\arcsecond", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\astronomicalunit", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\at{}[]", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\autocite{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\autocite[]{}", LatexCommandSignature.Action.Dummy),
Expand Down Expand Up @@ -425,9 +429,12 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\autoref{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\autoref*{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\babeltags{}"),
LatexCommandSignature("\\becquerel", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\bel", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\bibitem{}"),
LatexCommandSignature("\\bibliography{}"),
LatexCommandSignature("\\bibliographystyle{}"),
LatexCommandSignature("\\candela", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\captionof{}"),
LatexCommandSignature("\\captionsetup{}"),
LatexCommandSignature("\\captionsetup[]{}"),
Expand Down Expand Up @@ -535,12 +542,16 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\color[]{}"),
LatexCommandSignature("\\colorbox{}"),
LatexCommandSignature("\\colorlet{}{}"),
LatexCommandSignature("\\coulomb", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\counterwithin{}{}"),
LatexCommandSignature("\\counterwithin*{}{}"),
LatexCommandSignature("\\counterwithout{}{}"),
LatexCommandSignature("\\counterwithout*{}{}"),
LatexCommandSignature("\\cref{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\crefname{}{}{}"),
LatexCommandSignature("\\dalton", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\day", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\decibel", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\declaretheorem{}"),
LatexCommandSignature("\\declaretheorem[]{}"),
LatexCommandSignature("\\declaretheoremstyle{}"),
Expand All @@ -556,16 +567,20 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\definecolor[][]"),
LatexCommandSignature("\\definecolor{}{}{}"),
LatexCommandSignature("\\definespotcolor{}{}{}"),
LatexCommandSignature("\\degree", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\degreeCelsius", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\directlua{}"),
LatexCommandSignature("\\documentclass{}"),
LatexCommandSignature("\\documentclass[]{}"),
LatexCommandSignature("\\electronvolt", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\email{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\enlargethispage{}"),
LatexCommandSignature("\\eqref{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\etocsetlevel{}{}"),
LatexCommandSignature("\\etocsetnexttocdepth{}"),
LatexCommandSignature("\\etocsettocstyle{}{}"),
LatexCommandSignature("\\externalfigure[]", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\farad", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\fcolorbox{}"),
LatexCommandSignature("\\floatname{}{}"),
LatexCommandSignature("\\floatstyle{}"),
Expand Down Expand Up @@ -604,6 +619,11 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\glsxtrnewsymbol{}{}"),
LatexCommandSignature("\\glsxtrnewsymbol[]{}{}"),
LatexCommandSignature("\\graphicspath{}"),
LatexCommandSignature("\\gray", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\hectare", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\henry", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\hertz", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\hour", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\hphantom{}"),
LatexCommandSignature("\\href{}{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\hyperref[]"),
Expand Down Expand Up @@ -641,19 +661,32 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\input{}"),
LatexCommandSignature("\\inputminted{}{}"),
LatexCommandSignature("\\inputminted[]{}{}"),
LatexCommandSignature("\\joule", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\katal", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\kelvin", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\kilogram", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\label{}"),
LatexCommandSignature("\\lettrine{}{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\lettrine[]{}{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\linespread{}"),
LatexCommandSignature("\\liter", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\litre", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\loadglsentries{}"),
LatexCommandSignature("\\longnewglossaryentry{}{}"),
LatexCommandSignature("\\luadirect{}"),
LatexCommandSignature("\\luaexec{}"),
LatexCommandSignature("\\lumen", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\lux", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\mdfdefinestyle{}{}"),
LatexCommandSignature("\\meter", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\metre", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\mint{}{}"),
LatexCommandSignature("\\mintinline{}{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\minute", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\mole", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\multicolumn{}{}"),
LatexCommandSignature("\\multirow{}{}"),
LatexCommandSignature("\\neper", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\newabbreviation{}{}"),
LatexCommandSignature("\\newabbreviation[]{}{}"),
LatexCommandSignature("\\newacronym{}{}"),
Expand Down Expand Up @@ -688,8 +721,10 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\newtheorem{}[]{}[]"),
LatexCommandSignature("\\newtheorem*{}{}"),
LatexCommandSignature("\\newtoggle{}"),
LatexCommandSignature("\\newton", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\nolinkurl{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\numberwithin{}{}"),
LatexCommandSignature("\\ohm", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\pagecolor{}"),
LatexCommandSignature("\\pagenumbering{}"),
LatexCommandSignature("\\pageref{}", LatexCommandSignature.Action.Dummy),
Expand All @@ -701,6 +736,7 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\parencite*{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\parencite*[]{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\parencite*[][]{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\pascal", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\pdfbookmark{}{}"),
LatexCommandSignature("\\pdfbookmark[]{}{}"),
LatexCommandSignature("\\pgfdeclaredecoration{}{}{}"),
Expand All @@ -721,6 +757,7 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\providecommand{}[]{}"),
LatexCommandSignature("\\providecommand*{}{}"),
LatexCommandSignature("\\providecommand*{}[]{}"),
LatexCommandSignature("\\radian", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\raisebox{}"),
LatexCommandSignature("\\ref{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\ref*{}", LatexCommandSignature.Action.Dummy),
Expand All @@ -740,6 +777,7 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\renewenvironment*{}[]{}{}"),
LatexCommandSignature("\\renewlist{}{}{}"),
LatexCommandSignature("\\scalebox{}"),
LatexCommandSignature("\\second", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\selectlanguage{}"),
LatexCommandSignature("\\setabbreviationstyle{}"),
LatexCommandSignature("\\setabbreviationstyle[]{}"),
Expand Down Expand Up @@ -776,12 +814,16 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\setuppapersize[][]"),
LatexCommandSignature("\\setuptoc{}{}"),
LatexCommandSignature("\\setupwhitespace[]"),
LatexCommandSignature("\\siemens", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\sievert", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\sisetup{}"),
LatexCommandSignature("\\smartcite{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\smartcite[]{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\smartcite[][]{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\stepcounter{}"),
LatexCommandSignature("\\steradian", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\supercite{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\tesla", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\textcite{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\textcite[]{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\textcite[][]{}", LatexCommandSignature.Action.Dummy),
Expand Down Expand Up @@ -846,6 +888,7 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\todo[]{}"),
LatexCommandSignature("\\togglefalse{}"),
LatexCommandSignature("\\toggletrue{}"),
LatexCommandSignature("\\tonne", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\unsettoc{}{}"),
LatexCommandSignature("\\url{}", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\useURL[][][][]"),
Expand All @@ -856,9 +899,12 @@ object LatexAnnotatedTextBuilderDefaults {
LatexCommandSignature("\\usepackage[]{}"),
LatexCommandSignature("\\usetikzlibrary{}"),
LatexCommandSignature("\\value{}"),
LatexCommandSignature("\\volt", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\vphantom{}"),
LatexCommandSignature("\\vspace{}"),
LatexCommandSignature("\\vspace*{}"),
LatexCommandSignature("\\watt", LatexCommandSignature.Action.Dummy),
LatexCommandSignature("\\weber", LatexCommandSignature.Action.Dummy),
)

val babelLanguageMap: Map<String, String> = LatexFragmentizer.BABEL_LANGUAGE_MAP
Expand Down

0 comments on commit 28caa7c

Please sign in to comment.