Skip to content

Commit f7d1772

Browse files
committed
Fix truncated completions
Fixes #251 Remove capture groups and scope assignments from lookaheads.
1 parent 30de4e6 commit f7d1772

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

CoffeeScript.sublime-syntax

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,12 @@ contexts:
108108
- include: numeric
109109
- match: |-
110110
(?x)
111-
(\s*)
112-
(?=[a-zA-Z\$_@])
113-
(
114-
[a-zA-Z\$_@](\w|\$|:|\.)*\s*
115-
(?=[:=]( (\s*.\( ($)) | (\s*\(.*\) )?\s*([=-]>)))
116-
)
111+
\s*
112+
( [a-zA-Z\$_@] [\w\$:.]* ) \s*
113+
(?=[:=](?: \s*.\( $ | (?: \s*\(.*\) )? \s* [=-]> ) )
117114
scope: meta.function.coffee
118115
captures:
119-
2: entity.name.function.coffee
120-
3: entity.name.function.coffee
121-
4: variable.parameter.function.coffee
122-
5: storage.type.function.coffee
116+
1: entity.name.function.coffee
123117
- match: '^\s*(describe|it|app\.(get|post|put|all|del|delete))[^\w]'
124118
comment: Show well-known functions from Express and Mocha in Go To Symbol view
125119
push:

tests/syntax_test_scope.coffee

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SYNTAX TEST "CoffeeScript.sublime-syntax"
2+
3+
class App.Router extends Snakeskin.Router
4+
# <- meta.class.coffee storage.type.class.coffee
5+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.coffee
6+
#^^^^ storage.type.class.coffee
7+
# ^^^^^^^^^^ entity.name.type.class.coffee
8+
# ^^^^^^^ keyword.control.inheritance.coffee
9+
# ^^^^^^^^^^^^^^^^ entity.other.inherited-class.coffee
10+
11+
index: () =>
12+
# <- meta.function.coffee
13+
#^^^^^^ meta.function.coffee
14+
# ^^^^^ entity.name.function.coffee - entity entity
15+
# ^ keyword.operator.coffee
16+
# ^^^^^ meta.inline.function.coffee
17+
# ^^ variable.parameter.function.coffee
18+
# ^^ storage.type.function.coffee
19+
"Hello"
20+
# ^^^^^^^ meta.string.coffee string.quoted.double.coffee

0 commit comments

Comments
 (0)