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

LSP completions violate spec #1868

Open
1 task done
krobelus opened this issue Dec 12, 2024 · 2 comments
Open
1 task done

LSP completions violate spec #1868

krobelus opened this issue Dec 12, 2024 · 2 comments

Comments

@krobelus
Copy link

What happened, and what did you expect to happen?

LSP completions include this, which violates the spec because kind should be either "plaintext" or "markdown".

      "documentation": {
        "kind": "",
        "value": ""
      },

documentation is an optional markupContent

go-lsp package defines it as

	// A human-readable string that represents a doc-comment.
	Documentation MarkupContent `json:"documentation,omitempty"`

omitempty is useless. To fix this, we could change it to Documentation *MarkupContent.

Opening this issue here because it seems like https://github.com/nimblebun/go-lsp is not active.
Maybe we should switch to a different library?

Output of "elvish -version"

0.21.0

Code of Conduct

@xiaq
Copy link
Member

xiaq commented Dec 16, 2024

That's right, we should switch to a more actively maintained LSP type package. Any suggestions?

@xiaq xiaq moved this from ❓Triage to 🧭Recon in All Elvish issues Dec 16, 2024
@krobelus
Copy link
Author

I'm not super well informed but I'd probably start with autogenerated message buffers like what gopls uses.
Regarding the issue at hand, they define it as pointer, so the zero value will be serialized correctly

{
    Documentation *Or_CompletionItem_documentation `json:"documentation,omitempty"`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🧭Recon
Development

No branches or pull requests

2 participants