@@ -35,7 +35,7 @@ export class TextEditorDecorationType implements vscode.TextEditorDecorationType
3535
3636export interface ITextEditOperation {
3737 range : vscode . Range ;
38- text : string ;
38+ text : string | null ;
3939 forceMoveMarkers : boolean ;
4040}
4141
@@ -105,7 +105,7 @@ export class TextEditorEdit {
105105 this . _pushEdit ( range , null , true ) ;
106106 }
107107
108- private _pushEdit ( range : Range , text : string , forceMoveMarkers : boolean ) : void {
108+ private _pushEdit ( range : Range , text : string | null , forceMoveMarkers : boolean ) : void {
109109 let validRange = this . _document . validateRange ( range ) ;
110110 this . _collectedEdits . push ( {
111111 range : validRange ,
@@ -373,7 +373,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
373373 private _selections : Selection [ ] ;
374374 private _options : ExtHostTextEditorOptions ;
375375 private _visibleRanges : Range [ ] ;
376- private _viewColumn : vscode . ViewColumn ;
376+ private _viewColumn : vscode . ViewColumn | undefined ;
377377 private _disposed : boolean = false ;
378378 private _hasDecorationsForKey : { [ key : string ] : boolean ; } ;
379379
@@ -382,7 +382,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
382382 constructor (
383383 proxy : MainThreadTextEditorsShape , id : string , document : ExtHostDocumentData ,
384384 selections : Selection [ ] , options : IResolvedTextEditorConfiguration ,
385- visibleRanges : Range [ ] , viewColumn : vscode . ViewColumn
385+ visibleRanges : Range [ ] , viewColumn : vscode . ViewColumn | undefined
386386 ) {
387387 this . _proxy = proxy ;
388388 this . _id = id ;
@@ -451,7 +451,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
451451
452452 // ---- view column
453453
454- get viewColumn ( ) : vscode . ViewColumn {
454+ get viewColumn ( ) : vscode . ViewColumn | undefined {
455455 return this . _viewColumn ;
456456 }
457457
@@ -538,7 +538,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
538538 ) ;
539539 }
540540
541- private _trySetSelection ( ) : Promise < vscode . TextEditor > {
541+ private _trySetSelection ( ) : Promise < vscode . TextEditor | null | undefined > {
542542 let selection = this . _selections . map ( TypeConverters . Selection . from ) ;
543543 return this . _runOnProxy ( ( ) => this . _proxy . $trySetSelections ( this . _id , selection ) ) ;
544544 }
@@ -598,7 +598,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
598598 }
599599
600600 // prepare data for serialization
601- let edits : ISingleEditOperation [ ] = editData . edits . map ( ( edit ) => {
601+ const edits = editData . edits . map ( ( edit ) : ISingleEditOperation => {
602602 return {
603603 range : TypeConverters . Range . from ( edit . range ) ,
604604 text : edit . text ,
@@ -620,7 +620,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
620620 let ranges : IRange [ ] ;
621621
622622 if ( ! where || ( Array . isArray ( where ) && where . length === 0 ) ) {
623- ranges = this . _selections . map ( TypeConverters . Range . from ) ;
623+ ranges = this . _selections . map ( range => TypeConverters . Range . from ( range ) ) ;
624624
625625 } else if ( where instanceof Position ) {
626626 const { lineNumber, column } = TypeConverters . Position . from ( where ) ;
@@ -645,7 +645,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
645645
646646 // ---- util
647647
648- private _runOnProxy ( callback : ( ) => Promise < any > ) : Promise < ExtHostTextEditor > {
648+ private _runOnProxy ( callback : ( ) => Promise < any > ) : Promise < ExtHostTextEditor | undefined | null > {
649649 if ( this . _disposed ) {
650650 console . warn ( 'TextEditor is closed/disposed' ) ;
651651 return Promise . resolve ( undefined ) ;
0 commit comments