diff options
| author | Bruno Ortiz <brunortiz11@gmail.com> | 2023-04-02 23:04:32 -0300 |
|---|---|---|
| committer | Bruno Ortiz <brunortiz11@gmail.com> | 2023-05-02 10:56:50 -0300 |
| commit | e2535926e9587aa9c4ec08637aaa45a9fd92f5ea (patch) | |
| tree | fa5946c15aa8dd1237fcc5f42f53aa2eed92b5a8 | |
| parent | 061940dad905e1a439b1eaead3342276294c4a4c (diff) | |
| download | rust-e2535926e9587aa9c4ec08637aaa45a9fd92f5ea.tar.gz rust-e2535926e9587aa9c4ec08637aaa45a9fd92f5ea.zip | |
Fixing tests
| -rw-r--r-- | crates/ide/src/fetch_crates.rs | 6 | ||||
| -rw-r--r-- | crates/rust-analyzer/tests/slow-tests/tidy.rs | 2 | ||||
| -rw-r--r-- | docs/dev/lsp-extensions.md | 23 |
3 files changed, 30 insertions, 1 deletions
diff --git a/crates/ide/src/fetch_crates.rs b/crates/ide/src/fetch_crates.rs index c0bc4103c2f..ec6d66d5c43 100644 --- a/crates/ide/src/fetch_crates.rs +++ b/crates/ide/src/fetch_crates.rs @@ -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 diff --git a/crates/rust-analyzer/tests/slow-tests/tidy.rs b/crates/rust-analyzer/tests/slow-tests/tidy.rs index 8e3097fce42..91dde1c7528 100644 --- a/crates/rust-analyzer/tests/slow-tests/tidy.rs +++ b/crates/rust-analyzer/tests/slow-tests/tidy.rs @@ -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() diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index 42f58fee30e..41bda554be9 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md @@ -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. \ No newline at end of file |
