Skip to content

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

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

Open
UtkarshVerma opened this issue Jul 23, 2020 · 1 comment
Open
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-server Issues related to some aspect of the analysis server 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 legacy-area-analyzer Use area-devexp instead. 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));
}

@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Dec 12, 2021
@srawlins srawlins added the devexp-server Issues related to some aspect of the analysis server label Sep 27, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-server Issues related to some aspect of the analysis server 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

5 participants