Skip to content

Commit

Permalink
Revert "[Go] Tweak annotation scope boundaries"
Browse files Browse the repository at this point in the history
This reverts commit c41f4ea.
  • Loading branch information
deathaxe committed Mar 6, 2022
1 parent 4497474 commit ea18a42
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Go/Go.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ contexts:
# highlighting them as compiler pragmas could be misleading. We scope them
# as plain comments by default, and add some detailed meta scopes for
# enterprising users wishing to add more color.
- match: (//)([a-z]+[a-z-]*)(:)({{directive}})
- match: (//)([a-z]+[a-z-]*)(:)({{directive}})[ ]?
scope: meta.annotation.go
captures:
1: punctuation.definition.comment.go
Expand All @@ -145,15 +145,15 @@ contexts:
# position for the character immediately following the comment as
# having come from the specified file, line and column. Both single
# line and block comment line directives are valid.
- match: ((//)(line))( [a-zA-Z0-9. :]*(?::[0-9]+){1,2})$\n?
- match: ((//)(line) )([a-zA-Z0-9. :]*(?::[0-9]+){1,2})$\n?
scope: comment.line.go
captures:
1: meta.annotation.go
2: punctuation.definition.comment.go
3: meta.variable.function.go
4: meta.annotation.parameters.go

- match: ((/\*)(line))( [a-zA-Z0-9. :]*(?::[0-9]+){1,2})(\*/)
- match: ((/\*)(line) )([a-zA-Z0-9. :]*(?::[0-9]+){1,2})(\*/)
scope: comment.block.go
captures:
1: meta.annotation.go
Expand All @@ -163,7 +163,7 @@ contexts:
5: meta.annotation.go punctuation.definition.comment.end.go

# Finally, Cgo and gccgo have directives for exporting functions to C.
- match: ((//)(export|extern))( {{ident}})$\n?
- match: ((//)(export|extern) )({{ident}})$\n?
scope: comment.line.go
captures:
1: meta.annotation.go
Expand Down
48 changes: 24 additions & 24 deletions Go/syntax_test_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,86 +66,86 @@ You may have to disable Go-specific linters when working on this file.
//go:generate one two three
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^ meta.keyword.annotation.go
// ^^^^^^^^ meta.variable.function.go
// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//go-sumtype:decl MySumType
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^^^^ meta.keyword.annotation.go
// ^^^^ meta.variable.function.go
// ^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//lint:ignore U1000 Reason.
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^ meta.keyword.annotation.go
// ^^^^^^ meta.variable.function.go
// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//lint:file-ignore Reason.
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^ meta.keyword.annotation.go
// ^^^^^^^^^^^ meta.variable.function.go
// ^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//line :10
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^ comment.line.go meta.annotation.go
// ^^^^ meta.variable.function.go
// ^^^^ comment.line.go meta.annotation.parameters.go
// ^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//line file.rl:10
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^ comment.line.go meta.annotation.go
// ^^^^ meta.variable.function.go
// ^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//line file.rl:100:10
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^ comment.line.go meta.annotation.go
// ^^^^ meta.variable.function.go
// ^^^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

/*line :10*/
// ^ -comment
// ^^^^^^ comment.block.go meta.annotation.go
// ^^^^^^^ comment.block.go meta.annotation.go
// ^^^^ meta.variable.function.go
// ^^^^ comment.block.go meta.annotation.parameters.go
// ^^^ comment.block.go meta.annotation.parameters.go
// ^^ comment.block.go punctuation.definition.comment.end.go
// ^ -comment.block.go -meta.annotation

/*line file.rl:10*/
// ^ -comment
// ^^^^^^ comment.block.go meta.annotation.go
// ^^^^^^^ comment.block.go meta.annotation.go
// ^^ punctuation.definition.comment.begin.go
// ^^^^ meta.variable.function.go
// ^^^^^^^^^^^ comment.block.go meta.annotation.parameters.go
// ^^^^^^^^^^ comment.block.go meta.annotation.parameters.go
// ^^ comment.block.go punctuation.definition.comment.end.go
// ^ -comment.block.go -meta.annotation

/*line file.rl:100:10*/
// ^ -comment
// ^^^^^^ comment.block.go meta.annotation.go
// ^^^^^^^ comment.block.go meta.annotation.go
// ^^ punctuation.definition.comment.begin.go
// ^^^^ meta.variable.function.go
// ^^^^^^^^^^^^^^^ comment.block.go meta.annotation.parameters.go
// ^^^^^^^^^^^^^^ comment.block.go meta.annotation.parameters.go
// ^^ comment.block.go punctuation.definition.comment.end.go
// ^ -comment.block.go -meta.annotation

Expand All @@ -169,15 +169,15 @@ You may have to disable Go-specific linters when working on this file.
//export myfunc
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation

//extern myfunc
// ^ -comment -meta -punctuation
// ^^ punctuation.definition.comment.go
// ^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^^ comment.line.go meta.annotation.parameters.go
// ^^^^^^^^^ comment.line.go meta.annotation.go
// ^^^^^^ comment.line.go meta.annotation.parameters.go
// ^ comment.line.go -meta.annotation


Expand Down

0 comments on commit ea18a42

Please sign in to comment.