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

Add Code Completion for object properties #1199

Closed
HiramTheHero opened this issue Jan 2, 2023 · 4 comments
Closed

Add Code Completion for object properties #1199

HiramTheHero opened this issue Jan 2, 2023 · 4 comments

Comments

@HiramTheHero
Copy link

HiramTheHero commented Jan 2, 2023

In the following example:

julia> using RDatasets;

julia> iris = RDatasets.dataset("datasets","iris");

julia> propertynames(iris)
5-element Vector{Symbol}:
 :SepalLength
 :SepalWidth
 :PetalLength
 :PetalWidth
 :Species

It would be great that when I type iris. I would have Language Server give me a code completion list of the properties of the object.

I don't understand how the LanguageServer ecosystem really works. The most information I've found on the topic is #734. Is something like this feasible? If so, I am more than willing to try and implement such a feature.

Not sure if this is the right place to put this feature request. I just know that it would be great to have this functionality in neovim.

Thank you for the hard work you all have put into this package.

@pfitzseb
Copy link
Member

pfitzseb commented Jan 3, 2023

This isn't possible with the current LanguageServer.jl design, since the LS doesn't have access to the object itself and there's no way to statically determine the property names. A hybrid solution where we fetch these runtime completions from the REPL is possible (and indeed implemented):
image

@HiramTheHero
Copy link
Author

Thank you for the information. I haven't experienced anything like this in neovim. Is this exclusively a vscode feature? Or is this functionality within another Julia package?

@pfitzseb
Copy link
Member

pfitzseb commented Jan 3, 2023

Is this exclusively a vscode feature?

Yes. We need a REPL we know how to talk to which has the object in memory.

@HiramTheHero
Copy link
Author

Good to know. I wasn't aware of this feature, even when I was using vscode. I didn't realize I had to enable Julia: Runtime Completions within settings. For some reason it was off. Thanks for the information.

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

2 participants