mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
refactor completions to use TextEdit instead of InsertText
This commit is contained in:
parent
fa43ef30f4
commit
d08e81cdd8
54 changed files with 2320 additions and 313 deletions
|
@ -19,7 +19,7 @@ use crate::{
|
|||
},
|
||||
};
|
||||
|
||||
pub use crate::completion::completion_item::{CompletionItem, InsertText, CompletionItemKind};
|
||||
pub use crate::completion::completion_item::{CompletionItem, CompletionItemKind, InsertTextFormat};
|
||||
|
||||
/// Main entry point for completion. We run completion as a two-phase process.
|
||||
///
|
||||
|
@ -60,15 +60,3 @@ pub(crate) fn completions(db: &db::RootDatabase, position: FilePosition) -> Opti
|
|||
|
||||
Some(acc)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn check_completion(code: &str, expected_completions: &str, kind: CompletionKind) {
|
||||
use crate::mock_analysis::{single_file_with_position, analysis_and_position};
|
||||
let (analysis, position) = if code.contains("//-") {
|
||||
analysis_and_position(code)
|
||||
} else {
|
||||
single_file_with_position(code)
|
||||
};
|
||||
let completions = completions(&analysis.db, position).unwrap();
|
||||
completions.assert_match(expected_completions, kind);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue