Skip to content

Commit b2d3c08

Browse files
committed
Fix #{} snippet scopes
Fixes #241
1 parent 38697ca commit b2d3c08

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

CoffeeScript.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ contexts:
439439
4: constant.language.flags.coffee
440440

441441
heredoc-pattern-body:
442-
- meta_scope: meta.string.regexp.coffee
442+
- meta_scope: meta.string.heredoc.coffee
443443
- meta_content_scope: string.regexp.coffee
444444
- match: (/{3})([imgy]{0,4})
445445
captures:

Snippets/Interpolated Code.tmSnippet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<key>name</key>
1010
<string>Interpolated Code</string>
1111
<key>scope</key>
12-
<string>(string.quoted.double.coffee) - string source, (string.quoted.double.heredoc.coffee) - string source</string>
12+
<string>
13+
source.coffee meta.string string.quoted.double,
14+
source.coffee meta.string.heredoc string.regexp
15+
</string>
1316
<key>tabTrigger</key>
1417
<string>#</string>
1518
</dict>

tests/syntax_test_scope.coffee

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,16 @@ class App.Router extends Snakeskin.Router
491491
///
492492
# <- - meta.string
493493
#^ - meta.string
494-
# ^^^ meta.string.regexp.coffee punctuation.definition.string.begin.coffee
495-
# ^ meta.string.regexp.coffee string.regexp.coffee
494+
# ^^^ meta.string.heredoc.coffee punctuation.definition.string.begin.coffee
495+
# ^ meta.string.heredoc.coffee string.regexp.coffee
496496
\. #{var}
497-
#^^^^^^^^^^^ meta.string.regexp.coffee
497+
#^^^^^^^^^^^ meta.string.heredoc.coffee
498498
# ^^ string.regexp.coffee constant.character.escape.coffee
499499
# ^^^^^^ meta.embedded.coffee source.coffee.embedded.source
500500
///
501-
# <- meta.string.regexp.coffee string.regexp.coffee
502-
#^ meta.string.regexp.coffee string.regexp.coffee
503-
# ^^^ meta.string.regexp.coffee punctuation.definition.string.end.coffee
501+
# <- meta.string.heredoc.coffee string.regexp.coffee
502+
#^ meta.string.heredoc.coffee string.regexp.coffee
503+
# ^^^ meta.string.heredoc.coffee punctuation.definition.string.end.coffee
504504

505505
/[0-9]bar/img
506506
# ^^^^^^^^^^^^^ meta.string.regexp.coffee

0 commit comments

Comments
 (0)