Closed pouyakary closed 5 years ago
Thanks @pmkary - let me know if I'm misunderstanding but this seems like it's not a problem anymore? This is what I see in 1.34.0 on macOS 10.12.6:
Did you check if you have Tree-sitter enabled at Settings > Core > Use Tree Sitter Parsers
?
Hi Robert! Thanks a lot for checking it out.
To be honest I have no idea about the grammar in Atom. VS Code directly uses this package to handle Go and since it was broken there I had to fix it here.
It’s awesome that Atom can handle the definitions without the spacing in the grammar but I added this small change to have vscode work right (and probably any other TextMate-like editor).
Ahh ok - just to share some context, for languages like Go where we do have a Tree-sitter grammar, we've migrated from our old first-mate grammar engine to the new Tree-sitter engine. This enables a number of new features, more consistent syntax highlighting, and better performance, among other benefits.
But 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.
I believe in some cases, the VS Code folks have their own fork for certain languages but you would have to check with them if that's the case for Go.
The grammar used to highlight function declaration syntax is designed to support only formatted code, which works great:
But for people who may prefer custom coding style or for when they're only typing not well formatted code the declaration syntax is not working because the optional white spacing is forgotten between function name and left parentheses as such:
This PR adds a tiny
\s*
in between of function name and the ending lookahead phrase to make sure all codes render right