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'], ['UsePackage'],
['FigureEnvironment', 'BeginEnv'], ['FigureEnvironment', 'BeginEnv'],
], ],
ShortTextArgument: [['Date']], ShortTextArgument: [['Date'], ['SetLengthCommand']],
TextArgument: [['TabularEnvironment', 'BeginEnv']], TextArgument: [['TabularEnvironment', 'BeginEnv']],
}), }),
// TODO: does this override groups defined in the grammar? // TODO: does this override groups defined in the grammar?

View file

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

View file

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