Files
openidea/crates/ide-workspace/src/lib.rs
T
l0ng-ai 1f9be73174 feat(remote): Reload the environment and apply devcontainer settings on the remote server (#183)
The remote server read the login shell's PATH once and cached it, had no project-level environment, and changed environment variables only took effect after reinstalling or a manual restart.

- Every openidea-server start re-reads the remote login shell's full environment (`$SHELL -ilc env -0`), with the cached PATH only as a fallback when the shell doesn't answer.
- A project's `.devcontainer/devcontainer.json` (or `.devcontainer.json`) applies on remote hosts: `remoteEnv` (with `${localEnv|containerEnv|env:X[:default]}`, workspace variables and `null` to unset) reaches every child process through one environment overlay (terminals, run configurations, language servers, debuggers, build tools, git), and `postStartCommand` (string, array or parallel object) runs once per server start in the project root as a cancellable background task; a failure raises a notification with the exit code and the last output lines without blocking the project.
- Reload Environment (`remote.reloadEnvironment`, File menu and Find Action) re-resolves the login shell and `remoteEnv` without restarting the server, starting from the process's original environment so prepended PATH entries don't pile up; it lists the changed variables, notes that running processes keep their environment, and offers to restart language servers.
- The JSONC reader moves to `ide_core::jsonc` and is shared with ide-run.

Claude-Session: https://claude.ai/code/session_01Dq6jQQn8ZhRfkkyj3PRutA
2026-10-29 09:28:18 +08:00

39 lines
1.1 KiB
Rust

//! The project model that ties documents, settings and history together.
pub mod caches;
pub mod devcontainer;
pub mod documents;
pub mod editorconfig;
pub mod file_defaults;
pub mod file_moves;
pub mod file_refs;
pub mod history;
pub mod memory;
pub mod process;
pub mod recent;
pub mod roots;
pub mod settings;
pub mod text_refs;
pub use documents::{DetectLanguage, DocumentInfo, Documents, TextSnapshot};
pub use editorconfig::{EditorConfig, EditorConfigProps};
pub use file_defaults::FileDefaults;
pub use file_moves::{FileMove, FileMoves, UndoOutcome};
pub use history::{DirectoryHistory, HistoryEntry, HistoryKind, LocalHistory, Retention};
pub use recent::{RecentProject, RecentProjects};
pub use roots::{ProjectRoots, RootKind, SourceFolder};
pub use settings::{SettingsScope, SettingsStore};
#[cfg(test)]
mod assertions {
fn send_sync<T: Send + Sync>() {}
#[test]
fn types_are_thread_safe() {
send_sync::<super::Documents>();
send_sync::<super::LocalHistory>();
send_sync::<super::RecentProjects>();
send_sync::<super::SettingsStore>();
}
}