File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,11 @@ module TypeScript.Services.Formatting {
112
112
113
113
//
114
114
// TODO: Change the ILanguageService interface to return TextEditInfo (with start, and length) instead of TextEdit (with minChar and limChar)
115
- formattingEdits . forEach ( ( item ) => {
116
- var edit = new ts . TextChange ( new TextSpan ( item . position , item . length ) , item . replaceWith ) ;
117
- result . push ( edit ) ;
115
+ formattingEdits . forEach ( item => {
116
+ result . push ( {
117
+ span : new TextSpan ( item . position , item . length ) ,
118
+ newText : item . replaceWith
119
+ } ) ;
118
120
} ) ;
119
121
120
122
return result ;
Original file line number Diff line number Diff line change @@ -731,18 +731,8 @@ module ts {
731
731
}
732
732
733
733
export class TextChange {
734
- constructor ( public span : TypeScript . TextSpan , public newText : string ) {
735
- }
736
-
737
- static createInsert ( pos : number , newText : string ) : TextChange {
738
- return new TextChange ( new TypeScript . TextSpan ( pos , 0 ) , newText ) ;
739
- }
740
- static createDelete ( start : number , end : number ) : TextChange {
741
- return new TextChange ( TypeScript . TextSpan . fromBounds ( start , end ) , "" ) ;
742
- }
743
- static createReplace ( start : number , end : number , newText : string ) : TextChange {
744
- return new TextChange ( TypeScript . TextSpan . fromBounds ( start , end ) , newText ) ;
745
- }
734
+ span : TypeScript . TextSpan ;
735
+ newText : string ;
746
736
}
747
737
748
738
export interface ReferenceEntry {
You can’t perform that action at this time.
0 commit comments