File tree Expand file tree Collapse file tree 2 files changed +42
-41
lines changed Expand file tree Collapse file tree 2 files changed +42
-41
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,47 @@ use ra_syntax::{
40
40
#[ cfg( not( feature = "wasm" ) ) ]
41
41
use rayon:: prelude:: * ;
42
42
43
- use crate :: { ide_db:: RootDatabase , Query } ;
43
+ use crate :: ide_db:: RootDatabase ;
44
+
45
+ #[ derive( Debug ) ]
46
+ pub struct Query {
47
+ query : String ,
48
+ lowercased : String ,
49
+ only_types : bool ,
50
+ libs : bool ,
51
+ exact : bool ,
52
+ limit : usize ,
53
+ }
54
+
55
+ impl Query {
56
+ pub fn new ( query : String ) -> Query {
57
+ let lowercased = query. to_lowercase ( ) ;
58
+ Query {
59
+ query,
60
+ lowercased,
61
+ only_types : false ,
62
+ libs : false ,
63
+ exact : false ,
64
+ limit : usize:: max_value ( ) ,
65
+ }
66
+ }
67
+
68
+ pub fn only_types ( & mut self ) {
69
+ self . only_types = true ;
70
+ }
71
+
72
+ pub fn libs ( & mut self ) {
73
+ self . libs = true ;
74
+ }
75
+
76
+ pub fn exact ( & mut self ) {
77
+ self . exact = true ;
78
+ }
79
+
80
+ pub fn limit ( & mut self , limit : usize ) {
81
+ self . limit = limit
82
+ }
83
+ }
44
84
45
85
#[ salsa:: query_group( SymbolsDatabaseStorage ) ]
46
86
pub ( crate ) trait SymbolsDatabase : hir:: db:: HirDatabase {
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ pub use crate::{
78
78
feature_flags:: FeatureFlags ,
79
79
line_index:: { LineCol , LineIndex } ,
80
80
line_index_utils:: translate_offset_with_edit,
81
+ symbol_index:: Query ,
81
82
} ,
82
83
inlay_hints:: { InlayHint , InlayKind } ,
83
84
references:: {
@@ -103,46 +104,6 @@ pub struct Diagnostic {
103
104
pub severity : Severity ,
104
105
}
105
106
106
- #[ derive( Debug ) ]
107
- pub struct Query {
108
- query : String ,
109
- lowercased : String ,
110
- only_types : bool ,
111
- libs : bool ,
112
- exact : bool ,
113
- limit : usize ,
114
- }
115
-
116
- impl 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
107
/// Info associated with a text range.
147
108
#[ derive( Debug ) ]
148
109
pub struct RangeInfo < T > {
You can’t perform that action at this time.
0 commit comments