mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-14 00:47:18 +00:00
Fixing tests
This commit is contained in:
parent
061940dad9
commit
e2535926e9
3 changed files with 30 additions and 1 deletions
|
@ -10,6 +10,12 @@ pub struct CrateInfo {
|
|||
pub path: String,
|
||||
}
|
||||
|
||||
// Feature: Show Dependency Tree
|
||||
//
|
||||
// Shows a view tree with all the dependencies of this project
|
||||
//
|
||||
// |===
|
||||
// image::https://user-images.githubusercontent.com/5748995/229394139-2625beab-f4c9-484b-84ed-ad5dee0b1e1a.png[]
|
||||
pub(crate) fn fetch_crates(db: &RootDatabase) -> Vec<CrateInfo> {
|
||||
let crate_graph = db.crate_graph();
|
||||
crate_graph
|
||||
|
|
|
@ -45,7 +45,7 @@ fn check_lsp_extensions_docs() {
|
|||
sh.read_file(sourcegen::project_root().join("docs/dev/lsp-extensions.md")).unwrap();
|
||||
let text = lsp_extensions_md
|
||||
.lines()
|
||||
.find_map(|line| line.strip_prefix("lsp_ext.rs hash:"))
|
||||
.find_map(|line| dbg!(line.strip_prefix("lsp_ext.rs hash:")))
|
||||
.unwrap()
|
||||
.trim();
|
||||
u64::from_str_radix(text, 16).unwrap()
|
||||
|
|
|
@ -851,3 +851,26 @@ export interface Diagnostic {
|
|||
rendered?: string;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Dependency Tree
|
||||
|
||||
**Method:** `rust-analyzer/fetchDependencyGraph`
|
||||
|
||||
**Request:**
|
||||
|
||||
```typescript
|
||||
export interface FetchDependencyGraphParams {}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```typescript
|
||||
export interface FetchDependencyGraphResult {
|
||||
crates: {
|
||||
name: string;
|
||||
version: string;
|
||||
path: string;
|
||||
}[];
|
||||
}
|
||||
```
|
||||
Returns all crates from this workspace, so it can be used create a viewTree to help navigate the dependency tree.
|
Loading…
Reference in a new issue