File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
crates/pg_completions/src/providers Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,15 @@ use crate::{
6
6
pub fn complete_functions ( ctx : & CompletionContext , builder : & mut CompletionBuilder ) {
7
7
let available_functions = & ctx. schema_cache . functions ;
8
8
9
- let completion_items: Vec < CompletionItem > = available_functions
10
- . iter ( )
11
- . map ( |foo| CompletionItem {
9
+ for foo in available_functions {
10
+ let item = CompletionItem {
12
11
label : foo. name . clone ( ) ,
13
12
score : CompletionRelevanceData :: Function ( foo) . get_score ( ctx) ,
14
13
description : format ! ( "Schema: {}" , foo. schema) ,
15
14
preselected : false ,
16
15
kind : CompletionItemKind :: Function ,
17
- } )
18
- . collect ( ) ;
16
+ } ;
19
17
20
- for item in completion_items {
21
18
builder. add_item ( item) ;
22
19
}
23
20
}
Original file line number Diff line number Diff line change @@ -8,18 +8,15 @@ use crate::{
8
8
pub fn complete_tables ( ctx : & CompletionContext , builder : & mut CompletionBuilder ) {
9
9
let available_tables = & ctx. schema_cache . tables ;
10
10
11
- let completion_items: Vec < CompletionItem > = available_tables
12
- . iter ( )
13
- . map ( |table| CompletionItem {
11
+ for table in available_tables {
12
+ let item = CompletionItem {
14
13
label : table. name . clone ( ) ,
15
14
score : CompletionRelevanceData :: Table ( table) . get_score ( ctx) ,
16
15
description : format ! ( "Schema: {}" , table. schema) ,
17
16
preselected : false ,
18
17
kind : CompletionItemKind :: Table ,
19
- } )
20
- . collect ( ) ;
18
+ } ;
21
19
22
- for item in completion_items {
23
20
builder. add_item ( item) ;
24
21
}
25
22
}
You can’t perform that action at this time.
0 commit comments