Comments (5)
Hi! Could you clarify what you mean by 'a method from an interface'? Do you mean calling a method on an interface type, or calling a method on a type that happens to conform to some interface?
In either case, this would require type information, which isn't something Vim syntax definitions have - they're purely lexical, so highlighting is based only on the text in the file.
from vim-go-syntax.
Do you mean calling a method on an interface type, or calling a method on a type that happens to conform to some interface?
Both would be great.
this would require type information
Is it possible to integrate with vim-go, gopls?
from vim-go-syntax.
The first one (calling a method on an interface type) would require a lot of effort - even under the assumption you can get that information about a particular function call at a given location, it would still require using something like Vim's text properties to overlay custom syntax colours, which would likely result in odd highlighting artefacts when changing neighbouring code.
Now that I think about it, the second probably isn't feasible in any tolerable fashion (calling a method on a type that happens to conform to some interface) - it would require searching all available interfaces to see if one matched the call signature, which would be extremely slow even on a fast computer, and it would need to run every time the code was changed.
Overall, I don't think either of these justify the effort required to implement them, not to mention the fact that it would be special-case code that is completely separate from the rest of the syntax highlighting.
from vim-go-syntax.
it would require searching all available interfaces to see if one matched the call signature
Just saying, vim-go can do that.
from vim-go-syntax.
I hadn't used the GoImplements
command before - that's cool. It's not enough by itself to do what you're asking, unfortunately.
from vim-go-syntax.
Related Issues (11)
- Thanks! HOT 1
- Fix Godoc method highlighting
- Fix comments in function/method arguments
- syntax is cleared when switching colorscheme. HOT 1
- Was 'goto' deliberately omitted? HOT 1
- Handle expressions in Array type syntax
- Fix commas in multiline comma-separated field names
- Fix Struct and Interface Syntax Issues
- Add syntax highlighting for `go.work` files
- Validate `if exists("main_syntax")` is correct
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 vim-go-syntax.