File tree Expand file tree Collapse file tree 2 files changed +5
-21
lines changed Expand file tree Collapse file tree 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> {
398398 extension === c . resiExt
399399 ) ;
400400 if ( formattedResult . kind === "success" ) {
401+ let max = code . length ;
401402 let result : p . TextEdit [ ] = [
402403 {
403- range : utils . getSourceRange ( code ) ,
404+ range : {
405+ start : { line : 0 , character : 0 } ,
406+ end : { line : max , character : max } ,
407+ } ,
404408 newText : formattedResult . result ,
405409 } ,
406410 ] ;
Original file line number Diff line number Diff line change @@ -476,23 +476,3 @@ export let parseCompilerLogOutput = (
476476
477477 return { done, result } ;
478478} ;
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