zed icon indicating copy to clipboard operation
zed copied to clipboard

Expose more errors from rust-analyzer on invalid Cargo.toml contents

Open zephaniahong opened this issue 2 years ago β€’ 5 comments

Release Notes:

zephaniahong avatar Feb 25 '24 02:02 zephaniahong

We require contributors to sign our Contributor License Agreement, and we don't have @zephaniahong on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

cla-bot[bot] avatar Feb 25 '24 02:02 cla-bot[bot]

@cla-bot check

zephaniahong avatar Feb 25 '24 02:02 zephaniahong

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Feb 25 '24 02:02 cla-bot[bot]

Hi @SomeoneToIgnore! Managed to fix this issue but I realised a bug.

Notice how the cursor flickers only for that particular pop up.

https://github.com/zed-industries/zed/assets/33389011/1c9ac190-0d54-4efb-9d94-7f1121d044a3

But when that pop up is not the lowest pop-up, the flicker goes away

https://github.com/zed-industries/zed/assets/33389011/4d5fad31-da07-4e1d-b15e-1205fbed3915

Any hints as to what could be the cause? Thank you!

zephaniahong avatar Feb 25 '24 02:02 zephaniahong

Not sure, and does not look like your PR's issue? I fear this is one of the z-index bugs @ForLoveOfCats works on fixing and solving it might be hard.

SomeoneToIgnore avatar Feb 25 '24 07:02 SomeoneToIgnore

Interesting that I see only Failed to load workspace messages and no details as in your video, but that's r-a to blame, we show those pop-ups normally.

Thank you for bringing this in!

SomeoneToIgnore avatar Mar 02 '24 08:03 SomeoneToIgnore

@SomeoneToIgnore thanks so much for your help and patience in helping me land this PR! Truly appreciate it😊 oh I've yet to implement tests for this. Would you like me to?

zephaniahong avatar Mar 02 '24 09:03 zephaniahong

Fluctuating around that part myself, I've been thinking to have them first, but looks like this request is r-a based and not that widespread in other servers: so now I think it's enough to push this notification subscription away from all language servers' registration and do it for r-a only.

This way we have it pretty isolated and no need to be paranoid about potential malformed input.

SomeoneToIgnore avatar Mar 02 '24 09:03 SomeoneToIgnore

Understood! If there's any follow up in the future, I'd be more than happy to work on it!

zephaniahong avatar Mar 02 '24 09:03 zephaniahong

The comment above is something that can be followed up, if you're interested in that.

Basically, we have to move the notification handler added here into https://github.com/zed-industries/zed/blob/6fcd57ac53cd73adb717532c1f76b132a998e8c8/crates/languages/src/rust.rs

There are methods to handle the language server binary fetching and starting, but no trait methods for managing a running LSP server seem to exist β€” we need to design one and move the rust-analyzer related subscription there.

SomeoneToIgnore avatar Mar 02 '24 10:03 SomeoneToIgnore

Okay! I'll take a look into this. Will require a little more time on this(:

zephaniahong avatar Mar 02 '24 11:03 zephaniahong