obiwan87 / odin-intellij

Odin Support plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/22933-odin-support
MIT License
36 stars 2 forks source link

Support for ols.json #26

Open MineBill opened 4 months ago

MineBill commented 4 months ago

This is similar to #25 but needs some extra thought.

A project can have custom collections such as packages and needs some way to let this plugin know about them. OLS accomplishes this with an ols.json file that is defined per-project. In that file, it is possible to describe a list of collections and their path (relative to that file), which makes OLS aware of them and can provide completions. In an ideal world, there would be an odin build system with a configuration file that all editor plugins could parse and figure out what collections are used for the project but sadly, we do not live in such a world. This plugin could come up with it's own project file that describes these collection but since it's ultimately a map[string]string and a lot of odin users and project already use OLS and have an ols.json, i don't think it would be a terrible idea to temporarily parse it to figure out the collections. Then, at later date, if an odin-build system emerges and is accepted by the community we could switch to that.

obiwan87 commented 4 months ago

Your suggestion makes a lot of sense, I'll definitely look into how re-using the ols.json settings when opening a project folder with IDEA.