zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.11k stars 3.07k forks source link

Downloading eslint,vue-language-server... #18258

Open lq0910 opened 1 month ago

lq0910 commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

一直下载中.... 语言服务无法使用 ,代码提示和函数方法跳转也不起作用

Environment

Zed: v0.155.0 (Zed Dev 3ca18af40b8a7cb83d8303a8131e90ca997f09ca) OS: Windows 10.0.26100 Memory: 15.7 GiB Architecture: x86_64 GPU: Intel(R) Iris(R) Xe Graphics || Intel Corporation || Intel driver

If applicable, add mockups / screenshots to help explain present your vision of the feature

image image image

If applicable, attach your Zed.log file to this issue.

Caused by: 0: request or operation took longer than the configured timeout time 1: [28] Timeout was reached 2024-09-24T12:54:33.2866712+08:00 [ERROR] failed to start language server "eslint": failed to launch npm subcommand install subcommand err: Some(error downloading Node binary tarball

lq0910 commented 1 month ago

Same issue with my macbook

bestgopher commented 1 month ago

It might be due to network issues. You could set up a proxy like this:

image

lq0910 commented 1 month ago

已收到。我会马上查看。

lq0910 commented 1 month ago

@bestgopher Thank you very much. I have fixed the version below 0.153 and there is no need to configure a proxy. But Vue's language server has encountered another error

lq0910 commented 1 month ago

2024-09-25T09:04:46.2755109+08:00 [INFO] beginning to reinstall server
2024-09-25T09:04:46.275561+08:00 [INFO] deleting server container
2024-09-25T09:04:46.275932+08:00 [ERROR] server container removal

Caused by:
    系统找不到指定的文件。 (os error 2)
2024-09-25T09:04:46.2759981+08:00 [INFO] starting language server "vue-language-server", path: "D:\\docs\\project\\zq-slj\\zq-slj-app-frontend\\sz_h5", id: 19
2024-09-25T09:04:46.2777072+08:00 [INFO] Node runtime install_if_needed
2024-09-25T09:04:46.4151099+08:00 [INFO] starting language server. binary path: "C:\\Users\\liqiang\\AppData\\Local\\Zed\\node\\node-v22.5.1-win-x64\\node.exe", working directory: "D:\\docs\\project\\zq-slj\\zq-slj-app-frontend\\sz_h5", args: ["/C:\\Users\\liqiang\\AppData\\Local\\Zed\\extensions\\work\\vue/node_modules/@vue/language-server/bin/vue-language-server.js", "--stdio"]
2024-09-25T09:04:46.4454793+08:00 [INFO] Node runtime install_if_needed
2024-09-25T09:04:46.4682538+08:00 [ERROR] cannot read LSP message headers
2024-09-25T09:04:46.4684361+08:00 [ERROR] failed to start language server "vue-language-server": oneshot canceled
2024-09-25T09:04:46.4684911+08:00 [ERROR] server stderr: Some("node:internal/modules/cjs/loader:1222\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'D:\\C:\\Users\\liqiang\\AppData\\Local\\Zed\\extensions\\work\\vue\\node_modules\\@vue\\language-server\\bin\\vue-language-server.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1219:15)\r\n    at Module._load (node:internal/modules/cjs/loader:1045:27)\r\n    at TracingChannel.traceSync (node:diagnostics_channel:315:14)\r\n    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:5)\r\n    at node:internal/main/run_main_module:30:49 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v22.5.1\r\n")
2024-09-25T09:04:46.4686643+08:00 [INFO] retrying installation of language server "vue-language-server" in 1s
2024-09-25T09:04:46.4687722+08:00 [ERROR] server shut down
2024-09-25T09:04:46.5705457+08:00 [INFO] Node runtime install_if_needed
2024-09-25T09:04:47.469016+08:00 [INFO] About to spawn test binary
2024-09-25T09:04:47.4691925+08:00 [WARN] test binary failed to launch
2024-09-25T09:04:47.4693048+08:00 [WARN] test binary check failed
2024-09-25T09:04:47.4694103+08:00 [INFO] beginning to reinstall server
2024-09-25T09:04:47.4695305+08:00 [INFO] deleting server container
2024-09-25T09:04:47.4703309+08:00 [ERROR] server container removal

Caused by:
    系统找不到指定的文件。 (os error 2)
2024-09-25T09:04:47.4704863+08:00 [INFO] starting language server "vue-language-server", path: "D:\\docs\\project\\zq-slj\\zq-slj-app-frontend\\sz_h5", id: 20
2024-09-25T09:04:47.4727081+08:00 [INFO] Node runtime install_if_needed
2024-09-25T09:04:47.5956061+08:00 [INFO] starting language server. binary path: "C:\\Users\\liqiang\\AppData\\Local\\Zed\\node\\node-v22.5.1-win-x64\\node.exe", working directory: "D:\\docs\\project\\zq-slj\\zq-slj-app-frontend\\sz_h5", args: ["/C:\\Users\\liqiang\\AppData\\Local\\Zed\\extensions\\work\\vue/node_modules/@vue/language-server/bin/vue-language-server.js", "--stdio"]
2024-09-25T09:04:47.645386+08:00 [ERROR] cannot read LSP message headers
2024-09-25T09:04:47.6455988+08:00 [ERROR] failed to start language server "vue-language-server": oneshot canceled
2024-09-25T09:04:47.6457459+08:00 [ERROR] server stderr: Some("node:internal/modules/cjs/loader:1222\r\n  throw err;\r\n  ^\r\n\r\nError: Cannot find module 'D:\\C:\\Users\\liqiang\\AppData\\Local\\Zed\\extensions\\work\\vue\\node_modules\\@vue\\language-server\\bin\\vue-language-server.js'\r\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1219:15)\r\n    at Module._load (node:internal/modules/cjs/loader:1045:27)\r\n    at TracingChannel.traceSync (node:diagnostics_channel:315:14)\r\n    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)\r\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:5)\r\n    at node:internal/main/run_main_module:30:49 {\r\n  code: 'MODULE_NOT_FOUND',\r\n  requireStack: []\r\n}\r\n\r\nNode.js v22.5.1\r\n")
2024-09-25T09:04:47.6459154+08:00 [ERROR] Hit 4 reinstallation attempts for "vue-language-server"
2024-09-25T09:04:47.645976+08:00 [ERROR] server shut down
2024-09-25T09:04:48.3037061+08:00 [INFO] downloading language server "vtsls"
2024-09-25T09:04:48.313555+08:00 [INFO] Node runtime install_if_needed
2024-09-25T09:04:48.4367243+08:00 [INFO] starting language server. binary path: "C:\\Users\\liqiang\\AppData\\Local\\Zed\\node\\node-v22.5.1-win-x64\\node.exe", working directory: "D:\\docs\\project\\zq-slj\\zq-slj-app-frontend\\sz_h5", args: ["C:\\Users\\liqiang\\AppData\\Local\\Zed\\languages\\vtsls\\node_modules/@vtsls/language-server/bin/vtsls.js", "--stdio"]
2024-09-25T09:04:49.7413722+08:00 [INFO] Creating buffer 0x15343f2bc58 of size 64288, name 'chunk-11', handle 14
2024-09-25T09:04:49.7449175+08:00 [INFO] Creating buffer 0x15343f2aba8 of size 64288, name 'chunk-12', handle 15
2024-09-25T09:04:49.9897651+08:00 [INFO] Creating buffer 0x15343f2ddb8 of size 75712, name 'chunk-13', handle 16
2024-09-25T09:04:50.0015633+08:00 [INFO] Creating buffer 0x15343f2b138 of size 89600, name 'chunk-14', handle 17
2024-09-25T09:04:50.0290107+08:00 [INFO] Creating buffer 0x15343f2d298 of size 99680, name 'chunk-15', handle 18
2024-09-25T09:04:50.0547858+08:00 [INFO] Creating buffer 0x15343f2cd08 of size 100128, name 'chunk-16', handle 19
2024-09-25T09:04:50.3385536+08:00 [INFO] Creating buffer 0x15343f2a088 of size 101584, name 'chunk-17', handle 20
2024-09-25T09:04:50.376602+08:00 [INFO] Creating buffer 0x15343f2d828 of size 113344, name 'chunk-18', handle 21
2024-09-25T09:04:52.2828739+08:00 [INFO] Creating buffer 0x15343f2a618 of size 113344, name 'chunk-19', handle 22
2024-09-25T09:05:00.4261958+08:00 [INFO] Creating texture 0x153c0223538 of size 1024x1024x1 and format R16Float, name 'atlas', handle 23
2024-09-25T09:05:00.4263614+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-09-25T09:05:00.4310532+08:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-09-25T09:05:00.4425903+08:00 [INFO] Creating a descriptor pool for at most 256 sets
2024-09-25T09:05:00.4563819+08:00 [INFO] Creating a descriptor pool for at most 256 sets
2024-09-25T09:05:05.7446636+08:00 [INFO] Creating texture 0x153c0223fc8 of size 1030x1024x1 and format R16Float, name 'atlas', handle 24```
bestgopher commented 1 month ago

@bestgopher Thank you very much. I have fixed the version below 0.153 and there is no need to configure a proxy. But Vue's language server has encountered another error

I'm not familiar with Vue, so I can't offer any suggestions.

lq0910 commented 1 month ago

@bestgopher okay, thank you

JunkuiZhang commented 1 month ago

Any extension you download from the extension store will not work for now. See #15004

lq0910 commented 1 month ago

@JunkuiZhang 我工作主要是vue,目前其他扩展基本可以使用,只有vue无法使用,html的语法提示目前也不起作用,就没有什么办法解决?

JunkuiZhang commented 1 month ago

@lq0910 你会改代码吗?

diff --git a/crates/extension/src/extension_lsp_adapter.rs b/crates/extension/src/extension_lsp_adapter.rs
index 25179acec..ccc1cbf5e 100644
--- a/crates/extension/src/extension_lsp_adapter.rs
+++ b/crates/extension/src/extension_lsp_adapter.rs
@@ -88,7 +88,17 @@ impl LspAdapter for ExtensionLspAdapter {

             Ok(LanguageServerBinary {
                 path,
-                arguments: command.args.into_iter().map(|arg| arg.into()).collect(),
+                arguments: command
+                    .args
+                    .into_iter()
+                    .map(|arg| {
+                        if let Some(arg) = arg.strip_prefix('/') {
+                            arg.into()
+                        } else {
+                            arg.into()
+                        }
+                    })
+                    .collect(),
                 env: Some(command.env.into_iter().collect()),
             })
         }
lq0910 commented 1 month ago

可以改的,只是我现在本地编译因为网络原有总是编译失败

lq0910 commented 1 month ago

@JunkuiZhang 这段代码我看和#15004 里面的不太一样哦

JunkuiZhang commented 1 month ago

解决的是不一样的问题

lq0910 commented 1 month ago

好的,谢谢。 我改了试试,我问了下别人扩展都可以用win版本,真是怪了

lq0910 commented 1 month ago

你用的是自己编译的版本?

JunkuiZhang commented 1 month ago

你用的是自己编译的版本?

是的,尽量不要用别人编译好的二进制文件,安全考虑

lq0910 commented 1 month ago

@JunkuiZhang 好的,非常感谢!