continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
16.78k stars 1.3k forks source link

Migrate `~/.continue/config.py` to XDG_CONFIG_HOME or `~/.config/continue/config.py` #558

Open klauern opened 11 months ago

klauern commented 11 months ago

Validations

Problem

I see the default of ~/.continue/config.py is used to store the configuration settings, but a lot of tools have started moving their configs to follow the XDG Base configuration: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

From that spec, config files usually go in ~/.config/<app>/<whatever> as a convention, which keeps a user's $HOME directory clean.

Solution

No response

sestinj commented 11 months ago

@klauern What if we offered an option of where to place .continue? Just a VS Code or command line option where you could set the directory?

I see the reasoning for keeping the home directory clean, though this is also the most obvious place to put something so it has the benefit of being easy for our users to find, something I'm not sure I want to change by default.

klauern commented 11 months ago

I think a configuration option is fine, but I also believe that defaulting to OS-specific locations like the XDG standard is more commonplace than you might think: https://dotfiles-matter.click/.

I noticed that ~/Library/Application Support on my Mac (and ~/.config) have a lot of settings already compared to a few years ago. So while a configuration option provides flexibility, having a sensible default like ~/.config/continue/config.py aligns with modern practices, keeps $HOME clean, and caters to a growing community preference.

Just thought it’s worth bringing up, especially as this project is still relatively new and has seen changes in config.py structure as well. I wasn't thinking the placement of the config would be as big of a shift as rebuilding it from scratch would be.

LangLangBart commented 11 months ago

I would maintain the status quo in the ~ directory, but I am also open to moving it under ~/.config. In my opinion, there is no need for an option. Just a decision.

As developers we sometimes feel that providing options for everything is a good thing, you can never have too many choices, right? Ultimately these choices end up being technical ones, choices that the average end user has no interest in. It’s our duty as developers to make smart design decisions and avoid putting the weight of technical choices on our end users.

Source: In Open Source, Learn to Decide

mhkeller commented 11 months ago

It was a little confusing to me

1) why there were settings that were not exposed via the extension’s vscode interface 2) why the extension wrote files outside of its own folder in ~/.vscode/extensions

When I delete the extension from vscode, do these other folders remain?

My vote would be to keep everything within .vscode. If that’s not possible for some reason then I would say going inside of ~/.config is better than making a ~/.continue folder

JohanAR commented 4 months ago

Are there some people who use continue.dev in multiple editors, so they would want to share settings between them?

I guess the full bells-and-whistles solution could be to ask the user when installing a plugin what they want to do. And if they choose to have settings shared between IDEs, then follow the XDG base directory specification on Linux, and the equivalent standards for Mac/Windows. This would of course also include splitting the contents of ~/.continue into user configuration, data, state and cache.

But since that would be a lot of work, IMO the second best solution would be to just move everything to $XDG_CONFIG_HOME/continue.dev/ with fallback to ~/.config/continue.dev/ if the environment var isn't set (on Linux).

CaptaiNiveau commented 1 month ago

I'm not doing so atm, but I may use continue in neovim and Rider (and maybe other IDEs in the future), so a global config is welcome. However, my home folder is full dotfolders that don't adhere to the xdg specifications which I'm trying to change bit by bit. This would definitely be an appreciated change ^^

KenMacD commented 3 weeks ago

The worst part of ~/.continue is that it starts with the prefix ~/.con. I didn't realize that I used it, but I often type ~/.con<TAB> in moving towards a programs config. Now I get an auto-complete choice between .config and .continue.

ShayBox commented 1 week ago

I think the above change makes the most sense, it supports the original location if it exists, otherwise uses the new location if it doesn't, and you can move it back manually if you want it in your home folder.