atom / language-go

Go language package for Atom
Other
106 stars 65 forks source link

Go constants with omitted assignment are not syntax highlighted correctly with TextMate grammar #173

Closed alexr00 closed 5 years ago

alexr00 commented 5 years ago

Originally from @segevfiner in https://github.com/microsoft/vscode/issues/76073

Sample code:

package foo

const (
    Value1 = iota
    Value2
    Value3
    Value4
)

Value1 gets scope variable.other.assignment.go, and the other values just get source.go. I think that Value1 shouldn't have a different scope here.

rsese commented 5 years ago

Thanks for the report! Looks like this isn't an issue with Tree-sitter (1.40.0-nightly15 on macOS 10.12.6):

Value1 gets scope variable.other.assignment.go, and the other values just get source.go. I think that Value1 shouldn't have a different scope here.

With the cursor on Value1:

go-scopes

So we'll go ahead and close, but let me know if I'm misunderstanding :v:


As you may have heard, we are migrating from our old first-mate grammar engine to the new Tree-sitter engine. This will enable a number of new features, more consistent syntax highlighting, and better performance, among other benefits. In order to free up our limited resources, we have decided to stop maintaining the first-mate grammar when there is a built-in Tree-sitter grammar available. Since this issue applies only to the first-mate grammar, we are going to close it. Please let us know if we have misunderstood the description of the problem.