diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/completion_item.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_item.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index f46d9e581..c892ad846 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs | |||
@@ -18,7 +18,12 @@ pub struct CompletionItem { | |||
18 | lookup: Option<String>, | 18 | lookup: Option<String>, |
19 | insert_text: Option<String>, | 19 | insert_text: Option<String>, |
20 | insert_text_format: InsertTextFormat, | 20 | insert_text_format: InsertTextFormat, |
21 | /// Where completion occurs. `source_range` must contain the completion offset. | ||
22 | /// `insert_text` should start with what `source_range` points to, or VSCode | ||
23 | /// will filter out the completion silently. | ||
21 | source_range: TextRange, | 24 | source_range: TextRange, |
25 | /// Additional text edit, ranges in `text_edit` must never intersect with `source_range`. | ||
26 | /// Or VSCode will drop it silently. | ||
22 | text_edit: Option<TextEdit>, | 27 | text_edit: Option<TextEdit>, |
23 | } | 28 | } |
24 | 29 | ||
@@ -49,6 +54,7 @@ pub(crate) enum CompletionKind { | |||
49 | /// "Secret sauce" completions. | 54 | /// "Secret sauce" completions. |
50 | Magic, | 55 | Magic, |
51 | Snippet, | 56 | Snippet, |
57 | Postfix, | ||
52 | } | 58 | } |
53 | 59 | ||
54 | #[derive(Debug, PartialEq, Eq, Copy, Clone)] | 60 | #[derive(Debug, PartialEq, Eq, Copy, Clone)] |