Comments (12)
It seems like a built-in function to me: http://golang.org/pkg/builtin/#close
from language-go.
Oh totally forgot about that! I was fooled by the fact that you can create a variable named close
and it is perfectly ok!
Closing this, as expecting the syntax highlighter to differentiate between a built-in function vs a variable with the name of a built in function is asking a bit too much!
from language-go.
I don't think it is asking too much to expect that to be differentiated. In one, there is no (
as a suffix; in the other there is a (
. Grammars are driven by regular expressions, and this distinction can be made.
from language-go.
I didn't inspect the code and I don't know how advanced it is but below is also another consideration if then:
var (
fn = func() { close(...) }
)
from language-go.
I would suggest reopening this issue.
from language-go.
Ok re-opening this and leaving it up to the project owners to decide.
from language-go.
This should be fixed by my latest commit in pull request #34, if it is merged.
It also marks these builtin functions' args as data types (just like what Emacs does)!
from language-go.
Yup... Looks as solved to me as well...
from language-go.
Didn't solve my specific case (see below) but still a good improvement.
from language-go.
Check... Personally I do wonder if this is actually something that you would want. Syntactically your right, but if it will improve readability...?
Next to that it's of course a better practice to _not_ make shadow variables over built-in names/types/functions
from language-go.
Ok gave this a second thought and a fix for this would actually decrease the readability. Otherwise it would be necessary to use a 3rd color to indicate shadowed variables to be spot on with what's going on.
Leaving it up to maintainers to close this as they like. I would consider this solved now.
from language-go.
This is fixed in PR #58 and released in v0.36.0
from language-go.
Related Issues (20)
- Differentiate between methods and functions
- Go not highlighted with tree-sitter
- Package variables and types missing syntax highlights HOT 1
- Language-go package seems to not work HOT 2
- Cannot fold up the "case" statement
- Cannot fold up a continuous comment-out code HOT 4
- Import scope is gone HOT 2
- Wrong highlighting for function parameters HOT 2
- Enhancement: Highlight *.gotpl files HOT 1
- In TextMate grammar, string in map declaration is incorrectly scoped HOT 1
- No autocomplete for certain langauge keywords like `return` or `break` etc HOT 1
- Feature request: add scope to all types, not just builtins HOT 3
- Go constants with omitted assignment are not syntax highlighted correctly with TextMate grammar HOT 1
- Support syntax highlighting for changes to number literals introduced in Go 1.13 HOT 2
- Scope of names, types of declarations inconsistent HOT 1
- Adding more common go package snippets HOT 2
- <unknown> is deprecated.
- Question regarding "HTML (Go)" highlighting
- Failed to load a language-go package grammar
- Not possible to fold case within switch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-go.