Skip to content

Commit

Permalink
fix(syntax): tokenize attribute body correctly/ don't apply invoke ru…
Browse files Browse the repository at this point in the history
…le on it
  • Loading branch information
erik-lieben committed Oct 4, 2016
1 parent 3339728 commit 1d51470
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntaxes/html.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
}
},
"tag-aurelia-attribute-with-invoke-attribute": {
"match": "[^=](([a-zA-Z0-9:-]+)(\\.)(trigger|delegate|call))",
"match": "(?=\\s)[^=](([a-zA-Z0-9:-]+)(\\.)(trigger|delegate|call))",
"captures": {
"2": {
"name": "entity.other.attribute-name.html"
Expand Down
15 changes: 15 additions & 0 deletions test/syntax.html/invoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,19 @@ suite('The Aurelia HTML syntax invoke attributes', () => {

});

test('must not tokenize invokes in attribute body with scope "invoke.attribute.html.au"', () => {

// arrange
let scope = 'meta.tag.inline.any.html';

// act
let lineToken = tokenizeLine('<a b="draw.call:animate(data)">');

// assert
let token = getTokenOnCharRange(lineToken, 6, 29);
assert.equal(hasScope(token.scopes, scope), true);

});


});

0 comments on commit 1d51470

Please sign in to comment.