aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/lib.rs')
-rw-r--r--crates/ra_ide/src/lib.rs41
1 files changed, 1 insertions, 40 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 3926bc00f..109b5ad9f 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -78,6 +78,7 @@ pub use crate::{
78 feature_flags::FeatureFlags, 78 feature_flags::FeatureFlags,
79 line_index::{LineCol, LineIndex}, 79 line_index::{LineCol, LineIndex},
80 line_index_utils::translate_offset_with_edit, 80 line_index_utils::translate_offset_with_edit,
81 symbol_index::Query,
81 }, 82 },
82 inlay_hints::{InlayHint, InlayKind}, 83 inlay_hints::{InlayHint, InlayKind},
83 references::{ 84 references::{
@@ -103,46 +104,6 @@ pub struct Diagnostic {
103 pub severity: Severity, 104 pub severity: Severity,
104} 105}
105 106
106#[derive(Debug)]
107pub struct Query {
108 query: String,
109 lowercased: String,
110 only_types: bool,
111 libs: bool,
112 exact: bool,
113 limit: usize,
114}
115
116impl Query {
117 pub fn new(query: String) -> Query {
118 let lowercased = query.to_lowercase();
119 Query {
120 query,
121 lowercased,
122 only_types: false,
123 libs: false,
124 exact: false,
125 limit: usize::max_value(),
126 }
127 }
128
129 pub fn only_types(&mut self) {
130 self.only_types = true;
131 }
132
133 pub fn libs(&mut self) {
134 self.libs = true;
135 }
136
137 pub fn exact(&mut self) {
138 self.exact = true;
139 }
140
141 pub fn limit(&mut self, limit: usize) {
142 self.limit = limit
143 }
144}
145
146/// Info associated with a text range. 107/// Info associated with a text range.
147#[derive(Debug)] 108#[derive(Debug)]
148pub struct RangeInfo<T> { 109pub struct RangeInfo<T> {