You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aeschli
changed the title
Javascript - regular expressions are not colored
Javascript - regular expressions are not colored - Javascript mode instantiated twice
Nov 17, 2015
Debugging this down, this is a regression. A change we did to vscode-textmate on Friday brings to light a issue in modeServiceImpl._getOrCreateMode: There we have a table of all created modes, as a table of promises. When there's no mode yet, a mode is created, the 'onLanguage' notification is fired and then the promise is set to the table.
The text mate tokenizer listens the onLanguage mode and synchronously asks for the mode to add the tokenization support on. As the mode is not yet in the table, it will get a new one.
Now we have two modes active. In the case of Javascript, the first one has the old legacy tokenizer, and seems to be the one used in the editor.
This has likely a bigger impact than just a wrong tokenization. We think we need to fix this.
New javascript file, use the following code snippet:
var booleanRegex = /^true|false$/i;
var stringRegex = /^(['"]).*\1$/;
Notice the regex value does not get colored.
Regex coloring works for Typescript.
The text was updated successfully, but these errors were encountered: