diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-06 15:39:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-06 15:39:49 +0100 |
commit | 1252107a3c7964ac2e5e7726173b56bb4dfbe621 (patch) | |
tree | 5189803adf9b8d89cb4823362e568748de039396 /crates/ra_assists/src/lib.rs | |
parent | efd8e34c396f1524623a495e47111f1047cf2879 (diff) | |
parent | 020ca6695f4d58f651984c4fbe2227d891896bb3 (diff) |
Merge #4345
4345: Refactor assists a bit r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 8cd8f89c4..13ea45ec7 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -18,7 +18,7 @@ pub mod utils; | |||
18 | pub mod ast_transform; | 18 | pub mod ast_transform; |
19 | 19 | ||
20 | use hir::Semantics; | 20 | use hir::Semantics; |
21 | use ra_db::{FileId, FileRange}; | 21 | use ra_db::FileRange; |
22 | use ra_ide_db::{source_change::SourceChange, RootDatabase}; | 22 | use ra_ide_db::{source_change::SourceChange, RootDatabase}; |
23 | use ra_syntax::TextRange; | 23 | use ra_syntax::TextRange; |
24 | 24 | ||
@@ -59,19 +59,7 @@ impl AssistLabel { | |||
59 | #[derive(Debug, Clone)] | 59 | #[derive(Debug, Clone)] |
60 | pub struct ResolvedAssist { | 60 | pub struct ResolvedAssist { |
61 | pub label: AssistLabel, | 61 | pub label: AssistLabel, |
62 | pub action: SourceChange, | 62 | pub source_change: SourceChange, |
63 | } | ||
64 | |||
65 | #[derive(Debug, Clone, Copy)] | ||
66 | enum AssistFile { | ||
67 | CurrentFile, | ||
68 | TargetFile(FileId), | ||
69 | } | ||
70 | |||
71 | impl Default for AssistFile { | ||
72 | fn default() -> Self { | ||
73 | Self::CurrentFile | ||
74 | } | ||
75 | } | 63 | } |
76 | 64 | ||
77 | /// Return all the assists applicable at the given position. | 65 | /// Return all the assists applicable at the given position. |