rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.69k stars 1.5k forks source link

fix: Redesign status page #9269

Closed Milo123459 closed 2 years ago

Milo123459 commented 2 years ago

I'm working on redesigning the status page.

Milo123459 commented 2 years ago

So far, all capitalization has been corrected. Currently working on making some of the text in analysis more "friendly".

lnicola commented 2 years ago

Would adding some detail to the requests be useful?

Milo123459 commented 2 years ago

Would adding some detail to the requests be useful?

Why not.

Milo123459 commented 2 years ago

Okay, because this is a draft PR kindly requesting someones help with the VSCode API, when opening the status file in VSCode, the title is nothing, and I want to add a title to the file. Not sure how. I think I have to dig into the protocol to return a title? Please tell me if someone knows.

lnicola commented 2 years ago

Since you're here, can you also look into how it loads after restarting Code? It shows up as an empty window

Milo123459 commented 2 years ago

Sure I suppose! Hoping I can really make it better.

Alright, I'm kinda confused on how to test the status. I need to go to the protocol but I'm not sure how. Won't work in Chrome, or something like Curl / Insomnia. Any ideas how I can test? I ran cargo run --package rust-analyzer and it is running.

lnicola commented 2 years ago

Uninstall the extension and run cargo xtask install, then make sure ~/.cargo/bin is in PATH when running Code.

Milo123459 commented 2 years ago

Thanks.

lnicola commented 2 years ago

See also https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev.

Milo123459 commented 2 years ago

Hm. A test that I didn't touch is failing.. Any ideas anyone?

Milo123459 commented 2 years ago
error[E0425]: cannot find value `META` in this scope    
    --> crates\syntax\src\ast\generated\nodes.rs:2083:53
     |
2083 |     fn can_cast(kind: SyntaxKind) -> bool { kind == META }
     |                                                     ^^^^ not found in this scope

Found a bug in code that I didn't modify.. 🤔

lnicola commented 2 years ago

Try to rebase.

Milo123459 commented 2 years ago

Got it.

Milo123459 commented 2 years ago

After rebasing, still not working.. I followed the steps it logged and still got nothing

Milo123459 commented 2 years ago

CI passing, that's good. Still have this error:

error[E0425]: cannot find value `META` in this scope
    --> crates\syntax\src\ast\generated\nodes.rs:2083:53
     |
2083 |     fn can_cast(kind: SyntaxKind) -> bool { kind == META }
     |                                                     ^^^^ not found in this scope

Also, rust-analyzer is giving me 2 errors in the IDE only: status.rs

use ide_db::base_db::{
    salsa::debug::{DebugQueryTable, TableEntry},
    CrateId, FileId, FileTextQuery, SourceDatabase, SourceRootId,
};
use ide_db::{
    symbol_index::{LibrarySymbolsQuery, SymbolIndex},
    RootDatabase,
};

Unresolved import for: LibrarySymbolsQuery and FileTextQuery

lnicola commented 2 years ago

I saw that once and solved it by running cargo clean and removing my sccache cache. I think these might be caused by pulling code or switching branches while cargo check is running.

And you might want to rebase again.

Milo123459 commented 2 years ago

Let me try.

Milo123459 commented 2 years ago

Done. Ran cargo clean and still isn't working. I've also cleared the cache

Milo123459 commented 2 years ago

Okay, so still getting an error, and now there are conflicts...

Milo123459 commented 2 years ago

My lord git sucks

lnicola commented 2 years ago

You can use git reflog to pick an older commit.

Milo123459 commented 2 years ago

Thanks. Will keep in mind..

Milo123459 commented 2 years ago

ToDo:

Milo123459 commented 2 years ago

@matklad I have a question for you, if that's alright. A thing that annoys me a lot is the fact the Status page doesn't have a title therefore VSCode shows it as a blank title. I was wondering where the protocol for rust-analyzer-status was located, or some sort of workaround to make sure that the status page has a title. Thanks.

matklad commented 2 years ago

@Milo123459 here are the protocol-related parts of status:

Note that the status code is pretty old, so it might very well be the case that a major redesign, taking advantage of more of the VS Code features, would be worthwhile.

Milo123459 commented 2 years ago

Thank you! I'll work on adding the status, then rewrite that code someother time. I've spent the past 2 days setting up dev environments and need a break lol

Milo123459 commented 2 years ago

@matklad this is basically ready to be merged, if you are happy with it

Milo123459 commented 2 years ago

Anything else I need to change?

Milo123459 commented 2 years ago

Anything else need to be changed?

lnicola commented 2 years ago

bors d+

bors[bot] commented 2 years ago

:v: Milo123459 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

Milo123459 commented 2 years ago

Anything else? I don't want to merge unless I have been given the all clear.

lnicola commented 2 years ago

It's fine, we can fix in a later PR anything that shows up.

lnicola commented 2 years ago

bors r+

bors[bot] commented 2 years ago

Build succeeded:

Milo123459 commented 2 years ago

Woo! 🎉