@@ -132,20 +132,6 @@ namespace ts.server {
132132 return `Content-Length: ${ 1 + len } \r\n\r\n${ json } ${ newLine } ` ;
133133 }
134134
135- /**
136- * Get the compiler options without configFile key
137- * @param options
138- */
139- function getCompilerOptionsWithoutConfigFile ( options : CompilerOptions ) {
140- const result : CompilerOptions = { } ;
141- for ( const option in options ) {
142- if ( option !== "configFile" ) {
143- result [ option ] = options [ option ] ;
144- }
145- }
146- return result ;
147- }
148-
149135 /**
150136 * Allows to schedule next step in multistep operation
151137 */
@@ -1670,39 +1656,19 @@ namespace ts.server {
16701656 } ,
16711657 [ CommandNames . SynchronizeProjectList ] : ( request : protocol . SynchronizeProjectListRequest ) => {
16721658 const result = this . projectService . synchronizeProjectList ( request . arguments . knownProjects ) ;
1673- // Remapping of the result is needed if
1674- // - there are project errors
1675- // - options contain configFile - need to remove it from options before serializing
1676- const shouldRemapProjectFilesWithTSDiagnostics = ( p : ProjectFilesWithTSDiagnostics ) => ( p . projectErrors && ! ! p . projectErrors . length ) || ( p . info && ! ! p . info . options . configFile ) ;
1677- if ( ! some ( result , shouldRemapProjectFilesWithTSDiagnostics ) ) {
1659+ if ( ! result . some ( p => p . projectErrors && p . projectErrors . length !== 0 ) ) {
16781660 return this . requiredResponse ( result ) ;
16791661 }
16801662 const converted = map ( result , p => {
1681- if ( shouldRemapProjectFilesWithTSDiagnostics ( p ) ) {
1682- // Map the project errors
1683- const projectErrors = p . projectErrors && p . projectErrors . length ?
1684- this . convertToDiagnosticsWithLinePosition ( p . projectErrors , /*scriptInfo*/ undefined ) :
1685- p . projectErrors ;
1686-
1687- // Remove the configFile in the options before serializing
1688- const info = p . info && ! ! p . info . options . configFile ?
1689- {
1690- projectName : p . info . projectName ,
1691- isInferred : p . info . isInferred ,
1692- version : p . info . version ,
1693- options : getCompilerOptionsWithoutConfigFile ( p . info . options ) ,
1694- languageServiceDisabled : p . info . languageServiceDisabled
1695- } : p . info ;
1696-
1697- return {
1698- info,
1699- changes : p . changes ,
1700- files : p . files ,
1701- projectErrors
1702- } ;
1663+ if ( ! p . projectErrors || p . projectErrors . length === 0 ) {
1664+ return p ;
17031665 }
1704-
1705- return p ;
1666+ return {
1667+ info : p . info ,
1668+ changes : p . changes ,
1669+ files : p . files ,
1670+ projectErrors : this . convertToDiagnosticsWithLinePosition ( p . projectErrors , /*scriptInfo*/ undefined )
1671+ } ;
17061672 } ) ;
17071673 return this . requiredResponse ( converted ) ;
17081674 } ,
0 commit comments