Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript - regular expressions are not colored - Javascript mode instantiated twice #34

Closed
isidorn opened this issue Nov 17, 2015 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@isidorn
Copy link
Contributor

isidorn commented Nov 17, 2015

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.

@chrisdias chrisdias added the bug Issue identified by VS Code Team member as probable bug label Nov 17, 2015
@aeschli aeschli changed the title Javascript - regular expressions are not colored Javascript - regular expressions are not colored - Javascript mode instantiated twice Nov 17, 2015
@aeschli
Copy link
Contributor

aeschli commented 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.

@chrisdias chrisdias added this to the 0.10.1 milestone Nov 17, 2015
@joaomoreno
Copy link
Member

@aeschli isn't this fixed?

@isidorn
Copy link
Contributor Author

isidorn commented Nov 19, 2015

Yes this is fixed, I verfied

@isidorn isidorn closed this as completed Nov 19, 2015
@aeschli aeschli added the verified Verification succeeded label Dec 15, 2015
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants