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::{
66pub fn complete_functions ( ctx : & CompletionContext , builder : & mut CompletionBuilder ) {
77 let available_functions = & ctx. schema_cache . functions ;
88
9- let completion_items: Vec < CompletionItem > = available_functions
10- . iter ( )
11- . map ( |foo| CompletionItem {
9+ for foo in available_functions {
10+ let item = CompletionItem {
1211 label : foo. name . clone ( ) ,
1312 score : CompletionRelevanceData :: Function ( foo) . get_score ( ctx) ,
1413 description : format ! ( "Schema: {}" , foo. schema) ,
1514 preselected : false ,
1615 kind : CompletionItemKind :: Function ,
17- } )
18- . collect ( ) ;
16+ } ;
1917
20- for item in completion_items {
2118 builder. add_item ( item) ;
2219 }
2320}
Original file line number Diff line number Diff line change @@ -8,18 +8,15 @@ use crate::{
88pub fn complete_tables ( ctx : & CompletionContext , builder : & mut CompletionBuilder ) {
99 let available_tables = & ctx. schema_cache . tables ;
1010
11- let completion_items: Vec < CompletionItem > = available_tables
12- . iter ( )
13- . map ( |table| CompletionItem {
11+ for table in available_tables {
12+ let item = CompletionItem {
1413 label : table. name . clone ( ) ,
1514 score : CompletionRelevanceData :: Table ( table) . get_score ( ctx) ,
1615 description : format ! ( "Schema: {}" , table. schema) ,
1716 preselected : false ,
1817 kind : CompletionItemKind :: Table ,
19- } )
20- . collect ( ) ;
18+ } ;
2119
22- for item in completion_items {
2320 builder. add_item ( item) ;
2421 }
2522}
You can’t perform that action at this time.
0 commit comments