44 *--------------------------------------------------------------------------------------------*/
55'use strict' ;
66
7- import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands' ;
7+ import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands' ;
88import Severity from 'vs/base/common/severity' ;
9- import { isFalsyOrEmpty } from 'vs/base/common/arrays' ;
10- import { IDisposable } from 'vs/base/common/lifecycle' ;
11- import { stringDiff } from 'vs/base/common/diff/diff' ;
9+ import { isFalsyOrEmpty } from 'vs/base/common/arrays' ;
10+ import { IDisposable } from 'vs/base/common/lifecycle' ;
11+ import { stringDiff } from 'vs/base/common/diff/diff' ;
1212import * as modes from 'vs/editor/common/modes' ;
1313import * as types from './extHostTypes' ;
14- import { Position as EditorPosition } from 'vs/platform/editor/common/editor' ;
15- import { IPosition , ISelection , IRange , IDecorationOptions , ISingleEditOperation } from 'vs/editor/common/editorCommon' ;
16- import { IWorkspaceSymbol } from 'vs/workbench/parts/search/common/search' ;
14+ import { Position as EditorPosition } from 'vs/platform/editor/common/editor' ;
15+ import { IPosition , ISelection , IRange , IDecorationOptions , ISingleEditOperation } from 'vs/editor/common/editorCommon' ;
16+ import { IWorkspaceSymbol } from 'vs/workbench/parts/search/common/search' ;
1717import * as vscode from 'vscode' ;
1818import URI from 'vs/base/common/uri' ;
1919import { SaveReason } from 'vs/workbench/parts/files/common/files' ;
@@ -69,8 +69,8 @@ export function toPosition(position: IPosition): types.Position {
6969 return new types . Position ( position . lineNumber - 1 , position . column - 1 ) ;
7070}
7171
72- export function fromPosition ( position : types . Position ) :IPosition {
73- return { lineNumber : position . line + 1 , column : position . character + 1 } ;
72+ export function fromPosition ( position : types . Position ) : IPosition {
73+ return { lineNumber : position . line + 1 , column : position . character + 1 } ;
7474}
7575
7676export function fromDiagnosticSeverity ( value : number ) : Severity {
@@ -118,26 +118,26 @@ export function toViewColumn(position?: EditorPosition): vscode.ViewColumn {
118118 return ;
119119 }
120120 if ( position === EditorPosition . LEFT ) {
121- return < number > types . ViewColumn . One ;
121+ return < number > types . ViewColumn . One ;
122122 } else if ( position === EditorPosition . CENTER ) {
123- return < number > types . ViewColumn . Two ;
123+ return < number > types . ViewColumn . Two ;
124124 } else if ( position === EditorPosition . RIGHT ) {
125- return < number > types . ViewColumn . Three ;
125+ return < number > types . ViewColumn . Three ;
126126 }
127127}
128128
129129function isDecorationOptions ( something : any ) : something is vscode . DecorationOptions {
130130 return ( typeof something . range !== 'undefined' ) ;
131131}
132132
133- function isDecorationOptionsArr ( something : vscode . Range [ ] | vscode . DecorationOptions [ ] ) : something is vscode . DecorationOptions [ ] {
133+ function isDecorationOptionsArr ( something : vscode . Range [ ] | vscode . DecorationOptions [ ] ) : something is vscode . DecorationOptions [ ] {
134134 if ( something . length === 0 ) {
135135 return true ;
136136 }
137137 return isDecorationOptions ( something [ 0 ] ) ? true : false ;
138138}
139139
140- export function fromRangeOrRangeWithMessage ( ranges :vscode . Range [ ] | vscode . DecorationOptions [ ] ) : IDecorationOptions [ ] {
140+ export function fromRangeOrRangeWithMessage ( ranges : vscode . Range [ ] | vscode . DecorationOptions [ ] ) : IDecorationOptions [ ] {
141141 if ( isDecorationOptionsArr ( ranges ) ) {
142142 return ranges . map ( ( r ) : IDecorationOptions => {
143143 return {
@@ -182,8 +182,8 @@ export const TextEdit = {
182182
183183 for ( let j = 0 ; j < changes . length ; j ++ ) {
184184 const { originalStart, originalLength, modifiedStart, modifiedLength} = changes [ j ] ;
185- const start = fromPosition ( < types . Position > document . positionAt ( editOffset + originalStart ) ) ;
186- const end = fromPosition ( < types . Position > document . positionAt ( editOffset + originalStart + originalLength ) ) ;
185+ const start = fromPosition ( < types . Position > document . positionAt ( editOffset + originalStart ) ) ;
186+ const end = fromPosition ( < types . Position > document . positionAt ( editOffset + originalStart + originalLength ) ) ;
187187
188188 result . push ( {
189189 text : modified . substr ( modifiedStart , modifiedLength ) ,
@@ -195,7 +195,7 @@ export const TextEdit = {
195195 return result ;
196196 } ,
197197
198- from ( edit : vscode . TextEdit ) : ISingleEditOperation {
198+ from ( edit : vscode . TextEdit ) : ISingleEditOperation {
199199 return < ISingleEditOperation > {
200200 text : edit . newText ,
201201 range : fromRange ( edit . range )
@@ -443,9 +443,9 @@ export namespace TextDocumentSaveReason {
443443 export function to ( reason : SaveReason ) : vscode . TextDocumentSaveReason {
444444 switch ( reason ) {
445445 case SaveReason . AUTO :
446- return types . TextDocumentSaveReason . Auto ;
446+ return types . TextDocumentSaveReason . AfterDelay ;
447447 case SaveReason . EXPLICIT :
448- return types . TextDocumentSaveReason . Explicit ;
448+ return types . TextDocumentSaveReason . Manual ;
449449 case SaveReason . FOCUS_CHANGE :
450450 case SaveReason . WINDOW_CHANGE :
451451 return types . TextDocumentSaveReason . FocusOut ;
0 commit comments