File tree Expand file tree Collapse file tree 4 files changed +3
-28
lines changed
pg_workspace_new/src/workspace/server Expand file tree Collapse file tree 4 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use anyhow::Result;
3
3
use pg_workspace_new:: workspace;
4
4
use tower_lsp:: lsp_types:: { self , CompletionItem , CompletionItemLabelDetails } ;
5
5
6
- #[ tracing:: instrument( level = "debug " , skip_all) ]
6
+ #[ tracing:: instrument( level = "info " , skip_all) ]
7
7
pub fn get_completions (
8
8
session : & Session ,
9
9
params : lsp_types:: CompletionParams ,
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ impl LanguageServer for LSPServer {
238
238
. ok ( ) ;
239
239
}
240
240
241
- #[ tracing:: instrument( level = "trace " , skip( self ) ) ]
241
+ #[ tracing:: instrument( level = "info " , skip( self ) ) ]
242
242
async fn completion ( & self , params : CompletionParams ) -> LspResult < Option < CompletionResponse > > {
243
243
match handlers:: completions:: get_completions ( & self . session , params) {
244
244
Ok ( result) => LspResult :: Ok ( Some ( result) ) ,
Original file line number Diff line number Diff line change @@ -81,31 +81,6 @@ impl Document {
81
81
. collect ( )
82
82
}
83
83
84
- pub fn line_and_col_to_offset ( & self , line : u32 , col : u32 ) -> TextSize {
85
- let line = line as usize ;
86
- let pos = col as usize ;
87
-
88
- let mut offset: usize = 0 ;
89
-
90
- for ( current_line_num, current_line) in self . content . lines ( ) . enumerate ( ) {
91
- let current_line_num = current_line_num + 1 ;
92
- if current_line_num < line {
93
- offset += current_line. len ( ) ;
94
- } else if current_line_num == line {
95
- offset += pos;
96
- } ;
97
- }
98
-
99
- // Normalize in case we exceed the length of the content
100
- if offset > self . content . len ( ) {
101
- offset = self . content . len ( )
102
- }
103
-
104
- let offset = u32:: try_from ( offset) . expect ( "Offset should be within u32 bounds" ) ;
105
-
106
- TextSize :: from ( offset)
107
- }
108
-
109
84
#[ allow( dead_code) ]
110
85
/// Returns the statement ref at the given offset
111
86
pub fn statement_ref_at_offset ( & self , offset : & TextSize ) -> Option < StatementRef > {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ ignore = []
8
8
9
9
[db ]
10
10
host = " 127.0.0.1"
11
- port = 54322
11
+ port = 5432
12
12
username = " postgres"
13
13
password = " postgres"
14
14
database = " postgres"
You can’t perform that action at this time.
0 commit comments