monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] Monarch Tokenizer negative "lookbehind, lookahead" not working

Open fdrag opened this issue 3 years ago • 1 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

return {
  tokenizer: {
    root: [
      [/\b(?<=var)\s\w+/, 'keyword']
    ]
  },
};

Actual Behavior

image

lookahead not woring

Expected Behavior

image

Additional Context

highlight words that doesnt start with var + whitespace

fdrag avatar Jan 10 '22 16:01 fdrag

the same problem

14glwu avatar Jul 29 '22 12:07 14glwu

I guess this depends on browser support of lookbehind which is not perfect https://caniuse.com/js-regexp-lookbehind

medihack avatar Sep 27 '22 08:09 medihack