@@ -151,6 +151,7 @@ var servicesSources = [
151151 "signatureHelp.ts" ,
152152 "symbolDisplay.ts" ,
153153 "transpile.ts" ,
154+ // Formatting
154155 "formatting/formatting.ts" ,
155156 "formatting/formattingContext.ts" ,
156157 "formatting/formattingRequestKind.ts" ,
@@ -166,36 +167,53 @@ var servicesSources = [
166167 "formatting/rulesMap.ts" ,
167168 "formatting/rulesProvider.ts" ,
168169 "formatting/smartIndenter.ts" ,
169- "formatting/tokenRange.ts"
170+ "formatting/tokenRange.ts" ,
171+ // CodeFixes
172+ "codeFixProvider.ts" ,
173+ "codefixes/fixes.ts" ,
174+ "codefixes/fixExtendsInterfaceBecomesImplements.ts" ,
175+ "codefixes/fixClassIncorrectlyImplementsInterface.ts" ,
176+ "codefixes/fixClassDoesntImplementInheritedAbstractMember.ts" ,
177+ "codefixes/fixClassSuperMustPrecedeThisAccess.ts" ,
178+ "codefixes/fixConstructorForDerivedNeedSuperCall.ts" ,
179+ "codefixes/helpers.ts" ,
180+ "codefixes/importFixes.ts" ,
181+ "codefixes/unusedIdentifierFixes.ts"
170182] . map ( function ( f ) {
171183 return path . join ( servicesDirectory , f ) ;
172184} ) ) ;
173185
174- var serverCoreSources = [
175- "types.d.ts" ,
176- "shared.ts" ,
177- "utilities.ts" ,
178- "scriptVersionCache.ts" ,
179- "typingsCache.ts" ,
180- "scriptInfo.ts" ,
186+ var baseServerCoreSources = [
187+ "builder.ts" ,
188+ "editorServices.ts" ,
181189 "lsHost.ts" ,
182190 "project.ts" ,
183- "editorServices.ts" ,
184191 "protocol.ts" ,
192+ "scriptInfo.ts" ,
193+ "scriptVersionCache.ts" ,
185194 "session.ts" ,
186- "server.ts"
195+ "shared.ts" ,
196+ "types.ts" ,
197+ "typingsCache.ts" ,
198+ "utilities.ts" ,
187199] . map ( function ( f ) {
188200 return path . join ( serverDirectory , f ) ;
189201} ) ;
190202
203+ var serverCoreSources = [
204+ "server.ts"
205+ ] . map ( function ( f ) {
206+ return path . join ( serverDirectory , f ) ;
207+ } ) . concat ( baseServerCoreSources ) ;
208+
191209var cancellationTokenSources = [
192210 "cancellationToken.ts"
193211] . map ( function ( f ) {
194212 return path . join ( cancellationTokenDirectory , f ) ;
195213} ) ;
196214
197215var typingsInstallerSources = [
198- "../types.d. ts" ,
216+ "../types.ts" ,
199217 "../shared.ts" ,
200218 "typingsInstaller.ts" ,
201219 "nodeTypingsInstaller.ts"
@@ -204,20 +222,7 @@ var typingsInstallerSources = [
204222} ) ;
205223
206224var serverSources = serverCoreSources . concat ( servicesSources ) ;
207-
208- var languageServiceLibrarySources = [
209- "protocol.ts" ,
210- "utilities.ts" ,
211- "scriptVersionCache.ts" ,
212- "scriptInfo.ts" ,
213- "lsHost.ts" ,
214- "project.ts" ,
215- "editorServices.ts" ,
216- "session.ts" ,
217-
218- ] . map ( function ( f ) {
219- return path . join ( serverDirectory , f ) ;
220- } ) . concat ( servicesSources ) ;
225+ var languageServiceLibrarySources = baseServerCoreSources . concat ( servicesSources ) ;
221226
222227var harnessCoreSources = [
223228 "harness.ts" ,
@@ -250,6 +255,7 @@ var harnessSources = harnessCoreSources.concat([
250255 "convertToBase64.ts" ,
251256 "transpile.ts" ,
252257 "reuseProgramStructure.ts" ,
258+ "textStorage.ts" ,
253259 "cachingInServerLSHost.ts" ,
254260 "moduleResolution.ts" ,
255261 "tsconfigParsing.ts" ,
@@ -352,19 +358,16 @@ function prependFile(prefixFile, destinationFile) {
352358// concatenate a list of sourceFiles to a destinationFile
353359function concatenateFiles ( destinationFile , sourceFiles ) {
354360 var temp = "temptemp" ;
355- // Copy the first file to temp
356- if ( ! fs . existsSync ( sourceFiles [ 0 ] ) ) {
357- fail ( sourceFiles [ 0 ] + " does not exist!" ) ;
358- }
359- jake . cpR ( sourceFiles [ 0 ] , temp , { silent : true } ) ;
360361 // append all files in sequence
361- for ( var i = 1 ; i < sourceFiles . length ; i ++ ) {
362+ var text = "" ;
363+ for ( var i = 0 ; i < sourceFiles . length ; i ++ ) {
362364 if ( ! fs . existsSync ( sourceFiles [ i ] ) ) {
363365 fail ( sourceFiles [ i ] + " does not exist!" ) ;
364366 }
365- fs . appendFileSync ( temp , "\n\n" ) ;
366- fs . appendFileSync ( temp , fs . readFileSync ( sourceFiles [ i ] ) ) ;
367+ if ( i > 0 ) { text += "\n\n" ; }
368+ text += fs . readFileSync ( sourceFiles [ i ] ) . toString ( ) . replace ( / \r ? \n / g , "\n" ) ;
367369 }
370+ fs . writeFileSync ( temp , text ) ;
368371 // Move the file to the final destination
369372 fs . renameSync ( temp , destinationFile ) ;
370373}
@@ -717,7 +720,18 @@ compileFile(
717720 [ builtLocalDirectory , copyright , builtLocalCompiler ] . concat ( languageServiceLibrarySources ) . concat ( libraryTargets ) ,
718721 /*prefixes*/ [ copyright ] ,
719722 /*useBuiltCompiler*/ true ,
720- { noOutFile : false , generateDeclarations : true } ) ;
723+ { noOutFile : false , generateDeclarations : true , stripInternal : true } ,
724+ /*callback*/ function ( ) {
725+ prependFile ( copyright , tsserverLibraryDefinitionFile ) ;
726+
727+ // Appending exports at the end of the server library
728+ var tsserverLibraryDefinitionFileContents =
729+ fs . readFileSync ( tsserverLibraryDefinitionFile ) . toString ( ) +
730+ "\r\nexport = ts;" +
731+ "\r\nexport as namespace ts;" ;
732+
733+ fs . writeFileSync ( tsserverLibraryDefinitionFile , tsserverLibraryDefinitionFileContents ) ;
734+ } ) ;
721735
722736// Local target to build the language service server library
723737desc ( "Builds language service server library" ) ;
@@ -1181,7 +1195,6 @@ task("update-sublime", ["local", serverFile], function () {
11811195var tslintRuleDir = "scripts/tslint" ;
11821196var tslintRules = [
11831197 "nextLineRule" ,
1184- "preferConstRule" ,
11851198 "booleanTriviaRule" ,
11861199 "typeOperatorSpacingRule" ,
11871200 "noInOperatorRule" ,
0 commit comments