Skip to content

Commit 0bbbc51

Browse files
committed
Merge branch 'master' into ownJsonParsing
2 parents 236e15a + 65ef51d commit 0bbbc51

1,383 files changed

Lines changed: 57411 additions & 46015 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gulpfile.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,23 +242,21 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea
242242
return true;
243243
}
244244

245+
// Doing tsconfig inheritance manually. https://github.com/ivogabe/gulp-typescript/issues/459
246+
const tsconfigBase = JSON.parse(fs.readFileSync("src/tsconfig-base.json", "utf-8")).compilerOptions;
247+
245248
function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings {
246249
const copy: tsc.Settings = {};
247-
copy.noEmitOnError = true;
248-
copy.noImplicitAny = true;
249-
copy.noImplicitThis = true;
250-
copy.pretty = true;
251-
copy.types = [];
250+
for (const key in tsconfigBase) {
251+
copy[key] = tsconfigBase[key];
252+
}
252253
for (const key in base) {
253254
copy[key] = base[key];
254255
}
255256
if (!useDebugMode) {
256257
if (copy.removeComments === undefined) copy.removeComments = true;
257258
copy.newLine = "lf";
258259
}
259-
else {
260-
copy.preserveConstEnums = true;
261-
}
262260
if (useBuiltCompiler === true) {
263261
copy.typescript = require("./built/local/typescript.js");
264262
}
@@ -330,6 +328,7 @@ const builtGeneratedDiagnosticMessagesJSON = path.join(builtLocalDirectory, "dia
330328
// processDiagnosticMessages script
331329
gulp.task(processDiagnosticMessagesJs, false, [], () => {
332330
const settings: tsc.Settings = getCompilerSettings({
331+
target: "es5",
333332
declaration: false,
334333
removeComments: true,
335334
noResolve: false,
@@ -471,7 +470,10 @@ gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
471470
js.pipe(prependCopyright())
472471
.pipe(sourcemaps.write("."))
473472
.pipe(gulp.dest(".")),
474-
dts.pipe(prependCopyright())
473+
dts.pipe(prependCopyright(/*outputCopyright*/true))
474+
.pipe(insert.transform((content) => {
475+
return content + "\r\nexport = ts;\r\nexport as namespace ts;";
476+
}))
475477
.pipe(gulp.dest("."))
476478
]);
477479
});

Jakefile.js

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ var servicesSources = [
153153
"signatureHelp.ts",
154154
"symbolDisplay.ts",
155155
"transpile.ts",
156+
// Formatting
156157
"formatting/formatting.ts",
157158
"formatting/formattingContext.ts",
158159
"formatting/formattingRequestKind.ts",
@@ -168,36 +169,53 @@ var servicesSources = [
168169
"formatting/rulesMap.ts",
169170
"formatting/rulesProvider.ts",
170171
"formatting/smartIndenter.ts",
171-
"formatting/tokenRange.ts"
172+
"formatting/tokenRange.ts",
173+
// CodeFixes
174+
"codeFixProvider.ts",
175+
"codefixes/fixes.ts",
176+
"codefixes/fixExtendsInterfaceBecomesImplements.ts",
177+
"codefixes/fixClassIncorrectlyImplementsInterface.ts",
178+
"codefixes/fixClassDoesntImplementInheritedAbstractMember.ts",
179+
"codefixes/fixClassSuperMustPrecedeThisAccess.ts",
180+
"codefixes/fixConstructorForDerivedNeedSuperCall.ts",
181+
"codefixes/helpers.ts",
182+
"codefixes/importFixes.ts",
183+
"codefixes/unusedIdentifierFixes.ts"
172184
].map(function (f) {
173185
return path.join(servicesDirectory, f);
174186
}));
175187

176-
var serverCoreSources = [
177-
"types.d.ts",
178-
"shared.ts",
179-
"utilities.ts",
180-
"scriptVersionCache.ts",
181-
"typingsCache.ts",
182-
"scriptInfo.ts",
188+
var baseServerCoreSources = [
189+
"builder.ts",
190+
"editorServices.ts",
183191
"lsHost.ts",
184192
"project.ts",
185-
"editorServices.ts",
186193
"protocol.ts",
194+
"scriptInfo.ts",
195+
"scriptVersionCache.ts",
187196
"session.ts",
188-
"server.ts"
197+
"shared.ts",
198+
"types.ts",
199+
"typingsCache.ts",
200+
"utilities.ts",
189201
].map(function (f) {
190202
return path.join(serverDirectory, f);
191203
});
192204

205+
var serverCoreSources = [
206+
"server.ts"
207+
].map(function (f) {
208+
return path.join(serverDirectory, f);
209+
}).concat(baseServerCoreSources);
210+
193211
var cancellationTokenSources = [
194212
"cancellationToken.ts"
195213
].map(function (f) {
196214
return path.join(cancellationTokenDirectory, f);
197215
});
198216

199217
var typingsInstallerSources = [
200-
"../types.d.ts",
218+
"../types.ts",
201219
"../shared.ts",
202220
"typingsInstaller.ts",
203221
"nodeTypingsInstaller.ts"
@@ -206,20 +224,7 @@ var typingsInstallerSources = [
206224
});
207225

208226
var serverSources = serverCoreSources.concat(servicesSources);
209-
210-
var languageServiceLibrarySources = [
211-
"protocol.ts",
212-
"utilities.ts",
213-
"scriptVersionCache.ts",
214-
"scriptInfo.ts",
215-
"lsHost.ts",
216-
"project.ts",
217-
"editorServices.ts",
218-
"session.ts",
219-
220-
].map(function (f) {
221-
return path.join(serverDirectory, f);
222-
}).concat(servicesSources);
227+
var languageServiceLibrarySources = baseServerCoreSources.concat(servicesSources);
223228

224229
var harnessCoreSources = [
225230
"harness.ts",
@@ -717,7 +722,18 @@ compileFile(
717722
[builtLocalDirectory, copyright, builtLocalCompiler].concat(languageServiceLibrarySources).concat(libraryTargets),
718723
/*prefixes*/[copyright],
719724
/*useBuiltCompiler*/ true,
720-
{ noOutFile: false, generateDeclarations: true });
725+
{ noOutFile: false, generateDeclarations: true, stripInternal: true },
726+
/*callback*/ function () {
727+
prependFile(copyright, tsserverLibraryDefinitionFile);
728+
729+
// Appending exports at the end of the server library
730+
var tsserverLibraryDefinitionFileContents =
731+
fs.readFileSync(tsserverLibraryDefinitionFile).toString() +
732+
"\r\nexport = ts;" +
733+
"\r\nexport as namespace ts;";
734+
735+
fs.writeFileSync(tsserverLibraryDefinitionFile, tsserverLibraryDefinitionFileContents);
736+
});
721737

722738
// Local target to build the language service server library
723739
desc("Builds language service server library");
@@ -1181,7 +1197,6 @@ task("update-sublime", ["local", serverFile], function () {
11811197
var tslintRuleDir = "scripts/tslint";
11821198
var tslintRules = [
11831199
"nextLineRule",
1184-
"preferConstRule",
11851200
"booleanTriviaRule",
11861201
"typeOperatorSpacingRule",
11871202
"noInOperatorRule",

lib/lib.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,9 @@ interface Array<T> {
11911191
/**
11921192
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
11931193
* @param start The zero-based location in the array from which to start removing elements.
1194+
* @param deleteCount The number of elements to remove.
11941195
*/
1195-
splice(start: number): T[];
1196+
splice(start: number, deleteCount?: number): T[];
11961197
/**
11971198
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
11981199
* @param start The zero-based location in the array from which to start removing elements.

lib/lib.es5.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,9 @@ interface Array<T> {
11911191
/**
11921192
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
11931193
* @param start The zero-based location in the array from which to start removing elements.
1194+
* @param deleteCount The number of elements to remove.
11941195
*/
1195-
splice(start: number): T[];
1196+
splice(start: number, deleteCount?: number): T[];
11961197
/**
11971198
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
11981199
* @param start The zero-based location in the array from which to start removing elements.

lib/lib.es6.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,9 @@ interface Array<T> {
11911191
/**
11921192
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
11931193
* @param start The zero-based location in the array from which to start removing elements.
1194+
* @param deleteCount The number of elements to remove.
11941195
*/
1195-
splice(start: number): T[];
1196+
splice(start: number, deleteCount?: number): T[];
11961197
/**
11971198
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
11981199
* @param start The zero-based location in the array from which to start removing elements.

lib/protocol.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,12 +1722,14 @@ declare namespace ts.server.protocol {
17221722
insertSpaceAfterCommaDelimiter?: boolean;
17231723
insertSpaceAfterSemicolonInForStatements?: boolean;
17241724
insertSpaceBeforeAndAfterBinaryOperators?: boolean;
1725+
insertSpaceAfterConstructor?: boolean;
17251726
insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
17261727
insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
17271728
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
17281729
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
17291730
insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
17301731
insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
1732+
insertSpaceBeforeFunctionParenthesis?: boolean;
17311733
placeOpenBraceOnNewLineForFunctions?: boolean;
17321734
placeOpenBraceOnNewLineForControlBlocks?: boolean;
17331735
}

0 commit comments

Comments
 (0)