Skip to content

Commit

Permalink
Improve TODO detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ephread committed May 11, 2020
1 parent ff1a755 commit 38c3857
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions grammars/Ink.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ repository:
- include: '#logic'
- include: '#choice'
- include: '#glue'
- include: '#todo'
- include: '#interpolevaluablock'
- include: '#comment'

Expand All @@ -622,6 +623,7 @@ repository:
- include: '#logic'
- include: '#choice'
- include: '#glue'
- include: '#todo'
- include: '#interpolevaluablock'
- include: '#comment'

Expand Down
8 changes: 8 additions & 0 deletions grammars/Ink.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,10 @@
<key>include</key>
<string>#glue</string>
</dict>
<dict>
<key>include</key>
<string>#todo</string>
</dict>
<dict>
<key>include</key>
<string>#interpolevaluablock</string>
Expand Down Expand Up @@ -1701,6 +1705,10 @@
<key>include</key>
<string>#glue</string>
</dict>
<dict>
<key>include</key>
<string>#todo</string>
</dict>
<dict>
<key>include</key>
<string>#interpolevaluablock</string>
Expand Down
82 changes: 82 additions & 0 deletions tests/cases/extra/todo.ink
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// SYNTAX TEST "source.ink"

TODO: Lorem ipsum
//<---- comment.line.ink entity.todo.ink constant.other entity.todo.begin.ink
// ^^^^^^^^^^^^^ comment.line.ink entity.todo.ink

=== knot ===
//<--- storage.knot.ink punctuation.definition.generic.begin.ink storage.type.ink
// ^ source.ink
// ^^^^ entity.name.function.ink
// ^ source.ink
// ^^^ storage.knot.ink punctuation.definition.generic.end.ink storage.type.ink
= stitch
//<- storage.knot.ink punctuation.definition.generic.begin.ink storage.type.ink
//<~- source.ink
//^^^^^^ entity.name.function.ink
{
//<---- source.ink
// ^ keyword.control.ink
- (variable != 4):
//<-------- source.ink
// ^ keyword.control.ink
// ^ source.ink
// ^^^^^^^^^^^^^^^ keyword.control.ink
// ^ keyword.control.ink
TODO: Lorem ipsum
//<------------ comment.line.ink entity.todo.ink
// ^^^^ comment.line.ink entity.todo.ink constant.other entity.todo.begin.ink
// ^^^^^^^^^^^^^ comment.line.ink entity.todo.ink
Text
//<------------ source.ink
}
//<---- source.ink
// ^ keyword.control.ink

{condition:
//<---- source.ink
// ^ keyword.control.ink
// ^^^^^^^^^^ keyword.control.ink
TODO: Lorem ipsum
//<-------- comment.line.ink entity.todo.ink
// ^^^^ comment.line.ink entity.todo.ink constant.other entity.todo.begin.ink
// ^^^^^^^^^^^^^ comment.line.ink entity.todo.ink
Text
//<-------- source.ink
}
//<---- source.ink
// ^ keyword.control.ink

TODO: Lorem ipsum
//<---- comment.line.ink entity.todo.ink constant.other entity.todo.begin.ink
// ^^^^^^^^^^^^^ comment.line.ink entity.todo.ink

* (label) {condition} [Hello] Choice
//<- keyword.choice.ink keyword.operator.arithmetic.ink
//<~- source.ink
//^ string.label.ink entity.name.label.ink string.quoted.other.ink punctuation.definition.string.label.begin.ink punctuation.definition.string.begin.ink
// ^^^^^ string.label.ink entity.name.label.ink string.quoted.other.ink
// ^ string.label.ink entity.name.label.ink string.quoted.other.ink punctuation.definition.string.label.begin.ink punctuation.definition.string.begin.ink
// ^ source.ink
// ^ keyword.control.ink
// ^^^^^^^^^ keyword.control.ink
// ^ keyword.control.ink
// ^ source.ink
// ^ keyword.choice.suppression.ink keyword.control.ink
// ^^^^^ source.ink
// ^ keyword.choice.suppression.ink keyword.control.ink
// ^^^^^^^ source.ink
TODO: Lorem ipsum
//<---- comment.line.ink entity.todo.ink constant.other entity.todo.begin.ink
// ^^^^^^^^^^^^^ comment.line.ink entity.todo.ink
-> the_end
//<-- keyword.divert.ink keyword.other.ink
//^ source.ink
// ^^^^^^^ variable.other.knot.ink entity.name.variable.other.knot.ink

/*
//<-- comment.block.ink punctuation.definition.comment.ink
TODO: Lorem ipsum
//<--------------------- comment.block.ink
*/
//<-- comment.block.ink punctuation.definition.comment.ink

0 comments on commit 38c3857

Please sign in to comment.