File tree 2 files changed +5
-21
lines changed
2 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -398,9 +398,13 @@ function format(msg: p.RequestMessage): Array<m.Message> {
398
398
extension === c . resiExt
399
399
) ;
400
400
if ( formattedResult . kind === "success" ) {
401
+ let max = code . length ;
401
402
let result : p . TextEdit [ ] = [
402
403
{
403
- range : utils . getSourceRange ( code ) ,
404
+ range : {
405
+ start : { line : 0 , character : 0 } ,
406
+ end : { line : max , character : max } ,
407
+ } ,
404
408
newText : formattedResult . result ,
405
409
} ,
406
410
] ;
Original file line number Diff line number Diff line change @@ -476,23 +476,3 @@ export let parseCompilerLogOutput = (
476
476
477
477
return { done, result } ;
478
478
} ;
479
-
480
- export let getSourceRange = ( source : string ) : p . Range => {
481
- let start = { line : 0 , character : 0 } ;
482
-
483
- // Calculate end position
484
- let len = source . length ;
485
- let line = 1 ;
486
- let colStartIndex = 0 ;
487
-
488
- for ( let i = 0 ; i < len ; i ++ ) {
489
- if ( source [ i ] === "\n" ) {
490
- line ++ ;
491
- colStartIndex = i + 1 ;
492
- }
493
- }
494
-
495
- let end = { line : line , character : len - colStartIndex } ;
496
-
497
- return { start, end } ;
498
- } ;
You can’t perform that action at this time.
0 commit comments