diff options
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r-- | crates/ide_db/src/helpers.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/crates/ide_db/src/helpers.rs b/crates/ide_db/src/helpers.rs index d988588ff..e3e5670f1 100644 --- a/crates/ide_db/src/helpers.rs +++ b/crates/ide_db/src/helpers.rs | |||
@@ -1,9 +1,10 @@ | |||
1 | //! A module with ide helpers for high-level ide features. | 1 | //! A module with ide helpers for high-level ide features. |
2 | use crate::RootDatabase; | 2 | pub mod insert_use; |
3 | |||
3 | use hir::{Crate, Enum, Module, ScopeDef, Semantics, Trait}; | 4 | use hir::{Crate, Enum, Module, ScopeDef, Semantics, Trait}; |
4 | use syntax::ast::{self, make}; | 5 | use syntax::ast::{self, make}; |
5 | 6 | ||
6 | pub mod insert_use; | 7 | use crate::RootDatabase; |
7 | 8 | ||
8 | /// Converts the mod path struct into its ast representation. | 9 | /// Converts the mod path struct into its ast representation. |
9 | pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path { | 10 | pub fn mod_path_to_ast(path: &hir::ModPath) -> ast::Path { |
@@ -201,3 +202,18 @@ pub use prelude::*; | |||
201 | Some(def) | 202 | Some(def) |
202 | } | 203 | } |
203 | } | 204 | } |
205 | |||
206 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
207 | pub struct SnippetCap { | ||
208 | _private: (), | ||
209 | } | ||
210 | |||
211 | impl SnippetCap { | ||
212 | pub const fn new(allow_snippets: bool) -> Option<SnippetCap> { | ||
213 | if allow_snippets { | ||
214 | Some(SnippetCap { _private: () }) | ||
215 | } else { | ||
216 | None | ||
217 | } | ||
218 | } | ||
219 | } | ||