mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Merge #7799
7799: Related tests r=matklad a=vsrs  This adds an ability to look for tests for the item under the cursor: function, constant, data type, etc The LSP part is bound to change. But the feature itself already works and I'm looking for a feedback :) Co-authored-by: vsrs <vit@conrlab.com>
This commit is contained in:
commit
7accf6bc37
13 changed files with 471 additions and 28 deletions
|
@ -447,6 +447,15 @@ impl Analysis {
|
|||
self.with_db(|db| runnables::runnables(db, file_id))
|
||||
}
|
||||
|
||||
/// Returns the set of tests for the given file position.
|
||||
pub fn related_tests(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
search_scope: Option<SearchScope>,
|
||||
) -> Cancelable<Vec<Runnable>> {
|
||||
self.with_db(|db| runnables::related_tests(db, position, search_scope))
|
||||
}
|
||||
|
||||
/// Computes syntax highlighting for the given file
|
||||
pub fn highlight(&self, file_id: FileId) -> Cancelable<Vec<HlRange>> {
|
||||
self.with_db(|db| syntax_highlighting::highlight(db, file_id, None, false))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue