Skip to content

Commit

Permalink
[C#] better handling of classes after a method outside a class
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-hall committed Oct 13, 2017
1 parent 7d35882 commit e29d674
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion C#/C#.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,10 @@ contexts:

code_block_in:
- match: (?=\S)
push: line_of_code
push:
- match: (?={{reserved}})
pop: true
- include: line_of_code

line_of_code:
# language keywords
Expand Down
12 changes: 12 additions & 0 deletions C#/tests/syntax_test_GeneralStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,3 +1166,15 @@ void Abc()
}
/// ^ - invalid.illegal.stray.brace
}

void Main () { // method outside a class, i.e. a LINQPad script
///^ storage.type
/// ^^^^ entity.name.function
}
/// <- punctuation.section.block.end

public class AfterTopLevelMethod {
///^^^ storage.modifier.access
/// ^^^^^ storage.type.class
/// ^^^^^^^^^^^^^^^^^^^ entity.name.class
}

0 comments on commit e29d674

Please sign in to comment.