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

Any way I could change the location of .dart and .dartServer folders? #42813

Open
UtkarshVerma opened this issue Jul 23, 2020 · 1 comment
Open
Labels
analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@UtkarshVerma
Copy link

My home directory is getting cluttered up so I wanted to move the .dart and .dartServer folders elsewhere. Is there any way I could achieve this?

@vsmenon vsmenon added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Jul 27, 2020
@srawlins srawlins added the P3 A lower priority bug or feature request label Jan 23, 2021
@TamasBarta
Copy link

TamasBarta commented Nov 17, 2021

I had the same issue, because my home directory is read-only, so ~/.dartServer could not be created there, so the Dart language server was crashing.

I could control the ~/.dartServer location with the ANALYZER_STATE_LOCATION_OVERRIDE environment variable.

I put this in my .zshrc to move it to ~/.local/share/dartServer:

export ANALYZER_STATE_LOCATION_OVERRIDE="$XDG_DATA_HOME/dartServer"

However, I'm not sure about ~/.dart, or what issues I could have because of that directory never getting created.

Source:

/// Returns the path to default state location.
///
/// Generally this is ~/.dartServer. It can be overridden via the
/// ANALYZER_STATE_LOCATION_OVERRIDE environment variable, in which case this
/// method will return the contents of that environment variable.

Edit: It looks like ~/.dart is not changeable, it looks hardcoded here:

/// The directory used to store the analytics settings file.
///
/// Typically, the directory is `~/.dart/` (and the settings file is
/// `dartdev.json`).
///
/// This can return null under some conditions, including when the user's home
/// directory does not exist.
Directory getDartStorageDirectory() {
var homeDir = Directory(userHomeDir());
if (!homeDir.existsSync()) {
return null;
}
return Directory(path.join(homeDir.path, _dartDirectoryName));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-server area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants