mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Align config's API with usage
The config now is mostly immutable, optimize for that.
This commit is contained in:
parent
7ae4b8bdb6
commit
f8a0561178
22 changed files with 164 additions and 162 deletions
|
@ -1,9 +1,10 @@
|
|||
//! A module with ide helpers for high-level ide features.
|
||||
use crate::RootDatabase;
|
||||
pub mod insert_use;
|
||||
|
||||
use hir::{Crate, Enum, Module, ScopeDef, Semantics, Trait};
|
||||
use syntax::ast::{self, make};
|
||||
|
||||
pub mod insert_use;
|
||||
use crate::RootDatabase;
|
||||
|
||||
/// Converts the mod path struct into its ast representation.
|
||||
pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path {
|
||||
|
@ -201,3 +202,18 @@ pub use prelude::*;
|
|||
Some(def)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub struct SnippetCap {
|
||||
_private: (),
|
||||
}
|
||||
|
||||
impl SnippetCap {
|
||||
pub const fn new(allow_snippets: bool) -> Option<SnippetCap> {
|
||||
if allow_snippets {
|
||||
Some(SnippetCap { _private: () })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue