Autocomplete for \left command

Signed-off-by: Joao C. Monteiro <jcmonteiro@poli.ufrj.br>
This commit is contained in:
Joao C. Monteiro 2018-05-04 16:02:34 -03:00
parent a34eb07ed5
commit b0ceb7ff68
2 changed files with 16 additions and 1 deletions

View File

@ -4,6 +4,21 @@
"snippet":"begin{${1:env}}\n\t$2\n\\\\end{${1:env}}",
"detail":"begin a new environment"
},
"lrparen":{
"command":"left(",
"snippet":"left(${1}\\right)${0}",
"detail":"\\left( ... \\right)"
},
"lrbrack":{
"command":"left[",
"snippet":"left[${1}\\right]${0}",
"detail":"\\left[ ... \\right]"
},
"lrcurly":{
"command":"left\\{",
"snippet":"left\\{${1}\\right\\\\}${0}",
"detail":"\\left\\{ ... \\right\\}"
},
"latexinlinemath":{
"command":"(",
"snippet":"(${1}\\)${0}",

View File

@ -48,7 +48,7 @@ export class Command {
command.insertText = new vscode.SnippetString(item.snippet)
this.defaultCommands[key] = command
})
const bracketCommands = {'latexinlinemath': '(', 'latexdisplaymath': '[', 'curlybrackets': '{'}
const bracketCommands = {'latexinlinemath': '(', 'latexdisplaymath': '[', 'curlybrackets': '{', 'lrparen': 'left(', 'lrbrack': 'left[', 'lrcurly': 'left\\{'}
this.specialBrackets = Object.keys(this.defaultCommands)
.filter(key => bracketCommands.hasOwnProperty(key))
.reduce((obj, key) => {