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

[feature] Add support for 'Service/Method' to support LSP #83

Open
tristan957 opened this issue Jul 30, 2020 · 2 comments
Open

[feature] Add support for 'Service/Method' to support LSP #83

tristan957 opened this issue Jul 30, 2020 · 2 comments

Comments

@tristan957
Copy link

A clear and concise description of what the problem is - e.g. "I'm always frustrated when [...]"

LSP has methods like textDocument/XXX. Gorilla RPC currently only supports textDocument.XXX. You can't implement a language server using Go and this package

What would the feature look like? How would it work? How would it change the API?

Some way to register a func for translating the service and method name to various formats or maybe registering a format string of some sort.

@tristan957
Copy link
Author

tristan957 commented Jul 30, 2020

rpc.NewServerWithMethodFormatter(func(service string, method string) string {
  return fmt.Sprintf("%s/%s", strings.Lower(service), strings.Lower(method)
})

@eshikafe
Copy link

It will be great to extend this enhancement to support the PAWS protocol method format spectrum.paws.methodName

I currently get the following errors:

"jsonrpc": "2.0",
"error": {
        "code": -32000,
        "message": "rpc: service/method request ill-formed: \"spectrum.paws.init\"",
        "data": null
    },

spectrum.paws should be allowed as a service name as shown below:

s := rpc.NewServer()
s.RegisterCodec(json2.NewCodec(), "application/json")
s.RegisterService(new(SpectrumPaws), "spectrum.paws")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants