Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

@MaximSokolov
Copy link
Contributor

Continuation of #295

Fixes #294
Fixes #320
Replaces and closes #295

'2':
'name': 'support.function.js.console'
# console.log(arg1, "arg2", [...])
'begin': '\\bconsole'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we have consolea.log()?

'name': 'support.function.dom.js'
}
{
'match': ".+"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems dangerous...we should make sure the function name is valid.

'end': '(?!\\G)'
'patterns': [
{
'begin': '\\b(\\.)(assert|clear|debug|error|info|log|profile|profileEnd|time|timeEnd|warn)\\s*(?=\\()'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\\s*(\\.)\\s*
Have to test for spaces here as well. I don't think we need the \\b anymore if we test for spaces.

@winstliu
Copy link
Contributor

winstliu commented Feb 6, 2016

Overall looks pretty good. Left a few small comments.

@winstliu
Copy link
Contributor

winstliu commented Feb 6, 2016

Also, it would be great if we could tokenize this properly:

console
.
log(); // <-- meta.function-call, no support.function.console.js

or

console.
log();

etc. Not just limited to console, for example:

something
.
hi();

@winstliu
Copy link
Contributor

winstliu commented Feb 7, 2016

@MaximSokolov Is this ready for merge? It looks good to me.

@MaximSokolov
Copy link
Contributor Author

🚢

winstliu pushed a commit that referenced this pull request Feb 7, 2016
Fix function/method calls being superseded
@winstliu winstliu merged commit d7f5332 into atom:master Feb 7, 2016
@MaximSokolov MaximSokolov deleted the patch-1 branch February 8, 2016 15:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ES6] Syntax highlight error Function-call highlights being superceded

3 participants