mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Pull completion options up to the rust-analyzer
This commit is contained in:
parent
2347c03dcd
commit
bf582e77d6
5 changed files with 31 additions and 23 deletions
|
@ -450,17 +450,12 @@ impl Analysis {
|
|||
}
|
||||
|
||||
/// Computes completions at the given position.
|
||||
pub fn completions(&self, position: FilePosition) -> Cancelable<Option<Vec<CompletionItem>>> {
|
||||
let opts = CompletionOptions {
|
||||
enable_postfix_completions: self.feature_flags().get("completion.enable-postfix"),
|
||||
add_call_parenthesis: self
|
||||
.feature_flags()
|
||||
.get("completion.insertion.add-call-parenthesis"),
|
||||
add_call_argument_snippets: self
|
||||
.feature_flags()
|
||||
.get("completion.insertion.add-argument-snippets"),
|
||||
};
|
||||
self.with_db(|db| completion::completions(db, position, &opts).map(Into::into))
|
||||
pub fn completions(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
options: &CompletionOptions,
|
||||
) -> Cancelable<Option<Vec<CompletionItem>>> {
|
||||
self.with_db(|db| completion::completions(db, position, options).map(Into::into))
|
||||
}
|
||||
|
||||
/// Computes assists (aka code actions aka intentions) for the given
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue