scry
scry copied to clipboard
Add support for configuration using .scry.yml
This was suggested by @bew
The idea is to use a .scry.yml
file to store scry configuration just like .ameba.yml
Some use-cases:
- Vertical vs Horizontal align for contexts on hover feature
- Crystal path
- Main file (currently restricted to
.scry_main.cr
) - Enable, disable server features (Very important)
@crystal-lang-tools/scry WDYT?
Oh, we can read it using File.join(@workspace.root_uri, ".scry.yml")
Also, additional compilation flags
And we should have a global config, and optionally a project config
And we should have a global config, and optionally a project config
@bew Nice, Do you know a cross-platform way to access global config folder?
On Linux would be like ~/.scry.yml
or ~/.config/scry.yml
, Do you know any programmatic way to do this? like File.join
to create paths :sweat_smile:
It should be ~/.config/scry/scry.yml
on linux according to XDG conventions (iirc, I'm on the phone, didn't checked)
I've started a xdg shard to easily get a config file path based on your environment (some special xdg env vars), maybe I should finish it one day :smile:
I don't know if XDG handles windows as well (maybe https://stackoverflow.com/questions/43853548/xdg-basedir-directories-for-windows can help? Didn't read it yet)
Well. currently, I think .scry.yml
per workspace is enough I guess we can support global .scry.yml
later
Interesting, I guess I can use something like this: https://github.com/crystal-lang/shards/blob/master/src/config.cr :tada:
@faustinoaq Hey! You mentioned in https://github.com/crystal-lang-tools/scry/pull/122#issue-194885723 that you had some progress on scry config file, how is it now?
I'd like to go forward with this, do you have a poc/branch I can read? Do you want to continue it?