mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-19 08:40:24 +00:00
Split remaining completion calls on the context kinds
This commit is contained in:
parent
eb9b360752
commit
5c69df93df
6 changed files with 130 additions and 118 deletions
|
@ -2,8 +2,6 @@
|
|||
//!
|
||||
//! Actual logic is implemented in [`crate::completions::postfix`] and [`crate::completions::snippet`] respectively.
|
||||
|
||||
use std::ops::Deref;
|
||||
|
||||
// Feature: User Snippet Completions
|
||||
//
|
||||
// rust-analyzer allows the user to define custom (postfix)-snippets that may depend on items to be accessible for the current scope to be applicable.
|
||||
|
@ -146,8 +144,8 @@ impl Snippet {
|
|||
let (requires, snippet, description) = validate_snippet(snippet, description, requires)?;
|
||||
Some(Snippet {
|
||||
// Box::into doesn't work as that has a Copy bound 😒
|
||||
postfix_triggers: postfix_triggers.iter().map(Deref::deref).map(Into::into).collect(),
|
||||
prefix_triggers: prefix_triggers.iter().map(Deref::deref).map(Into::into).collect(),
|
||||
postfix_triggers: postfix_triggers.iter().map(String::as_str).map(Into::into).collect(),
|
||||
prefix_triggers: prefix_triggers.iter().map(String::as_str).map(Into::into).collect(),
|
||||
scope,
|
||||
snippet,
|
||||
description,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue