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

Support grafonnet autocompletion #110

Closed
v-zhuravlev opened this issue Aug 2, 2023 · 5 comments
Closed

Support grafonnet autocompletion #110

v-zhuravlev opened this issue Aug 2, 2023 · 5 comments

Comments

@v-zhuravlev
Copy link

Hello!
We now have autocomplete feature, unfortunately it doesn't work for generated grafonnet lib:
https://github.com/grafana/grafonnet

Is there a way to add it?

This library is very important for designing clean Grafana dashboards as-code. And such autocompletion can add dramatic speed boost to this process, getting near to composing dashboards in Grafana UI.

@julienduchesne
Copy link
Member

hmm that's tricky. Grafonnet is generated on the fly from jsonschema. To do autocomplete, we'd have to do the same in the language server and it can be a quite expensive thing to do. The language server avoids evaluation at all costs in order to provider sub-second suggestions

@v-zhuravlev
Copy link
Author

Is this something that can be put behind feature opt-in flag?

@v-zhuravlev v-zhuravlev changed the title Support grafonnet autocompletetion Support grafonnet autocompletion Aug 2, 2023
@v-zhuravlev
Copy link
Author

We plan to create Grafana cloud integrations using only that lib as base, so this feature can be game changer.

@Duologic
Copy link
Member

Duologic commented Aug 2, 2023

I've recently learned about LSIF, a format that can store data about an LSP workspace. It would be a bit of a stretch but perhaps we can generate such a file for Grafonnet and tell the language server about it somehow.

@Duologic
Copy link
Member

Duologic commented Sep 7, 2023

Grafonnet is now statically generated, this means it can be used with the language server.

@Duologic Duologic closed this as completed Sep 7, 2023
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

3 participants