Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rust] Stuck on building proc-macros #8225

Closed
1 task done
feelingsonice opened this issue Feb 22, 2024 · 4 comments
Closed
1 task done

[Rust] Stuck on building proc-macros #8225

feelingsonice opened this issue Feb 22, 2024 · 4 comments
Labels
bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors rust Rust programming language support

Comments

@feelingsonice
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I'm not sure if this is a Rust issue or a Zed issue. It happens intermittently and I've only experienced it while using Zed.

The problem appears occasionally (seemingly random) when rust-analyzer needs to rebuild. It appears to be stuck on building proc-macros and can only be fixed by restarting Zed.

My setting config:

"inlay_hints": {
    "enabled": true,
    "show_type_hints": true,
    "show_parameter_hints": true,
    "show_other_hints": true
  },
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "allFeatures": true,
          "buildScripts": {
            "rebuildOnSave": true
          }
        },
        "procMacro": {
          "enable": true
        },
        "checkOnSave": {
          "command": "clippy" // rust-analyzer.checkOnSave.command
        },
        "hover": {
          "references": {
            "enabled": true
          }
        },
        "imports": {
          "prefix": "crate",
          "preferPrelude": true,
          "granularity": {
            "enforce": true
          }
        },
        "inlayHints": {
          "bindingModeHints": {
            "enable": true
          },
          "closingBraceHints": {
            "minLines": 0
          },
          "closureCaptureHints": {
            "enable": true
          },
          "maxLength": null,
          "lifetimeElisionHints": {
            "useParameterNames": true,
            "enable": "skip_trivial"
          },
          "closureReturnTypeHints": {
            "enable": "always"
          }
        }
      }
    }
  }

Environment

Zed: v0.123.3 (Zed)
OS: macOS 14.2.1
Memory: 96 GiB
Architecture: aarch64

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

Screenshot 2024-02-22 at 1 08 57 PM

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

2024-02-22T13:09:05-08:00 [INFO] reload git repository ".git"
2024-02-22T13:09:05-08:00 [INFO] reload git repository ".git"
2024-02-22T13:09:07-08:00 [WARN] Generic lsp request to rust-analyzer failed: content modified
2024-02-22T13:09:08-08:00 [INFO] 3 unhandled notification experimental/serverStatus:
{
  "health": "ok",
  "quiescent": true,
  "message": null
}
2024-02-22T13:10:17-08:00 [ERROR] Cancelled LSP request task for "inlayHint/resolve" id 3243 which took over 120s
2024-02-22T13:10:17-08:00 [ERROR] crates/editor/src/inlay_hint_cache.rs:608: hint resolve task

Caused by:
    0: inlay hint resolve LSP request
    1: LSP request timeout
2024-02-22T13:10:17-08:00 [ERROR] Cancelled LSP request task for "inlayHint/resolve" id 3271 which took over 120s
2024-02-22T13:10:17-08:00 [ERROR] crates/editor/src/inlay_hint_cache.rs:608: hint resolve task

Caused by:
    0: inlay hint resolve LSP request
    1: LSP request timeout
2024-02-22T13:10:17-08:00 [ERROR] crates/lsp/src/lsp.rs:648: oneshot canceled
2024-02-22T13:10:17-08:00 [ERROR] crates/lsp/src/lsp.rs:278: Broken pipe (os error 32)
2024-02-22T13:10:17-08:00 [ERROR] crates/lsp/src/lsp.rs:256: cannot read LSP message headers
@Anny0nn
Copy link

Anny0nn commented Feb 23, 2024

Same here, it started today, I have default lsp settings.

edit: running the command editor: restart language server a few times does the trick.

as mentioned in the comment below it's a rust-analyzer issue, so my comment that it had started recently is due to the fact that I just started messing around in some repos that use a lot of macros.

@RationalAsh
Copy link

Using Zed regularly for the last few months and can confirm that I've observed this issue as well and that it started recently.

@maxdeviant
Copy link
Member

This is a problem with rust-analyzer. Here's the upstream issue: rust-lang/rust-analyzer#16614

It looks like they landed a fix in the latest nightly, so it should be available soon (on Monday, by the sounds of it).

@JosephTLyons JosephTLyons added rust Rust programming language support language An umbrella label for all programming languages syntax behaviors language server An umbrella label for all language servers and removed triage labels Feb 26, 2024
@JosephTLyons
Copy link
Collaborator

Since this is not related to Zed, I'm going to close this issue out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors rust Rust programming language support
Projects
None yet
Development

No branches or pull requests

5 participants