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
49.27k stars 2.98k forks source link

[Linux] rust-analyzer-2024-07-15 Failed to load workspaces. #14904

Open dxps opened 3 months ago

dxps commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Dear all,

Using the latest version of Zed - that is 0.144.4 at the time of this writing - opening this project fails with this notification popup:

image

Of course, the language server does not work (features such as code completion or navigation).

Environment

This issue happens on my workstation. The same project opens fine on the laptop, both systems running the latest Pop!_OS 22.04 LTS distro.

Besides the hardware differences, maybe it's a settings difference (I don't have access to the other one to check this, yet). However, regarding the settings, here they are on this workstation where the issue happens:

{ 
"lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "features": ["all"]
        }
      }
    }
  },
 }

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

No response

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

Zed.log
2024-07-21T14:34:47.748520534+03:00 [INFO] ========== starting zed ==========
2024-07-21T14:34:47.792543385+03:00 [INFO] Compositor detection: _NET_WM_CM_S?=false, _NET_WM_CM_OWNER=false, _NET_SUPPORTING_WM_CHECK=true
2024-07-21T14:34:47.792611828+03:00 [INFO] x11: compositor present: true, gtk_frame_extents_supported: true
2024-07-21T14:34:47.798383051+03:00 [INFO] Try connect ibus
2024-07-21T14:34:47.798997322+03:00 [INFO] perform;
2024-07-21T14:34:47.799054023+03:00 [INFO] read_command;
2024-07-21T14:34:47.799107037+03:00 [INFO] read_command;
2024-07-21T14:34:47.799295027+03:00 [INFO] socket reader;
2024-07-21T14:34:47.799354236+03:00 [INFO] Opening main db
2024-07-21T14:34:47.799610088+03:00 [INFO] new;
2024-07-21T14:34:47.800357785+03:00 [INFO] keep_updated;
2024-07-21T14:34:47.809303422+03:00 [INFO] Using git binary path: None
2024-07-21T14:34:47.849925+03:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-07-21T14:34:47.850098629+03:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-21T14:34:47.851424085+03:00 [INFO] Opening main db
2024-07-21T14:34:47.851687235+03:00 [INFO] perform;
2024-07-21T14:34:47.851746774+03:00 [INFO] read_command;
2024-07-21T14:34:47.851809489+03:00 [INFO] read_command;
2024-07-21T14:34:47.851927615+03:00 [INFO] socket reader;
2024-07-21T14:34:47.852774563+03:00 [INFO] XConnected server on 29360138, transport version: 0.0, TRANSPORT_MAX: 20
2024-07-21T14:34:47.853929946+03:00 [INFO] Using Visual { id: 195, colormap: 0, depth: 32 }
2024-07-21T14:34:47.854006892+03:00 [INFO] Creating colormap 54525955
2024-07-21T14:34:47.86007172+03:00 [INFO] new;
2024-07-21T14:34:47.860903357+03:00 [INFO] keep_updated;
2024-07-21T14:34:47.879718614+03:00 [INFO] Enabling Vulkan Portability
2024-07-21T14:34:47.879781957+03:00 [INFO] Enabling color space support
2024-07-21T14:34:47.906217867+03:00 [INFO] Adapter "AMD Radeon RX 5500 XT (RADV NAVI14)"
2024-07-21T14:34:47.90627754+03:00 [INFO] No ray tracing extensions are supported
2024-07-21T14:34:47.992491293+03:00 [INFO] Using surface present mode MAILBOX
2024-07-21T14:34:47.992608077+03:00 [WARN] Unable to forbid exclusive full screen
2024-07-21T14:34:47.995405937+03:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-21T14:34:47.995473626+03:00 [INFO] Creating a descriptor pool for at most 16 sets
2024-07-21T14:34:47.995524869+03:00 [INFO] Initializing Blade pipelines for surface SurfaceInfo { format: Bgra8UnormSrgb, alpha: Ignored }
2024-07-21T14:34:48.041104508+03:00 [INFO] set environment variables from shell:/bin/bash, path:/home/dxps/.local/bin:/home/dxps/perl5/bin:/home/dxps/.nvm/versions/node/v20.12.2/bin:/home/dxps/.cargo/bin:/home/dxps/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/dxps/apps/bin:/home/dxps/apps/flutter/bin:/home/dxps/.pub-cache/bin:/home/dxps/apps/go/bin:/home/dxps/go/bin:/home/dxps/apps/protoc/bin:/usr/lib/jvm/java-21-openjdk-amd64/bin:/home/dxps/apps/maven/bin:/home/dxps/.local/bin:/home/dxps/apps/redis-stack-server/bin
2024-07-21T14:34:48.057078222+03:00 [INFO] Refreshing at 8333 micros
2024-07-21T14:34:48.070825801+03:00 [INFO] set status on client 0: Authenticating
2024-07-21T14:34:48.071186144+03:00 [INFO] perform;
2024-07-21T14:34:48.071276842+03:00 [INFO] read_command;
2024-07-21T14:34:48.071344103+03:00 [INFO] read_command;
2024-07-21T14:34:48.071432861+03:00 [INFO] Opening main db
2024-07-21T14:34:48.071471307+03:00 [INFO] socket reader;
2024-07-21T14:34:48.078664189+03:00 [INFO] new;
2024-07-21T14:34:48.079366896+03:00 [INFO] keep_updated;
2024-07-21T14:34:48.083603803+03:00 [INFO] set status on client 198017: Connecting
2024-07-21T14:34:48.08372236+03:00 [WARN] Unknown request DestroyIcReply { input_method_id: 4, input_context_id: 45 }
2024-07-21T14:34:48.110886447+03:00 [INFO] Using surface present mode MAILBOX
2024-07-21T14:34:48.111018792+03:00 [WARN] Unable to forbid exclusive full screen
2024-07-21T14:34:48.209965173+03:00 [INFO] Initializing default prettier with plugins {}
2024-07-21T14:34:48.210027821+03:00 [INFO] starting language servers for Rust: rust-analyzer
2024-07-21T14:34:48.210074177+03:00 [INFO] starting language server "rust-analyzer", path: "/home/dxps/dev/dxps_gh/tmc/tmc-fsrs", id: 1
2024-07-21T14:34:48.210199535+03:00 [INFO] Initializing default prettier with plugins {}
2024-07-21T14:34:48.210256058+03:00 [INFO] starting language servers for Rust: rust-analyzer
2024-07-21T14:34:48.210892439+03:00 [INFO] fetching latest version of language server "rust-analyzer"
2024-07-21T14:34:48.26793086+03:00 [INFO] Node runtime install_if_needed
2024-07-21T14:34:48.278661915+03:00 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc
2024-07-21T14:34:48.58687239+03:00 [INFO] starting language server. binary path: "/home/dxps/.local/share/zed/node/node-v18.15.0-linux-x64/bin/node", working directory: "/", args: ["/home/dxps/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-07-21T14:34:48.708615133+03:00 [INFO] add connection to peer
2024-07-21T14:34:48.708661055+03:00 [INFO] add_connection;
2024-07-21T14:34:48.708709155+03:00 [INFO] waiting for server hello
2024-07-21T14:34:48.725593483+03:00 [INFO] got server hello
2024-07-21T14:34:48.725645307+03:00 [INFO] set status to connected (connection id: ConnectionId { owner_id: 0, id: 0 }, peer id: PeerId { owner_id: 453, id: 3717980 })
2024-07-21T14:34:48.725751005+03:00 [INFO] set status on client 198017: Connected { peer_id: PeerId { owner_id: 453, id: 3717980 }, connection_id: ConnectionId { owner_id: 0, id: 0 } }
2024-07-21T14:34:48.946190482+03:00 [INFO] downloading language server "rust-analyzer"
2024-07-21T14:34:48.946300388+03:00 [INFO] starting language server. binary path: "/home/dxps/.local/share/zed/languages/rust-analyzer/rust-analyzer-2024-07-15", working directory: "/home/dxps/dev/dxps_gh/tmc/tmc-fsrs", args: []
2024-07-21T14:34:48.981749359+03:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-07-21T11:34:48.977Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-07-21T11:34:48.977Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-07-21T14:34:48.986654182+03:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "9638057a-7dcc-4569-96c7-4f72cc6106f5",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-07-21T14:34:49.021874406+03:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-07-21T11:34:48.991Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-07-21T11:34:48.991Z]",
  "extra": [
    "Telemetry initialized"
  ]
}
2024-07-21T14:34:49.187682439+03:00 [ERROR] Language server rust-analyzer-2024-07-15 (id 1) status update: Failed to load workspaces.
2024-07-21T14:34:49.41168639+03:00 [ERROR] Language server rust-analyzer-2024-07-15 (id 1) status update: Failed to load workspaces.
dxps commented 3 months ago

:partying_face: I found the problem: the value of "features" should be just "all", and not part of an array.

Like this:

  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "features": "all"
        }
      }
    }
  },

Should I close this ticket? Or you may consider this as a small improvement by checking such settings values and inform the user about the problem?

Thanks again for this wonderful IDE. :pray:
All the best!

SimTheFool commented 3 months ago

I've the same issue on a rust monorepo with several crates. I've copy paste the @dxps config in my .zed/settings.json, but it didn't solve it. Though the date in the error message is not the same, I got 2024-07-29.

I'm on Ubuntu 22.04.

REIS0 commented 5 days ago

Also getting this error with Mac M1 on 2024-10-28

icoigo commented 1 day ago

Also getting this error with Mac M1 on 2024-10-28

I have the same error with Mac (Intel chip) on 2024-10-28

Note: Autually I have this error for quite a long time (tried very hard to solve, but just can't find anything usefull on the net). The last one I remember probably is on 2024-10-07, and I found that it is acutally related to the rust-analyzer version located in that path "~/Library/Application\ Support/Zed/languages/rust-analyzer/"