Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About HandleFunction #75

Closed
glepnir opened this issue Jun 21, 2020 · 3 comments
Closed

About HandleFunction #75

glepnir opened this issue Jun 21, 2020 · 3 comments

Comments

@glepnir
Copy link
Member

glepnir commented Jun 21, 2020

I found HandleFunciton needs two args options and fn interface{}, the sceond arg is a interface type. so i define a function return a string send functionname as arg to it.got error.
but change the return value to (string,error) then it works...

error:
func repoName() string {
	return repo.GetWorkPath()
}
right:
func repoName() (string,error) {
	return repo.GetWorkPath(),nil
}
p.HandleFunction(&plugin.FunctionOptions{Name: "GetRepoName"}, repoName)
@WhoIsSethDaniel
Copy link
Contributor

Hello @zchee and @glepnir . I have created a repo https://github.com/WhoIsSethDaniel/nvim-go-client-examples that attempts to have many examples of how to use the Neovim go-client, along with documentation. I anticipate updating it more over time as I become more familiar with the client.
For anyone involved with the neovim go-client feel free to link to this repo, if you want to.
Thank you.

@zchee
Copy link
Member

zchee commented Oct 28, 2020

@WhoIsSethDaniel thanks for share! also, your repository very helpful.
We would be better to your repository link to neovim/go-client README :)

And yeah, go-client has lot of API, also usage is tricky a bit.
e.g., Subscribe and Unsubscribe own event. I know this usage so can write code(actually, I wrote some code with that APIs) but still don't understand all.
contributing go-client example to your repository separately is make sense. because Go's ExampleXXX document has limited.

Anyway, thanks for write some examples!

@glepnir
Copy link
Member Author

glepnir commented Oct 28, 2020

To be honest, I recently used lua to write neovim things, and participated in maintaining neovim's built-in lsp, it is very simple and powerful. I will read your example carefully when I have time, because I am a gopher and neovim also lacks some plugins written in go. Thanks for your work. 😄

@glepnir glepnir closed this as completed Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants