3232
3333namespace ts {
3434 /** The version of the language service API */
35- export const servicesVersion = "0.7 " ;
35+ export const servicesVersion = "0.8 " ;
3636
3737 function createNode < TKind extends SyntaxKind > ( kind : TKind , pos : number , end : number , parent ?: Node ) : NodeObject | TokenObject < TKind > | IdentifierObject {
3838 const node = isNodeKind ( kind ) ? new NodeObject ( kind , pos , end ) :
@@ -1424,7 +1424,13 @@ namespace ts {
14241424 return [ ...program . getOptionsDiagnostics ( cancellationToken ) , ...program . getGlobalDiagnostics ( cancellationToken ) ] ;
14251425 }
14261426
1427- function getCompletionsAtPosition ( fileName : string , position : number , settings : Options = defaultOptions ) : CompletionInfo {
1427+ function getCompletionsAtPosition ( fileName : string , position : number , options : GetCompletionsAtPositionOptions = defaultOptions ) : CompletionInfo {
1428+ // Convert from deprecated options names to new names
1429+ const fullOptions : Options = {
1430+ ...identity < Options > ( options ) , // avoid excess property check
1431+ includeExternalModuleExportsInCompletionList : options . includeExternalModuleExportsInCompletionList || options . includeExternalModuleExports ,
1432+ includeInsertTextCompletionsInCompletionList : options . includeInsertTextCompletionsInCompletionList || options . includeInsertTextCompletions ,
1433+ } ;
14281434 synchronizeHostData ( ) ;
14291435 return Completions . getCompletionsAtPosition (
14301436 host ,
@@ -1434,7 +1440,7 @@ namespace ts {
14341440 getValidSourceFile ( fileName ) ,
14351441 position ,
14361442 program . getSourceFiles ( ) ,
1437- settings ) ;
1443+ fullOptions ) ;
14381444 }
14391445
14401446 function getCompletionEntryDetails ( fileName : string , position : number , name : string , formattingOptions ?: FormatCodeSettings , source ?: string ) : CompletionEntryDetails {
@@ -1814,7 +1820,7 @@ namespace ts {
18141820 return [ ] ;
18151821 }
18161822
1817- function getCodeFixesAtPosition ( fileName : string , start : number , end : number , errorCodes : ReadonlyArray < number > , formatOptions : FormatCodeSettings , options : Options ) : ReadonlyArray < CodeFixAction > {
1823+ function getCodeFixesAtPosition ( fileName : string , start : number , end : number , errorCodes : ReadonlyArray < number > , formatOptions : FormatCodeSettings , options : Options = defaultOptions ) : ReadonlyArray < CodeFixAction > {
18181824 synchronizeHostData ( ) ;
18191825 const sourceFile = getValidSourceFile ( fileName ) ;
18201826 const span = createTextSpanFromBounds ( start , end ) ;
@@ -1826,7 +1832,7 @@ namespace ts {
18261832 } ) ;
18271833 }
18281834
1829- function getCombinedCodeFix ( scope : CombinedCodeFixScope , fixId : { } , formatOptions : FormatCodeSettings , options : Options ) : CombinedCodeActions {
1835+ function getCombinedCodeFix ( scope : CombinedCodeFixScope , fixId : { } , formatOptions : FormatCodeSettings , options : Options = defaultOptions ) : CombinedCodeActions {
18301836 synchronizeHostData ( ) ;
18311837 Debug . assert ( scope . type === "file" ) ;
18321838 const sourceFile = getValidSourceFile ( scope . fileName ) ;
@@ -1835,7 +1841,7 @@ namespace ts {
18351841 return codefix . getAllFixes ( { fixId, sourceFile, program, host, cancellationToken, formatContext, options } ) ;
18361842 }
18371843
1838- function organizeImports ( scope : OrganizeImportsScope , formatOptions : FormatCodeSettings , options : Options ) : ReadonlyArray < FileTextChanges > {
1844+ function organizeImports ( scope : OrganizeImportsScope , formatOptions : FormatCodeSettings , options : Options = defaultOptions ) : ReadonlyArray < FileTextChanges > {
18391845 synchronizeHostData ( ) ;
18401846 Debug . assert ( scope . type === "file" ) ;
18411847 const sourceFile = getValidSourceFile ( scope . fileName ) ;
@@ -2079,7 +2085,7 @@ namespace ts {
20792085 } ;
20802086 }
20812087
2082- function getApplicableRefactors ( fileName : string , positionOrRange : number | TextRange , options : Options ) : ApplicableRefactorInfo [ ] {
2088+ function getApplicableRefactors ( fileName : string , positionOrRange : number | TextRange , options : Options = defaultOptions ) : ApplicableRefactorInfo [ ] {
20832089 synchronizeHostData ( ) ;
20842090 const file = getValidSourceFile ( fileName ) ;
20852091 return refactor . getApplicableRefactors ( getRefactorContext ( file , positionOrRange , options ) ) ;
@@ -2091,7 +2097,7 @@ namespace ts {
20912097 positionOrRange : number | TextRange ,
20922098 refactorName : string ,
20932099 actionName : string ,
2094- options : Options ,
2100+ options : Options = defaultOptions ,
20952101 ) : RefactorEditInfo {
20962102
20972103 synchronizeHostData ( ) ;
0 commit comments