mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Better support client completion resolve caps
This commit is contained in:
parent
47464e556c
commit
2a7be4afb0
5 changed files with 118 additions and 103 deletions
|
@ -12,6 +12,7 @@ use crate::config::SnippetCap;
|
|||
/// `CompletionItem` describes a single completion variant in the editor pop-up.
|
||||
/// It is basically a POD with various properties. To construct a
|
||||
/// `CompletionItem`, use `new` method and the `Builder` struct.
|
||||
#[derive(Clone)]
|
||||
pub struct CompletionItem {
|
||||
/// Used only internally in tests, to check only specific kind of
|
||||
/// completion (postfix, keyword, reference, etc).
|
||||
|
|
|
@ -97,6 +97,7 @@ pub(crate) fn check_edit_with_config(
|
|||
.unwrap_or_else(|| panic!("can't find {:?} completion in {:#?}", what, completions));
|
||||
let mut actual = db.file_text(position.file_id).to_string();
|
||||
completion.text_edit().apply(&mut actual);
|
||||
// TODO kb how to apply imports now?
|
||||
assert_eq_text!(&ra_fixture_after, &actual)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue