Open Z3NTL3 opened 4 months ago
you might not installed lsp from the log?
you might not installed lsp from the log?
The associated LSP's (should) automatically get installed when installing a language extension. I'd like to note that I do not think that this is the actual problem because Zed does install the appropiate LSP, however I am facing errors like: "cannot read LSP message headers", for most languages.
I am also having this issue with a fresh build, something changed recently that's causing this.
I think I found the problem, however I am unsure what file provides the dir.
Through my own debugging and in the log in your issue, these are the paths where the module "is not found"
From your log:
C:\\C:\\Users\\efdal\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server
From my log:
C:\\C:\\Users\\tommy\\AppData\\Local\\Zed\\extensions\\work\\html\\node_modules\\vscode-langservers-extracted\\bin\\vscode-html-language-server
I have verified the file does exist there but as you can see from the logs, we have this C:\\C:\\
, which I believe is the issue.
Also printing from tailwind.rs
inside get_cached_server_binary
, the "server_path" value has a node_modules folder inside a node_modules folder which I believe is wrong:
Server path: "C:\\Users\\tommy\\AppData\\Local\\Zed\\languages\\tailwindcss-language-server\\node_modules\\node_modules/.bin/tailwindcss-language-server"
Also printing from
tailwind.rs
insideget_cached_server_binary
, the "server_path" value has a node_modules folder inside a node_modules folder which I believe is wrong:
The duplicate "node_modules" is a problem for get_cached_server_binary
but on macos, this doesn't even seem to get used. In fetch_server_binary
, container_dir will be something like "...\AppData\Local\Zed\languages\tailwindcss-language-server". Fixing the wrong path-seperator makes it work (tailwind lsp specifically).
const SERVER_PATH: &'static [&'static str] = &[
"node_modules",
"@tailwindcss",
"language-server",
"bin",
"tailwindcss-language-server"
];
async fn fetch_server_binary(
&self,
latest_version: Box<dyn 'static + Send + Any>,
container_dir: PathBuf,
_: &dyn LspAdapterDelegate,
) -> Result<LanguageServerBinary> {
let latest_version = latest_version.downcast::<String>().unwrap();
//changed this v
let mut server_path = container_dir.clone();
for p in SERVER_PATH.iter() {
server_path = server_path.join(p);
}
and in get_cached_server_binary
let last_version_dir = last_version_dir.ok_or_else(|| anyhow!("no cached binary"))?;
//changed this v
let mut server_path = last_version_dir.clone();
for p in SERVER_PATH.iter() {
server_path = server_path.join(p);
}
I also changed the path to "node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server" because on macos, the "tailwindcss-language-server" file is a symlink to the actual script but on windows the ".bin" folder's "tailwindcss-language-server" is a sh script.
This needs to be done for atleast the following files:
Same error here.
same issue here, any fix yet?
same issue here, any fix yet?
did you atleast try what beans42 said?
same issue here, any fix yet?
did you atleast try what beans42 said?
well, i did change the tailwind and emmet like said @beans42, but the emmet doesnt work, perhaps it has a different path? also i couldnt find async fetch_server_binary and get_cached_server_binary one for the emmet, so i only change the const SERVER_PATH: for the emmet like so : const SERVER_PATH: &'static [&'static str] = &[ "node_modules", "@emmettio", "language-server", "bin", "emmet-language-server" ]; but it still didnt worked, anything i did wrong?
same issue here, any fix yet?
did you atleast try what beans42 said?
well, i did change the tailwind and emmet like said @beans42, but the emmet doesnt work, perhaps it has a different path? also i couldnt find async fetch_server_binary and get_cached_server_binary one for the emmet, so i only change the const SERVER_PATH: for the emmet like so : const SERVER_PATH: &'static [&'static str] = &[ "node_modules", "@emmettio", "language-server", "bin", "emmet-language-server" ]; but it still didnt worked, anything i did wrong?
well if its different you'll have to do it a bit different, but the logic stays the same. so you can change and write the code yourself or wait for someone else to do so.
Well, I noticed the same error in tailwind... invalid LSP message header "Windows PowerShell\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n"
And it seems to me that the problem is because powershell spits out it's greeting message to standard output, which then confuses the LSP ???
Indeed, when i change line 28 in tailwind.rs to: vec!["-nologo".into(), server_path.into(), "--stdio".into()]
basically adding "-nologo" parameter, the error is gone from the logs...
I'm facing the same issue, however, I got it fixed for tailwind in #17741
Check for existing issues
Describe the bug / provide steps to reproduce it
Don't know, I just did compile to Windows and all suddenly most LSPs gave this error.
Environment
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.