scry icon indicating copy to clipboard operation
scry copied to clipboard

Add support for configuration using .scry.yml

Open faustinoaq opened this issue 6 years ago • 7 comments

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:

  1. Vertical vs Horizontal align for contexts on hover feature
  2. Crystal path
  3. Main file (currently restricted to .scry_main.cr)
  4. Enable, disable server features (Very important)

@crystal-lang-tools/scry WDYT?

faustinoaq avatar May 06 '18 19:05 faustinoaq

Oh, we can read it using File.join(@workspace.root_uri, ".scry.yml")

faustinoaq avatar May 06 '18 19:05 faustinoaq

Also, additional compilation flags

And we should have a global config, and optionally a project config

bew avatar May 06 '18 19:05 bew

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:

faustinoaq avatar May 06 '18 20:05 faustinoaq

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)

bew avatar May 06 '18 20:05 bew

Well. currently, I think .scry.yml per workspace is enough I guess we can support global .scry.yml later

faustinoaq avatar May 06 '18 21:05 faustinoaq

Interesting, I guess I can use something like this: https://github.com/crystal-lang/shards/blob/master/src/config.cr :tada:

faustinoaq avatar May 17 '18 11:05 faustinoaq

@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?

bew avatar Mar 28 '19 22:03 bew