zed icon indicating copy to clipboard operation
zed copied to clipboard

lsp timeout when open big project

Open wuchunpeng777 opened this issue 10 months ago • 6 comments

Summary

lsp timeout when open git project

Steps to trigger the problem: 1.Open a big unity project which has many files 2.When the lsp process is running and is still init, after a few minutes, the prompt timeout error was reported。 3.In small project, everything is correct

Actual Behavior: lsp time out

Expected Behavior: lsp run correctly

Zed Version and System Specs

Zed Dev 0.177.0 Windows10

wuchunpeng777 avatar Feb 28 '25 04:02 wuchunpeng777

Which LSP are we talking about, c#? Do you have an example of a big unity open source project we can use to try to reproduce your issue?

devzeth avatar Feb 28 '25 11:02 devzeth

Can the same LSP server (whichever it is) process the project normally when used from other editors or with command line?

ekorchmar avatar Mar 03 '25 21:03 ekorchmar

As @devzeth and @ekorchmar alluded to, we will need more information to get this fixed for you.

To get the name of the LSP that is running you can run debug: open language server logs and in the top left of the pane that opens click the server name dropdown and let us know what you see listed there.

Additionally in the LSP debug logs, try selecting the different language servers that are running and make sure the log setting is set to "Server Logs" (the default) and let us know if you see any errors that seem relevant.

Finally, if you could please provide the contents of your Zed log (zed: open log) shortly after the LSP times out that would be much appreciated.

Thanks!

probably-neb avatar Mar 12 '25 15:03 probably-neb

Bump. I have exactly the same issue and Zed is unusable because of that. After 120s OmniSharp is terminated automatically with timeout log...

.csproj files are loading correctly, but needs more time if you have a lot of them - 120s is definetely not enough.

2025-05-07T19:49:52+02:00 INFO  [project::lsp_store] attempting to start language server "omnisharp", path: "/Users/adamwawrzynkowski/Documents/Unity Projects/Bytro/s1914-unity", id: 1
2025-05-07T19:49:55+02:00 INFO  [lsp] starting language server process. binary path: "/Users/adamwawrzynkowski/Library/Application Support/Zed/extensions/work/csharp/omnisharp-v1.39.13/OmniSharp", working directory: "/Users/adamwawrzynkowski/Documents/Unity Projects/Bytro/s1914-unity", args: ["-lsp"]
2025-05-07T19:51:55+02:00 ERROR [lsp] Cancelled LSP request task for "initialize" id 0 which took over 120s
2025-05-07T19:51:55+02:00 ERROR [lsp] oneshot canceled
2025-05-07T19:51:55+02:00 ERROR [project::lsp_store] Failed to start language server "omnisharp": LSP request timeout
2025-05-07T19:51:55+02:00 ERROR [project::lsp_store] server stderr: ""

Full LSP Log: https://pastebin.com/wqRjPzdQ Full Zed Log: https://pastebin.com/eW6xyajY

The same on newest stable release and Zed preview

adamwawrzynkowski avatar May 07 '25 17:05 adamwawrzynkowski

Bump.  提升。 I have exactly the same issue and Zed is unusable because of that. After 120s OmniSharp is terminated automatically with timeout log...我遇到了完全相同的问题,由于这个问题,Zed 变得无法使用。120 秒后 OmniSharp 会自动终止,并带有超时日志...

.csproj files are loading correctly, but needs more time if you have a lot of them - 120s is definetely not enough..csproj 文件加载正常,但如果有很多个,就需要更多时间 - 120 秒绝对不够。

2025-05-07T19:49:52+02:00 INFO  [project::lsp_store] attempting to start language server "omnisharp", path: "/Users/adamwawrzynkowski/Documents/Unity Projects/Bytro/s1914-unity", id: 1
2025-05-07T19:49:55+02:00 INFO  [lsp] starting language server process. binary path: "/Users/adamwawrzynkowski/Library/Application Support/Zed/extensions/work/csharp/omnisharp-v1.39.13/OmniSharp", working directory: "/Users/adamwawrzynkowski/Documents/Unity Projects/Bytro/s1914-unity", args: ["-lsp"]
2025-05-07T19:51:55+02:00 ERROR [lsp] Cancelled LSP request task for "initialize" id 0 which took over 120s
2025-05-07T19:51:55+02:00 ERROR [lsp] oneshot canceled
2025-05-07T19:51:55+02:00 ERROR [project::lsp_store] Failed to start language server "omnisharp": LSP request timeout
2025-05-07T19:51:55+02:00 ERROR [project::lsp_store] server stderr: ""

Full LSP Log: https://pastebin.com/wqRjPzdQ完整的 LSP 日志:https://pastebin.com/wqRjPzdQ Full Zed Log: https://pastebin.com/eW6xyajY完整的 Zed 日志:https://pastebin.com/eW6xyajY

The same on newest stable release and Zed preview在最新的稳定版本和 Zed 预览版上也是一样。

Very agree , It is completely unusable, and compared with vscode, lsp is much slower

qweqwe1245 avatar May 08 '25 01:05 qweqwe1245

Yeah, at least give us an option to override the timeout 🙄

adamwawrzynkowski avatar May 08 '25 02:05 adamwawrzynkowski

Looks like I found the solution for it! Create and place the omnisharp.json file in your project root (I've also added it into the .zed folder - just in case). Add the following content to the file:

{
  "RoslynExtensionsOptions": {
    "EnableAnalyzersSupport": true,
    "LocationPaths": []
  },
  "FormattingOptions": {
    "EnableEditorConfigSupport": true
  },
  "MsBuild": {
    "LoadProjectsOnDemand": true
  }
}

OmniSharp will now load all files and will not be terminated after 120s. Would be nice to attach this config by default, Zed!

AdamWawrzynkowskiGF avatar May 08 '25 15:05 AdamWawrzynkowskiGF

@AdamWawrzynkowskiGF please do not ping maintainers unless requested to do so. We pay attention to GitHub notifications and are already notified of new comments on issues we've interacted with.

Regarding the solution, I will open a new issue here https://github.com/zed-extensions/csharp, as this issue is not in Zed core, rather with omnisharp lsp. We can start investigating and fixing the default configuration for omnisharp there

probably-neb avatar May 08 '25 18:05 probably-neb

Seems there is already an issue open on the extension. https://github.com/zed-extensions/csharp/issues/6

probably-neb avatar May 08 '25 18:05 probably-neb