jsonnet-language-server
jsonnet-language-server copied to clipboard
Completion: Support fields from imported files
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!
This feature would be an absolute game changer for us. Is there any more news on any work towards this?
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.
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