diff options
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index a00136da1..fb57486cb 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -17,7 +17,7 @@ mod doc_tests; | |||
17 | pub mod utils; | 17 | pub mod utils; |
18 | pub mod ast_transform; | 18 | pub mod ast_transform; |
19 | 19 | ||
20 | use ra_db::FileRange; | 20 | use ra_db::{FileId, FileRange}; |
21 | use ra_ide_db::RootDatabase; | 21 | use ra_ide_db::RootDatabase; |
22 | use ra_syntax::{TextRange, TextUnit}; | 22 | use ra_syntax::{TextRange, TextUnit}; |
23 | use ra_text_edit::TextEdit; | 23 | use ra_text_edit::TextEdit; |
@@ -54,6 +54,7 @@ pub struct AssistAction { | |||
54 | pub cursor_position: Option<TextUnit>, | 54 | pub cursor_position: Option<TextUnit>, |
55 | // FIXME: This belongs to `AssistLabel` | 55 | // FIXME: This belongs to `AssistLabel` |
56 | pub target: Option<TextRange>, | 56 | pub target: Option<TextRange>, |
57 | pub file: AssistFile, | ||
57 | } | 58 | } |
58 | 59 | ||
59 | #[derive(Debug, Clone)] | 60 | #[derive(Debug, Clone)] |
@@ -63,6 +64,18 @@ pub struct ResolvedAssist { | |||
63 | pub action: AssistAction, | 64 | pub action: AssistAction, |
64 | } | 65 | } |
65 | 66 | ||
67 | #[derive(Debug, Clone, Copy)] | ||
68 | pub enum AssistFile { | ||
69 | CurrentFile, | ||
70 | TargetFile(FileId), | ||
71 | } | ||
72 | |||
73 | impl Default for AssistFile { | ||
74 | fn default() -> Self { | ||
75 | Self::CurrentFile | ||
76 | } | ||
77 | } | ||
78 | |||
66 | /// Return all the assists applicable at the given position. | 79 | /// Return all the assists applicable at the given position. |
67 | /// | 80 | /// |
68 | /// Assists are returned in the "unresolved" state, that is only labels are | 81 | /// Assists are returned in the "unresolved" state, that is only labels are |