Disable spell check in setlength arguments (#21491)

GitOrigin-RevId: 279f5df7c97b6a6caa5a344bf50b0747402cf61d
This commit is contained in:
Alf Eaton 2024-11-05 11:59:33 +00:00 committed by Copybot
parent a827f8835b
commit 7fa8c01e31
3 changed files with 8 additions and 2 deletions

View file

@ -135,7 +135,7 @@ export const LaTeXLanguage = LRLanguage.define({
['UsePackage'],
['FigureEnvironment', 'BeginEnv'],
],
ShortTextArgument: [['Date']],
ShortTextArgument: [['Date'], ['SetLengthCommand']],
TextArgument: [['TabularEnvironment', 'BeginEnv']],
}),
// TODO: does this override groups defined in the grammar?

View file

@ -107,7 +107,8 @@
TextSubscriptCtrlSeq,
TextStrikeOutCtrlSeq,
EmphasisCtrlSeq,
UnderlineCtrlSeq
UnderlineCtrlSeq,
SetLengthCtrlSeq
}
@external specialize {EnvName} specializeEnvName from "./tokens.mjs" {
@ -406,6 +407,9 @@ KnownCommand<ArgumentType> {
} |
UnderlineCommand {
UnderlineCtrlSeq ArgumentType
} |
SetLengthCommand {
SetLengthCtrlSeq optionalWhitespace? ShortTextArgument optionalWhitespace? ShortTextArgument
}
}

View file

@ -98,6 +98,7 @@ import {
TextStrikeOutCtrlSeq,
EmphasisCtrlSeq,
UnderlineCtrlSeq,
SetLengthCtrlSeq,
} from './latex.terms.mjs'
const MAX_ARGUMENT_LOOKAHEAD = 100
@ -603,6 +604,7 @@ const otherKnowncommands = {
'\\sout': TextStrikeOutCtrlSeq,
'\\emph': EmphasisCtrlSeq,
'\\underline': UnderlineCtrlSeq,
'\\setlength': SetLengthCtrlSeq,
}
// specializer for control sequences
// return new tokens for specific control sequences