mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-16 17:02:42 +00:00
Merge pull request #19158 from overleaf/mj-commands-autocomplete-optional-args
[web] Avoid double counting optional arguments for autocomplete GitOrigin-RevId: 7abdc73657791b945bd5a7a9e29f5cd127c7882b
This commit is contained in:
parent
1844603a2d
commit
abaf07a8bb
1 changed files with 4 additions and 2 deletions
|
@ -108,7 +108,8 @@ export const enterNode = (
|
|||
}
|
||||
|
||||
const optionalArguments = commandNode.getChildren('OptionalArgument')
|
||||
const commandArguments = commandNode.getChildren('$Argument')
|
||||
const commandArgumentsIncludingOptional =
|
||||
commandNode.getChildren('$Argument')
|
||||
const text = state.doc.sliceString(ctrlSeq.from, ctrlSeq.to)
|
||||
|
||||
const thisCommand = {
|
||||
|
@ -117,7 +118,8 @@ export const enterNode = (
|
|||
from: commandNode.from,
|
||||
to: commandNode.to,
|
||||
optionalArgCount: optionalArguments.length,
|
||||
requiredArgCount: commandArguments.length,
|
||||
requiredArgCount:
|
||||
commandArgumentsIncludingOptional.length - optionalArguments.length,
|
||||
}
|
||||
items.push(thisCommand)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue