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

Context dependent code completion #206

Closed
gorkem opened this issue Nov 27, 2019 · 3 comments
Closed

Context dependent code completion #206

gorkem opened this issue Nov 27, 2019 · 3 comments

Comments

@gorkem
Copy link
Collaborator

gorkem commented Nov 27, 2019

It should be possible to pass code completion options that are dependent on the context. 3rd party extensions should be able to pass the possible values for a field by checking the current context. For instance a kubernetes extension should be able to set the possible values for a field by checking the currently connected cluster.

One way to implement this is to modify the in-memory Schema that is currently active. I think this can be enough for most cases but the rare quick changing environments.

@angelozerr
Copy link

angelozerr commented Nov 27, 2019

@gorkem , did you mean a completionParticipant feature? If it that I think it's the same issue than #190 and I'm very glad that you need that .

I think YAML Language Server should do that for other features like hover, rename, diagnostics etc (like LSP4XML provides that).

It's out of scope but *Participant will give the capability to communicate with other language server (ex: YAML language server will able to call Spring Tools LS, Quarkus LS in completion and it's the reason why I created the issue Handle communication between 2 language servers -> language client registry ( I would like so to convince guys like @tsmaeder with this idea :))

If you are interested with this topic, please see the investigation with LSP4XML with @martinlippert in the issue eclipse/lemminx#596

@gorkem
Copy link
Collaborator Author

gorkem commented Dec 15, 2019

@angelozerr A completionParticipant is one way but I think for the YAML LSP modifying the effective schema via APIs may prove to be a more efficient solution. Schema controls completion, hover, validation etc. so it is single API to solve all those requirements.

@JPinkney
Copy link
Contributor

This is now available as of the 0.7.0 series releases.

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

No branches or pull requests

3 participants