Skip to content

Commit

Permalink
Opt-in to syntax version 2
Browse files Browse the repository at this point in the history
Opt-in to current syntax engine features.

Resolves some overlapping meta scopes and duplicated source.jsx in backtick
quoted strings.
  • Loading branch information
deathaxe committed Aug 26, 2024
1 parent fd7f94c commit ef73b9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CoffeeScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# CoffeeScript Syntax: version 1
name: CoffeeScript
scope: source.coffee
version: 2

file_extensions:
- coffee
Expand Down
15 changes: 13 additions & 2 deletions tests/syntax_test_scope.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -65,64 +65,74 @@ class App.Router extends Snakeskin.Router
# ^^^^^ - meta.function - entity.name.function

name: ->
# ^^^^^^^^ - meta.function meta.function
# ^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

@name: ->
# ^^^^^^^^^ - meta.function meta.function
# ^^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

namespace.name: ->
# ^^^^^^^^^^^^^^^^^^ - meta.function meta.function
# ^^^^^^^^^^^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

name = =>
# ^^^^^^^^^ - meta.function meta.function
# ^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^ meta.function.identifier.coffee - entity
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

namespace.name = =>
# ^^^^^^^^^^^^^^^^^^^ - meta.function meta.function
# ^^^^^^^^^^^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^ meta.function.identifier.coffee - entity
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

name: =>
# ^^^^^^^^ - meta.function meta.function
# ^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

namespace.name: =>
# ^^^^^^^^^^^^^^^^^^ - meta.function meta.function
# ^^^^^^^^^^^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

name = =>
# ^^^^^^^^^ - meta.function meta.function
# ^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^ meta.function.identifier.coffee - entity
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

namespace.name = =>
# ^^^^^^^^^^^^^^^^^^^ - meta.function meta.function
# ^^^^^^^^^^^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^ meta.function.identifier.coffee - entity
# ^^^^ meta.function.coffee
# ^ keyword.operator.assignment.coffee
# ^^ keyword.declaration.function.coffee

name: () ->
# ^^^^^^^^^^^ - meta.function meta.function
# ^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^ meta.function.coffee
# ^^ meta.function.parameters.coffee
Expand All @@ -133,6 +143,7 @@ class App.Router extends Snakeskin.Router
# ^^ keyword.declaration.function.coffee

name: (foo, bar = undefined, baz="buuz", ...) ->
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.function meta.function
# ^^^^ meta.function.identifier.coffee entity.name.function.coffee
# ^^ meta.function.coffee
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters.coffee
Expand Down Expand Up @@ -492,10 +503,10 @@ class App.Router extends Snakeskin.Router
# ^ meta.string.coffee string.quoted.script.coffee punctuation.definition.string.begin.coffee
# ^ meta.string.coffee meta.embedded.coffee source.jsx.embedded.coffee - string
var i = 0;
# ^^^^^^^^^^^ meta.string.coffee meta.embedded.coffee source.jsx.embedded.coffee
# ^^^^^^^^^^^ meta.string.coffee meta.embedded.coffee source.jsx.embedded.coffee - source.jsx source.jsx
# ^^^ keyword.declaration
return (<h1>Hello {World}</h1>)
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.coffee meta.embedded.coffee source.jsx.embedded.coffee
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.coffee meta.embedded.coffee source.jsx.embedded.coffee - source.jsx source.jsx
# ^^^^^^^^^^^^^^^^^^^^^^ meta.group.js meta.jsx.js
# ^^^^ meta.tag
# ^^^^^ meta.tag
Expand Down

0 comments on commit ef73b9d

Please sign in to comment.