mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 10:42:08 +00:00
windows: Fix tailwind-language-server
(#17778)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Closes #17741 I'm not sure why, but ever since `tailwind` was upgraded to `0.24`, there have been occasional errors indicating that the `.ps1` file could not be found. After reviewing the `.ps1` script, it appears that it simply starts the server using `node`. This PR directly using the method from the script to start the server with `node`. Co-authored-by: Anay <me@anayparaswani.dev> Release Notes: - N/A --------- Co-authored-by: Anay <me@anayparaswani.dev>
This commit is contained in:
parent
8e30229ec9
commit
2699fa8d4a
1 changed files with 7 additions and 27 deletions
|
@ -18,20 +18,15 @@ use std::{
|
||||||
use util::{maybe, ResultExt};
|
use util::{maybe, ResultExt};
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
const SERVER_PATH: &str = "node_modules/.bin/tailwindcss-language-server.ps1";
|
const SERVER_PATH: &str =
|
||||||
|
"node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server";
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
const SERVER_PATH: &str = "node_modules/.bin/tailwindcss-language-server";
|
const SERVER_PATH: &str = "node_modules/.bin/tailwindcss-language-server";
|
||||||
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
|
||||||
fn server_binary_arguments(server_path: &Path) -> Vec<OsString> {
|
fn server_binary_arguments(server_path: &Path) -> Vec<OsString> {
|
||||||
vec![server_path.into(), "--stdio".into()]
|
vec![server_path.into(), "--stdio".into()]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
fn server_binary_arguments(server_path: &Path) -> Vec<OsString> {
|
|
||||||
vec!["-File".into(), server_path.into(), "--stdio".into()]
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct TailwindLspAdapter {
|
pub struct TailwindLspAdapter {
|
||||||
node: Arc<dyn NodeRuntime>,
|
node: Arc<dyn NodeRuntime>,
|
||||||
}
|
}
|
||||||
|
@ -114,27 +109,12 @@ impl LspAdapter for TailwindLspAdapter {
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
{
|
|
||||||
let env_path = self.node.node_environment_path().await?;
|
|
||||||
let mut env = HashMap::default();
|
|
||||||
env.insert("PATH".to_string(), env_path.to_string_lossy().to_string());
|
|
||||||
|
|
||||||
Ok(LanguageServerBinary {
|
|
||||||
path: "powershell.exe".into(),
|
|
||||||
env: Some(env),
|
|
||||||
arguments: server_binary_arguments(&server_path),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
|
||||||
{
|
|
||||||
Ok(LanguageServerBinary {
|
Ok(LanguageServerBinary {
|
||||||
path: self.node.binary_path().await?,
|
path: self.node.binary_path().await?,
|
||||||
env: None,
|
env: None,
|
||||||
arguments: server_binary_arguments(&server_path),
|
arguments: server_binary_arguments(&server_path),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async fn cached_server_binary(
|
async fn cached_server_binary(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Reference in a new issue