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

Add decorators support #186

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ notifications:
on_failure: change

script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh'

branches:
only:
- master
134 changes: 119 additions & 15 deletions grammars/javascript.cson
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,81 @@
}
]
}
{
<<<<<<< HEAD
'begin': '^\\s*(?=@\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*\\s*\\()'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.arguments.end.js'
'name': 'meta.function.decorator.js'
'patterns': [
{
'begin': '(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*\\s*\\()'
'beginCaptures':
'1':
'name': 'punctuation.definition.decorator.js'
'contentName': 'entity.name.function.decorator.js'
'end': '(?=\\s*\\()'
}
{
'begin': '(\\()'
'beginCaptures':
'1':
'name': 'punctuation.definition.arguments.begin.js'
'contentName': 'meta.function.decorator.arguments.js'
'end': '(?=\\))'
'patterns': [
{
'include': '#function-params'
}
{
'include': '#comments'
}
{
'include': '$self'
}
]
}
]
}
{
'begin': '^\\s*(?=@\\s*[A-Za-z_][A-Za-z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*)'
'contentName': 'entity.name.function.annotation.js'
'end': '(?=\\s|$\\n?|//)'
'name': 'meta.function.annotation.js'
'patterns': [
{
'begin': '(?=(@)\\s*[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)'
'beginCaptures':
'1':
'name': 'punctuation.definition.annotation.js'
'end': '(?=\\s|$\\n?|//)'
'patterns': [
{
'include': '#comments'
}
]
}
]
}
{
'begin': '\\b(constructor)\\s*(\\()'
'beginCaptures':
'1':
'name': 'entity.name.constructor.js'
'2':
'name': 'punctuation.definition.parameters.begin.js'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.parameters.end.js'
'patterns': [
{
'include': '#function-params'
}
]
}
{
'include': '#methods'
}
Expand Down Expand Up @@ -315,8 +390,7 @@
'name': 'support.function.js.console'
}
{
'match': '\\b((0(x|X)[0-9a-fA-F]+)|(0(b|B)[01]+)|(0(o|O)[0-7]+)|([0-9]+(\\.[0-9]+)?)((e|E)[+-]?[0-9]+)?)\\b'
'name': 'constant.numeric.js'
'include': '#numbers'
}
{
'include': '#strings'
Expand Down Expand Up @@ -363,14 +437,16 @@
'name': 'storage.modifier.js'
}
{
'begin': '(?<!\\.)\\b(const)(?!\\s*:)\\b\\s+'
'begin': '(?<!\\.)\\b(const)(?!\\s*:)\\b'
'beginCaptures':
'1':
'name': 'storage.modifier.js'
'end': '(=)'
'end': '(=|of|in)|(;)|(?<!,)\\n'
'endCaptures':
'1':
'name': 'keyword.operator.js'
'2':
'name': 'punctuation.terminator.statement.js'
'patterns': [
{
'match': '([$_a-zA-Z][$_a-zA-Z0-9]*)\\s*(:)\\s*([$_a-zA-Z][$_a-zA-Z0-9]*)?'
Expand All @@ -394,6 +470,10 @@
'match': ','
'name': 'meta.delimiter.object.comma.js'
}
{
'match': '\\(|\\)'
'name': 'meta.brace.round.js'
}
{
'match': '\\{|\\}'
'name': 'meta.brace.curly.js'
Expand All @@ -402,9 +482,6 @@
'match': '\\[|\\]'
'name': 'meta.brace.square.js'
}
{
'match': '\\s+'
}
]
}
{
Expand Down Expand Up @@ -552,6 +629,13 @@
}
]
'repository':
'numbers':
'patterns': [
{
'match': '(\\+|\\-)?\\b((0(x|X)[0-9a-fA-F]+)|(0(b|B)[01]+)|(0(o|O)[0-7]+)|([0-9]+(\\.[0-9]+)?)((e|E)[+-]?[0-9]+)?)\\b'
'name': 'constant.numeric.js'
}
]
'strings':
'patterns': [
{
Expand Down Expand Up @@ -640,18 +724,38 @@
'function-params':
'patterns': [
{
'begin': '(?=[\\p{L}\\p{Nl}$_])'
'end': '(?=[,)\\/])'
'patterns': [
{
'match': '\\G[\\p{L}\\p{Nl}$_][\\p{L}\\p{Nl}$\\p{Mn}\\p{Mc}\\p{Nd}\\p{Pc}\\x{200C}\\x{200D}]*'
'name': 'variable.parameter.function.js'
}
]
'include': '#numbers'
}
{
'include': '#strings'
}
{
'match': '\\(|\\)'
'name': 'meta.brace.round.js'
}
{
'match': '\\[|\\]'
'name': 'meta.brace.square.js'
}
{
'match': '\\{|\\}'
'name': 'meta.brace.curly.js'
}
{
'match': ','
'name': 'meta.object.delimiter.js'
}
{
'match': '='
'name': 'keyword.operator.js'
}
{
'include': '#comments'
}
{
'match': '[a-zA-Z_$][a-zA-Z_$0-9]*'
'name': 'variable.parameter.function.js'
}
]
'interpolated_js':
'patterns': [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "language-javascript",
"version": "0.84.0",
"version": "0.86.0",
"description": "JavaScript language support in Atom",
"engines": {
"atom": "*",
Expand Down
Loading