Skip to content

Commit

Permalink
2016-09-02 [ci skip] Version: 1.201609020105.1+8038eb943e6509a5da3377…
Browse files Browse the repository at this point in the history
…853ca04986bededbb1
  • Loading branch information
basarat committed Sep 2, 2016
1 parent 659b7dc commit a080ee9
Show file tree
Hide file tree
Showing 14 changed files with 633 additions and 135 deletions.
2 changes: 1 addition & 1 deletion TypeScript
Submodule TypeScript updated 89 files
+2 −2 src/compiler/checker.ts
+28 −9 src/compiler/core.ts
+2 −5 src/compiler/sys.ts
+1 −4 src/compiler/tsc.ts
+22 −3 src/compiler/utilities.ts
+3 −3 src/harness/fourslash.ts
+1 −1 src/harness/harness.ts
+0 −79 src/harness/unittests/services/formatting/testCode/testCode/formatting/classes.ts
+0 −79 src/harness/unittests/services/formatting/testCode/testCode/formatting/classesBaseline.ts
+0 −4 src/harness/unittests/services/formatting/testCode/testCode/formatting/colonAndQMark.ts
+0 −4 src/harness/unittests/services/formatting/testCode/testCode/formatting/colonAndQMarkBaseline.ts
+0 −3 src/harness/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunction.ts
+0 −3 src/harness/unittests/services/formatting/testCode/testCode/formatting/documentReadyFunctionBaseLine.ts
+0 −1 src/harness/unittests/services/formatting/testCode/testCode/formatting/emptyBlock.ts
+0 −1 src/harness/unittests/services/formatting/testCode/testCode/formatting/emptyBlockBaseline.ts
+0 −10 src/harness/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteral.ts
+0 −10 src/harness/unittests/services/formatting/testCode/testCode/formatting/emptyInterfaceLiteralBaseLine.ts
+0 −112 src/harness/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctions.ts
+0 −112 src/harness/unittests/services/formatting/testCode/testCode/formatting/fatArrowFunctionsBaseline.ts
+0 −2 src/harness/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatement.ts
+0 −2 src/harness/unittests/services/formatting/testCode/testCode/formatting/formatDebuggerStatementBaseline.ts
+0 −13 src/harness/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationList.ts
+0 −13 ...harness/unittests/services/formatting/testCode/testCode/formatting/formatvariableDeclarationListBaseline.ts
+0 −3 src/harness/unittests/services/formatting/testCode/testCode/formatting/implicitModule.ts
+0 −3 src/harness/unittests/services/formatting/testCode/testCode/formatting/implicitModuleBaseline.ts
+0 −6 src/harness/unittests/services/formatting/testCode/testCode/formatting/importDeclaration.ts
+0 −6 src/harness/unittests/services/formatting/testCode/testCode/formatting/importDeclarationBaseline.ts
+0 −95 src/harness/unittests/services/formatting/testCode/testCode/formatting/main.ts
+0 −98 src/harness/unittests/services/formatting/testCode/testCode/formatting/mainBaseline.ts
+0 −3 src/harness/unittests/services/formatting/testCode/testCode/formatting/moduleIndentation.ts
+0 −3 src/harness/unittests/services/formatting/testCode/testCode/formatting/moduleIndentationBaseline.ts
+0 −76 src/harness/unittests/services/formatting/testCode/testCode/formatting/modules.ts
+0 −76 src/harness/unittests/services/formatting/testCode/testCode/formatting/modulesBaseline.ts
+0 −27 src/harness/unittests/services/formatting/testCode/testCode/formatting/objectLiteral.ts
+0 −31 src/harness/unittests/services/formatting/testCode/testCode/formatting/objectLiteralBaseline.ts
+0 −32 src/harness/unittests/services/formatting/testCode/testCode/formatting/onClosingBracket.ts
+0 −28 src/harness/unittests/services/formatting/testCode/testCode/formatting/onClosingBracketBaseLine.ts
+0 −1 src/harness/unittests/services/formatting/testCode/testCode/formatting/onSemiColon.ts
+0 −1 src/harness/unittests/services/formatting/testCode/testCode/formatting/onSemiColonBaseline.ts
+0 −1 src/harness/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructor.ts
+0 −1 src/harness/unittests/services/formatting/testCode/testCode/formatting/spaceAfterConstructorBaseline.ts
+0 −10 src/harness/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurly.ts
+0 −9 src/harness/unittests/services/formatting/testCode/testCode/formatting/tabAfterCloseCurlyBaseline.ts
+0 −65 src/harness/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructs.ts
+0 −58 src/harness/unittests/services/formatting/testCode/testCode/formatting/typescriptConstructsBaseline.ts
+0 −17 src/harness/unittests/services/formatting/testCode/testCode/formatting/various.ts
+0 −17 src/harness/unittests/services/formatting/testCode/testCode/formatting/variousBaseline.ts
+0 −9 src/harness/unittests/services/formatting/testCode/testCode/formatting/withStatement.ts
+0 −6 src/harness/unittests/services/formatting/testCode/testCode/formatting/withStatementBaseline.ts
+5 −10 src/harness/unittests/tsserverProjectSystem.ts
+6 −16 src/server/editorServices.ts
+2 −2 src/server/server.ts
+1 −0 src/services/navigationBar.ts
+160 −19 src/services/services.ts
+0 −3 tests/cases/fourslash/cloduleAsBaseClass.ts
+0 −3 tests/cases/fourslash/cloduleAsBaseClass2.ts
+0 −4 tests/cases/fourslash/cloduleTypeOf1.ts
+0 −3 tests/cases/fourslash/cloduleWithRecursiveReference.ts
+0 −3 tests/cases/fourslash/commentsClass.ts
+0 −3 tests/cases/fourslash/commentsExternalModules.ts
+0 −2 tests/cases/fourslash/commentsMultiModuleMultiFile.ts
+0 −3 tests/cases/fourslash/commentsMultiModuleSingleFile.ts
+0 −3 tests/cases/fourslash/completionListAtEOF.ts
+0 −3 tests/cases/fourslash/completionListCladule.ts
+0 −3 tests/cases/fourslash/completionListErrorRecovery.ts
+0 −3 tests/cases/fourslash/completionListErrorRecovery2.ts
+0 −3 tests/cases/fourslash/contextualTyping.ts
+0 −3 tests/cases/fourslash/extendInterfaceOverloadedMethod.ts
+46 −0 tests/cases/fourslash/findAllReferencesOfConstructor.ts
+8 −0 tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts
+0 −3 tests/cases/fourslash/funduleWithRecursiveReference.ts
+0 −3 tests/cases/fourslash/genericCombinators1.ts
+0 −3 tests/cases/fourslash/genericCombinators2.ts
+22 −0 tests/cases/fourslash/goToDeclarationDecoratorOverloads.ts
+2 −2 tests/cases/fourslash/goToDefinitionConstructorOverloads.ts
+9 −4 tests/cases/fourslash/goToDefinitionFunctionOverloads.ts
+0 −3 tests/cases/fourslash/goToDefinitionFunctionOverloadsInClass.ts
+11 −11 tests/cases/fourslash/goToDefinitionMethodOverloads.ts
+16 −0 tests/cases/fourslash/goToDefinitionOverloadsInMultiplePropertyAccesses.ts
+0 −3 tests/cases/fourslash/goToDefinitionPartialImplementation.ts
+16 −0 tests/cases/fourslash/goToDefinitionTaggedTemplateOverloads.ts
+33 −0 tests/cases/fourslash/goToDefinition_super.ts
+0 −3 tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts
+11 −0 tests/cases/fourslash/navigationBarAnonymousClassAndFunctionExpressions.ts
+46 −0 tests/cases/fourslash/navigationBarFunctionIndirectlyInVariableDeclaration.ts
+0 −3 tests/cases/fourslash/quickInfoInFunctionTypeReference.ts
+0 −3 tests/cases/fourslash/quickInfoOnConstructorWithGenericParameter.ts
+0 −3 tests/cases/fourslash/signatureHelpForSuperCalls1.ts
+0 −3 tests/cases/fourslash/signatureHelpSimpleSuperCall.ts
11 changes: 9 additions & 2 deletions bin/ntypescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2513,8 +2513,12 @@ declare namespace ts {
function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void;
function fail(message?: string): void;
}
function copyListRemovingItem<T>(item: T, list: T[]): T[];
function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string;
/** Remove an item from an array, moving everything to its right one space left. */
function orderedRemoveItemAt<T>(array: T[], index: number): void;
function unorderedRemoveItemAt<T>(array: T[], index: number): void;
/** Remove the *first* occurrence of `item` from the array. */
function unorderedRemoveItem<T>(array: T[], item: T): void;
function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (fileName: string) => string;
}
declare namespace ts {
type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
Expand Down Expand Up @@ -2672,6 +2676,7 @@ declare namespace ts {
*/
function isSuperPropertyOrElementAccess(node: Node): boolean;
function getEntityNameFromTypeNode(node: TypeNode): EntityNameOrEntityNameExpression;
function isCallLikeExpression(node: Node): node is CallLikeExpression;
function getInvokedExpression(node: CallLikeExpression): Expression;
function nodeCanBeDecorated(node: Node): boolean;
function nodeIsDecorated(node: Node): boolean;
Expand Down Expand Up @@ -2848,6 +2853,8 @@ declare namespace ts {
function modifierToFlag(token: SyntaxKind): NodeFlags;
function isLeftHandSideExpression(expr: Expression): boolean;
function isAssignmentOperator(token: SyntaxKind): boolean;
/** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */
function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined;
function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean;
function isEntityNameExpression(node: Expression): node is EntityNameExpression;
function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean;
Expand Down
241 changes: 198 additions & 43 deletions bin/ntypescript.js

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions bin/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2513,8 +2513,12 @@ declare namespace ts {
function assert(expression: boolean, message?: string, verboseDebugInfo?: () => string): void;
function fail(message?: string): void;
}
function copyListRemovingItem<T>(item: T, list: T[]): T[];
function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string;
/** Remove an item from an array, moving everything to its right one space left. */
function orderedRemoveItemAt<T>(array: T[], index: number): void;
function unorderedRemoveItemAt<T>(array: T[], index: number): void;
/** Remove the *first* occurrence of `item` from the array. */
function unorderedRemoveItem<T>(array: T[], item: T): void;
function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (fileName: string) => string;
}
declare namespace ts {
type FileWatcherCallback = (fileName: string, removed?: boolean) => void;
Expand Down Expand Up @@ -2672,6 +2676,7 @@ declare namespace ts {
*/
function isSuperPropertyOrElementAccess(node: Node): boolean;
function getEntityNameFromTypeNode(node: TypeNode): EntityNameOrEntityNameExpression;
function isCallLikeExpression(node: Node): node is CallLikeExpression;
function getInvokedExpression(node: CallLikeExpression): Expression;
function nodeCanBeDecorated(node: Node): boolean;
function nodeIsDecorated(node: Node): boolean;
Expand Down Expand Up @@ -2848,6 +2853,8 @@ declare namespace ts {
function modifierToFlag(token: SyntaxKind): NodeFlags;
function isLeftHandSideExpression(expr: Expression): boolean;
function isAssignmentOperator(token: SyntaxKind): boolean;
/** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */
function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined;
function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean;
function isEntityNameExpression(node: Expression): node is EntityNameExpression;
function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean;
Expand Down
241 changes: 198 additions & 43 deletions bin/typescript.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kicktravis
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016-09-01 [ci skip] Version: 1.201609010006.1+707d61d7fe953b04b3ad117294a33135573ced3a
2016-09-02 [ci skip] Version: 1.201609020105.1+8038eb943e6509a5da3377853ca04986bededbb1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ntypescript",
"version": "1.201609010006.1+707d61d7fe953b04b3ad117294a33135573ced3a",
"version": "1.201609020105.1+8038eb943e6509a5da3377853ca04986bededbb1",
"description": "A nicer version of microsoft/typescript packaged and released for API developers",
"main": "./bin/ntypescript.js",
"bin": {
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5378,7 +5378,7 @@ namespace ts {
while (i > 0) {
i--;
if (isSubtypeOfAny(types[i], types)) {
types.splice(i, 1);
orderedRemoveItemAt(types, i);
}
}
}
Expand Down Expand Up @@ -8758,7 +8758,7 @@ namespace ts {
// The location isn't a reference to the given symbol, meaning we're being asked
// a hypothetical question of what type the symbol would have if there was a reference
// to it at the given location. Since we have no control flow information for the
// hypotherical reference (control flow information is created and attached by the
// hypothetical reference (control flow information is created and attached by the
// binder), we simply return the declared type of the symbol.
return getTypeOfSymbol(symbol);
}
Expand Down
37 changes: 28 additions & 9 deletions src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,20 +1500,39 @@ namespace ts {
}
}

export function copyListRemovingItem<T>(item: T, list: T[]) {
const copiedList: T[] = [];
for (const e of list) {
if (e !== item) {
copiedList.push(e);
/** Remove an item from an array, moving everything to its right one space left. */
export function orderedRemoveItemAt<T>(array: T[], index: number): void {
// This seems to be faster than either `array.splice(i, 1)` or `array.copyWithin(i, i+ 1)`.
for (let i = index; i < array.length - 1; i++) {
array[i] = array[i + 1];
}
array.pop();
}

export function unorderedRemoveItemAt<T>(array: T[], index: number): void {
// Fill in the "hole" left at `index`.
array[index] = array[array.length - 1];
array.pop();
}

/** Remove the *first* occurrence of `item` from the array. */
export function unorderedRemoveItem<T>(array: T[], item: T): void {
unorderedRemoveFirstItemWhere(array, element => element === item);
}

/** Remove the *first* element satisfying `predicate`. */
function unorderedRemoveFirstItemWhere<T>(array: T[], predicate: (element: T) => boolean): void {
for (let i = 0; i < array.length; i++) {
if (predicate(array[i])) {
unorderedRemoveItemAt(array, i);
break;
}
}
return copiedList;
}

export function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string {
return useCaseSensitivefileNames
export function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (fileName: string) => string {
return useCaseSensitiveFileNames
? ((fileName) => fileName)
: ((fileName) => fileName.toLowerCase());
}

}
7 changes: 2 additions & 5 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,10 @@ namespace ts {
function removeFileWatcherCallback(filePath: string, callback: FileWatcherCallback) {
const callbacks = fileWatcherCallbacks[filePath];
if (callbacks) {
const newCallbacks = copyListRemovingItem(callback, callbacks);
if (newCallbacks.length === 0) {
unorderedRemoveItem(callbacks, callback);
if (callbacks.length === 0) {
delete fileWatcherCallbacks[filePath];
}
else {
fileWatcherCallbacks[filePath] = newCallbacks;
}
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/compiler/tsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,7 @@ namespace ts {
sourceFile.fileWatcher.close();
sourceFile.fileWatcher = undefined;
if (removed) {
const index = rootFileNames.indexOf(sourceFile.fileName);
if (index >= 0) {
rootFileNames.splice(index, 1);
}
unorderedRemoveItem(rootFileNames, sourceFile.fileName);
}
startTimerForRecompilation();
}
Expand Down
25 changes: 22 additions & 3 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,18 @@ namespace ts {
return undefined;
}

export function isCallLikeExpression(node: Node): node is CallLikeExpression {
switch (node.kind) {
case SyntaxKind.CallExpression:
case SyntaxKind.NewExpression:
case SyntaxKind.TaggedTemplateExpression:
case SyntaxKind.Decorator:
return true;
default:
return false;
}
}

export function getInvokedExpression(node: CallLikeExpression): Expression {
if (node.kind === SyntaxKind.TaggedTemplateExpression) {
return (<TaggedTemplateExpression>node).tag;
Expand Down Expand Up @@ -2659,10 +2671,17 @@ namespace ts {
return token >= SyntaxKind.FirstAssignment && token <= SyntaxKind.LastAssignment;
}

export function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean {
return node.kind === SyntaxKind.ExpressionWithTypeArguments &&
/** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */
export function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined {
if (node.kind === SyntaxKind.ExpressionWithTypeArguments &&
(<HeritageClause>node.parent).token === SyntaxKind.ExtendsKeyword &&
isClassLike(node.parent.parent);
isClassLike(node.parent.parent)) {
return node.parent.parent;
}
}

export function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean {
return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined;
}

export function isEntityNameExpression(node: Expression): node is EntityNameExpression {
Expand Down
1 change: 1 addition & 0 deletions src/services/navigationBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ namespace ts.NavigationBar {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
case SyntaxKind.VariableDeclaration:
return hasSomeImportantChild(item);

case SyntaxKind.ArrowFunction:
Expand Down
Loading

0 comments on commit a080ee9

Please sign in to comment.