Allow using system node (#18172)
Release Notes: - (Potentially breaking change) Zed will now use the node installed on your $PATH (if it is more recent than v18) instead of downloading its own. You can disable the new behavior with `{"node": {"disable_path_lookup": true}}` in your settings. We do not yet use system/project-local node_modules. --------- Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
e4080ef565
commit
3ba071b993
34 changed files with 614 additions and 391 deletions
|
@ -59,13 +59,13 @@ fn server_binary_arguments(server_path: &Path) -> Vec<OsString> {
|
|||
}
|
||||
|
||||
pub struct JsonLspAdapter {
|
||||
node: Arc<dyn NodeRuntime>,
|
||||
node: NodeRuntime,
|
||||
languages: Arc<LanguageRegistry>,
|
||||
workspace_config: OnceLock<Value>,
|
||||
}
|
||||
|
||||
impl JsonLspAdapter {
|
||||
pub fn new(node: Arc<dyn NodeRuntime>, languages: Arc<LanguageRegistry>) -> Self {
|
||||
pub fn new(node: NodeRuntime, languages: Arc<LanguageRegistry>) -> Self {
|
||||
Self {
|
||||
node,
|
||||
languages,
|
||||
|
@ -183,14 +183,14 @@ impl LspAdapter for JsonLspAdapter {
|
|||
container_dir: PathBuf,
|
||||
_: &dyn LspAdapterDelegate,
|
||||
) -> Option<LanguageServerBinary> {
|
||||
get_cached_server_binary(container_dir, &*self.node).await
|
||||
get_cached_server_binary(container_dir, &self.node).await
|
||||
}
|
||||
|
||||
async fn installation_test_binary(
|
||||
&self,
|
||||
container_dir: PathBuf,
|
||||
) -> Option<LanguageServerBinary> {
|
||||
get_cached_server_binary(container_dir, &*self.node).await
|
||||
get_cached_server_binary(container_dir, &self.node).await
|
||||
}
|
||||
|
||||
async fn initialization_options(
|
||||
|
@ -226,7 +226,7 @@ impl LspAdapter for JsonLspAdapter {
|
|||
|
||||
async fn get_cached_server_binary(
|
||||
container_dir: PathBuf,
|
||||
node: &dyn NodeRuntime,
|
||||
node: &NodeRuntime,
|
||||
) -> Option<LanguageServerBinary> {
|
||||
maybe!(async {
|
||||
let mut last_version_dir = None;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue