Merge pull request #1463 from trevorgunn/DMO-hover

Pass 'DeclareMathOperator's to mathjax
This commit is contained in:
James Yu 2019-06-27 09:07:19 +08:00 committed by GitHub
commit aeaa583f2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ export class HoverProvider implements vscode.HoverProvider {
if (!configuration.get('hover.preview.newcommand.parseTeXFile.enabled') as boolean) { if (!configuration.get('hover.preview.newcommand.parseTeXFile.enabled') as boolean) {
return commandsString return commandsString
} }
const regex = /(\\(?:(?:(?:re)?new|provide)command(\*)?{\\[a-zA-Z]+}(?:\[[^\[\]\{\}]*\])*{.*})|\\(?:def\\[a-zA-Z]+(?:#[0-9])*{.*}))/gm const regex = /(\\(?:(?:(?:(?:re)?new|provide)command|DeclareMathOperator)(\*)?{\\[a-zA-Z]+}(?:\[[^\[\]\{\}]*\])*{.*})|\\(?:def\\[a-zA-Z]+(?:#[0-9])*{.*}))/gm
const commands: string[] = [] const commands: string[] = []
const noCommentContent = content.replace(/([^\\]|^)%.*$/gm, '$1') // Strip comments const noCommentContent = content.replace(/([^\\]|^)%.*$/gm, '$1') // Strip comments
let result let result