zed icon indicating copy to clipboard operation
zed copied to clipboard

Workaround windows lsp args paths

Open d1y opened this issue 9 months ago • 7 comments

Fix d1y/dockerfile.zed#6 #12013

Co-Authored-By: ZeroHawkeye [email protected]

Release Notes:

  • Fixed windows lsp-server path

d1y avatar May 19 '24 14:05 d1y

Could there be more context given? It's interesting to know where do such paths come from and why cannot we fix those properly without a workaround.

From my perspective, this PR seems dangerously close to getting closed with a message like https://github.com/zed-industries/zed/pull/11860#issuecomment-2112747921

SomeoneToIgnore avatar May 19 '24 18:05 SomeoneToIgnore

Could there be more context given?

@ZeroHawkeye It was found that the LSP-server could not start on its Windows machine, and after joint research, it was found that the path path may have been misspelled

https://github.com/zed-industries/zed/blob/73ff7b961617198c187d4ed2ec1a66ebe1a045ce/extensions/vue/src/vue.rs#L75-L83

Among them, env:: current_dir will obtain an absolute path (is cwd, right?) join seems to add a prefix before the path/

/C:\Users\zero\AppData\Local\Zed\extensions\work\dockerfile/node_modules/dockerfile-language-server-nodejs/bin/docker-langserver

After being handed over to node to run, this path will become(https://github.com/d1y/dockerfile.zed/issues/6#issuecomment-2119146389)

E:\C:\Users\zero\AppData\Local\Zed\extensions\work\dockerfile/node_modules/dockerfile-language-server-nodejs/bin/docker-langserver

The solution I can think of is to remove the prefix / (https://github.com/d1y/dockerfile.zed/issues/6#issuecomment-2119158355)

After all, we cannot ask the extension author to fix this path issue themselves? 🤔


If my understanding is correct, perhaps changing the join in the extension to path.canonicalize? <examples processed?>

d1y avatar May 19 '24 22:05 d1y

Hey, this may not be a Windows related issue, I can install both dockerfile and vue extentions.

Not familiar with vue, am I downloading the right extensions?

Screenshot 2024-05-20 160350

Screenshot 2024-05-20 160405

JunkuiZhang avatar May 20 '24 08:05 JunkuiZhang

嘿,这可能不是 Windows 相关的问题,我可以安装 dockerfile 和 vue 扩展。

不熟悉 vue,我是否下载了正确的扩展?

截图2024-05-20 160350

截图2024-05-20 160405

It is indeed possible to download extensions at present. I am not sure if you can run the lsp prompt of docker, vue and other plug-ins normally? My Windows 10 will fail to start lsp due to path error.

ZeroHawkeye avatar May 20 '24 08:05 ZeroHawkeye

目前确实可以下载扩展,不清楚您这边可以正常运行docker,vue等插件的lsp提示么?我这边windows10会因为路径错误启动lsp失败

Ahh, no.

 Cannot find module 'C:\\C:\\Users\..

JunkuiZhang avatar May 20 '24 08:05 JunkuiZhang

worked for me, love this, love you.

superboxes avatar May 20 '24 18:05 superboxes

I think, the Vue not work, may not cause by this.

image

It's looks like this line will let the Vue server bin path to path of the Zed started path.

image

As you see on my log output, the @vue\\language-server\\bin\\vue-language-server.js has F:\\ prefix. That is the Zed.exe I was installed to: F:\Zed\Zed.exe

huacnlee avatar May 21 '24 15:05 huacnlee