jsonnet-language-server icon indicating copy to clipboard operation
jsonnet-language-server copied to clipboard

Completion: Support fields from imported files

Open julienduchesne opened this issue 3 years ago • 1 comments

julienduchesne avatar Dec 15 '21 01:12 julienduchesne

I'd like to take a crack at this. I'm not too familiar with LSP nor this repo but from what I see, what needs to be done is,

  • FindNodeByPosition should include the importnode into the search stack
  • completionFromStack should fall back to searching through import node types if it's not local/self.
  • If it's an import we'll have to read the doc from the cache to get the fields which can be used to build the completion list.
  • The part I'm not very clear about is how does this work for nested fields.

If I'm too far off let me know and I'll stay away from this :) But for me having this would greatly help in navigating complex jsonnet libs!

rvignesh89 avatar Sep 25 '22 05:09 rvignesh89

This feature would be an absolute game changer for us. Is there any more news on any work towards this?

judahrand avatar Feb 08 '23 09:02 judahrand

What is the current state of completion right now with the language-server?

From my experiments in Neovim and VsCode the only completion that I can get to work is from the std library. Although I did see https://github.com/grafana/jsonnet-language-server/pull/78, I am not sure if it adds other completion that I am missing out on at the moment.

In terms of tooling, I really think full completion support is a game changer, and would help make jsonnet less daunting for new comers/ease its adoption.

jemag avatar Feb 15 '23 16:02 jemag

It works but only with a single level. So library. would work but library.obj. would not autocomplete. I'll work on adding full support this week

julienduchesne avatar May 01 '23 13:05 julienduchesne