Skip to content

Commit e253592

Browse files
committed
Fixing tests
1 parent 061940d commit e253592

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

crates/ide/src/fetch_crates.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ pub struct CrateInfo {
1010
pub path: String,
1111
}
1212

13+
// Feature: Show Dependency Tree
14+
//
15+
// Shows a view tree with all the dependencies of this project
16+
//
17+
// |===
18+
// image::https://user-images.githubusercontent.com/5748995/229394139-2625beab-f4c9-484b-84ed-ad5dee0b1e1a.png[]
1319
pub(crate) fn fetch_crates(db: &RootDatabase) -> Vec<CrateInfo> {
1420
let crate_graph = db.crate_graph();
1521
crate_graph

crates/rust-analyzer/tests/slow-tests/tidy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn check_lsp_extensions_docs() {
4545
sh.read_file(sourcegen::project_root().join("docs/dev/lsp-extensions.md")).unwrap();
4646
let text = lsp_extensions_md
4747
.lines()
48-
.find_map(|line| line.strip_prefix("lsp_ext.rs hash:"))
48+
.find_map(|line| dbg!(line.strip_prefix("lsp_ext.rs hash:")))
4949
.unwrap()
5050
.trim();
5151
u64::from_str_radix(text, 16).unwrap()

docs/dev/lsp-extensions.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,3 +851,26 @@ export interface Diagnostic {
851851
rendered?: string;
852852
};
853853
}
854+
```
855+
856+
## Dependency Tree
857+
858+
**Method:** `rust-analyzer/fetchDependencyGraph`
859+
860+
**Request:**
861+
862+
```typescript
863+
export interface FetchDependencyGraphParams {}
864+
```
865+
866+
**Response:**
867+
```typescript
868+
export interface FetchDependencyGraphResult {
869+
crates: {
870+
name: string;
871+
version: string;
872+
path: string;
873+
}[];
874+
}
875+
```
876+
Returns all crates from this workspace, so it can be used create a viewTree to help navigate the dependency tree.

0 commit comments

Comments
 (0)