File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
pgt_treesitter/src/context Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ pub fn complete(params: CompletionParams) -> Vec<CompletionItem> {
35
35
tree : & sanitized_params. tree ,
36
36
} ) ;
37
37
38
- println ! ( "{:#?}" , ctx) ;
39
-
40
38
let mut builder = CompletionBuilder :: new ( & ctx) ;
41
39
42
40
complete_tables ( & ctx, sanitized_params. schema , & mut builder) ;
Original file line number Diff line number Diff line change @@ -432,9 +432,12 @@ impl<'a> TreesitterContext<'a> {
432
432
. nth ( self . position )
433
433
. is_some_and ( |c| !c. is_ascii_whitespace ( ) && !& [ ';' , ')' ] . contains ( & c) )
434
434
{
435
- self . position = cmp:: min ( self . position + 1 , self . text . len ( ) ) ;
435
+ self . position = cmp:: min ( self . position , self . text . len ( ) . saturating_sub ( 1 ) ) ;
436
436
} else {
437
- self . position = cmp:: min ( self . position , self . text . len ( ) ) ;
437
+ self . position = cmp:: min (
438
+ self . position . saturating_sub ( 1 ) ,
439
+ self . text . len ( ) . saturating_sub ( 1 ) ,
440
+ ) ;
438
441
}
439
442
440
443
cursor. goto_first_child_for_byte ( self . position ) ;
You can’t perform that action at this time.
0 commit comments