Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Don't optionally match trailing newlines in comments #101

Merged
merged 2 commits into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions grammars/c#.cson
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,10 @@ repository:
patterns: [
{
begin: "///"
captures:
beginCaptures:
"0":
name: "punctuation.definition.comment.cs"
end: "$\\n?"
end: "$"
name: "comment.block.documentation.cs"
patterns: [
{
Expand All @@ -549,18 +549,21 @@ repository:
}
{
begin: "/\\*"
captures:
beginCaptures:
"0":
name: "punctuation.definition.comment.cs"
end: "\\*/"
endCaptures:
"0":
name: "punctuation.definition.comment.cs"
name: "comment.block.cs"
}
{
begin: "//"
captures:
beginCaptures:
"1":
name: "punctuation.definition.comment.cs"
end: "$\\n?"
end: "$"
name: "comment.line.double-slash.cs"
}
]
Expand Down
6 changes: 3 additions & 3 deletions spec/grammar-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ describe "Language C# package", ->
else
expect(token[0].value).toBe(directive)

expect(token[token.length - 3].value).toBe('//')
expect(token[token.length - 3].scopes).toContain('comment.line.double-slash.cs')
expect(token[token.length - 2].value).toBe(' A line comment')
expect(token[token.length - 2].value).toBe('//')
expect(token[token.length - 2].scopes).toContain('comment.line.double-slash.cs')
expect(token[token.length - 1].value).toBe(' A line comment')
expect(token[token.length - 1].scopes).toContain('comment.line.double-slash.cs')

describe "C# Script grammar", ->
it "parses the grammar", ->
Expand Down