Skip to content

Commit 4e5c496

Browse files
bors[bot]matkladVeykril
authored
Merge #7819 #7820
7819: Speedup heavy tests r=matklad a=matklad bors r+ 🤖 7820: Update vscode README with a small features list r=matklad a=Veykril Nothing grande but I figured this is a bit better than showing almost nothing Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com> Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 parents 14cc626 + 4d14617 + 91ff47e commit 4e5c496

File tree

5 files changed

+69
-3
lines changed

5 files changed

+69
-3
lines changed

crates/ide/src/references.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ pub struct Declaration {
3939
pub access: Option<ReferenceAccess>,
4040
}
4141

42+
// Feature: Find All References
43+
//
44+
// Shows all references of the item at the cursor location
45+
//
46+
// |===
47+
// | Editor | Shortcut
48+
//
49+
// | VS Code | kbd:[Shift+Alt+F12]
50+
// |===
4251
pub(crate) fn find_all_refs(
4352
sema: &Semantics<RootDatabase>,
4453
position: FilePosition,

crates/ide/src/references/rename.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ pub(crate) fn prepare_rename(
5959
Ok(RangeInfo::new(range, ()))
6060
}
6161

62+
// Feature: Rename
63+
//
64+
// Renames the item below the cursor and all of its references
65+
//
66+
// |===
67+
// | Editor | Shortcut
68+
//
69+
// | VS Code | kbd:[F2]
70+
// |===
6271
pub(crate) fn rename(
6372
db: &RootDatabase,
6473
position: FilePosition,

crates/rust-analyzer/tests/rust-analyzer/main.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ version = "0.0.0"
5454
use std::collections::Spam;
5555
"#,
5656
)
57+
.with_config(serde_json::json!({
58+
"cargo": { "noSysroot": false }
59+
}))
5760
.server()
5861
.wait_until_workspace_is_loaded();
5962

@@ -450,6 +453,9 @@ fn main() {{}}
450453
"#,
451454
librs, libs
452455
))
456+
.with_config(serde_json::json!({
457+
"cargo": { "noSysroot": false }
458+
}))
453459
.server()
454460
.wait_until_workspace_is_loaded();
455461

@@ -572,7 +578,10 @@ fn main() {
572578
"###,
573579
)
574580
.with_config(serde_json::json!({
575-
"cargo": { "loadOutDirsFromCheck": true }
581+
"cargo": {
582+
"loadOutDirsFromCheck": true,
583+
"noSysroot": true,
584+
}
576585
}))
577586
.server()
578587
.wait_until_workspace_is_loaded();
@@ -715,7 +724,10 @@ pub fn foo(_input: TokenStream) -> TokenStream {
715724
"###,
716725
)
717726
.with_config(serde_json::json!({
718-
"cargo": { "loadOutDirsFromCheck": true },
727+
"cargo": {
728+
"loadOutDirsFromCheck": true,
729+
"noSysroot": true,
730+
},
719731
"procMacro": {
720732
"enable": true,
721733
"server": PathBuf::from(env!("CARGO_BIN_EXE_rust-analyzer")),

crates/rust-analyzer/tests/rust-analyzer/support.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ pub(crate) struct Project<'a> {
2727

2828
impl<'a> Project<'a> {
2929
pub(crate) fn with_fixture(fixture: &str) -> Project {
30-
Project { fixture, tmp_dir: None, roots: vec![], config: serde_json::Value::Null }
30+
Project {
31+
fixture,
32+
tmp_dir: None,
33+
roots: vec![],
34+
config: serde_json::json!({
35+
// Loading standard library is costly, let's ignore it by default
36+
"cargo": { "noSysroot": true }
37+
}),
38+
}
3139
}
3240

3341
pub(crate) fn tmp_dir(mut self, tmp_dir: TestDir) -> Project<'a> {

editors/code/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,32 @@
22

33
Provides support for rust-analyzer: novel LSP server for the Rust programming language.
44

5+
6+
Features:
7+
8+
* [code completion], [imports insertion]
9+
* [go to definition], [implementation], [type definition]
10+
* [find all references], [workspace symbol search], [rename]
11+
* [types and documentation on hover]
12+
* [inlay hints]
13+
* [semantic syntax highlighting]
14+
* a lot of [assist(code actions)]
15+
* apply suggestions from errors
16+
* ... and many more, checkout the [manual] to see them all
17+
18+
[code completion]: https://rust-analyzer.github.io/manual.html#magic-completions
19+
[imports insertion]: https://rust-analyzer.github.io/manual.html#auto-import
20+
[go to definition]: https://rust-analyzer.github.io/manual.html#go-to-definition
21+
[implementation]: https://rust-analyzer.github.io/manual.html#go-to-implementation
22+
[type definition]: https://rust-analyzer.github.io/manual.html#go-to-type-definition
23+
[find all references]: https://rust-analyzer.github.io/manual.html#find-all-references
24+
[workspace symbol search]: https://rust-analyzer.github.io/manual.html#workspace-symbol
25+
[rename]: https://rust-analyzer.github.io/manual.html#rename
26+
[types and documentation on hover]: https://rust-analyzer.github.io/manual.html#hover
27+
[inlay hints]: https://rust-analyzer.github.io/manual.html#inlay-hints
28+
[semantic syntax highlighting]: https://rust-analyzer.github.io/manual.html#semantic-syntax-highlighting
29+
[assist(code actions)]: https://rust-analyzer.github.io/manual.html#assists-code-actions
30+
31+
[manual]: https://rust-analyzer.github.io/manual.html
32+
533
See https://rust-analyzer.github.io/ for more information.

0 commit comments

Comments
 (0)