diff --git a/bin/tsc.js b/bin/tsc.js index f8d31c01536..df74c76f504 100644 --- a/bin/tsc.js +++ b/bin/tsc.js @@ -2806,13 +2806,12 @@ var ts; if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -9063,25 +9062,25 @@ var ts; diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; + var emitResultStatus; if (isEmitBlocked) { - returnCode = 1 /* AllOutputGenerationSkipped */; + emitResultStatus = 1 /* AllOutputGenerationSkipped */; } else if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; + emitResultStatus = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; + emitResultStatus = 3 /* DeclarationGenerationSkipped */; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; } else { - returnCode = 0 /* Succeeded */; + emitResultStatus = 0 /* Succeeded */; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -9140,14 +9139,16 @@ var ts; var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, @@ -9173,8 +9174,6 @@ var ts; getSignatureFromDeclaration: getSignatureFromDeclaration, isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, hasEarlyErrors: hasEarlyErrors, isEmitBlocked: isEmitBlocked }; @@ -16864,8 +16863,8 @@ var ts; } else { var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; + var emitOutput = checker.invokeEmitter(); + var emitErrors = emitOutput.diagnostics; exitStatus = emitOutput.emitResultStatus; var reportStart = new Date().getTime(); errors = ts.concatenate(errors, emitErrors); diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index c95e38c7b9f..ca2b7ec0318 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -2611,13 +2611,12 @@ var ts; if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -8868,25 +8867,25 @@ var ts; diagnostics.sort(ts.compareDiagnostics); diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; + var emitResultStatus; if (isEmitBlocked) { - returnCode = 1 /* AllOutputGenerationSkipped */; + emitResultStatus = 1 /* AllOutputGenerationSkipped */; } else if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; + emitResultStatus = 4 /* EmitErrorsEncountered */; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; + emitResultStatus = 3 /* DeclarationGenerationSkipped */; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; + emitResultStatus = 2 /* JSGeneratedWithSemanticErrors */; } else { - returnCode = 0 /* Succeeded */; + emitResultStatus = 0 /* Succeeded */; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus: emitResultStatus, + diagnostics: diagnostics, sourceMaps: sourceMapDataList }; } @@ -8945,14 +8944,16 @@ var ts; var compilerOptions = program.getCompilerOptions(); var checker = { getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, getTypeCount: function () { return typeCount; }, + isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, + isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, + getDiagnostics: getDiagnostics, + getGlobalDiagnostics: getGlobalDiagnostics, checkProgram: checkProgram, - emitFiles: invokeEmitter, + invokeEmitter: invokeEmitter, getParentOfSymbol: getParentOfSymbol, getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, @@ -8978,8 +8979,6 @@ var ts; getSignatureFromDeclaration: getSignatureFromDeclaration, isImplementationOfOverload: isImplementationOfOverload, getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, hasEarlyErrors: hasEarlyErrors, isEmitBlocked: isEmitBlocked }; @@ -16739,33 +16738,33 @@ var ts; var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; - var prefixParts = []; - var suffixParts = []; + var prefixDisplayParts = []; + var suffixDisplayParts = []; if (callTargetDisplayParts) { - prefixParts.push.apply(prefixParts, callTargetDisplayParts); + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(ts.punctuationPart(23 /* LessThanToken */)); + prefixDisplayParts.push(ts.punctuationPart(23 /* LessThanToken */)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); + suffixDisplayParts.push(ts.punctuationPart(24 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList); }); - suffixParts.push.apply(suffixParts, parameterParts); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList); }); - prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(ts.punctuationPart(15 /* OpenParenToken */)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(ts.punctuationPart(15 /* OpenParenToken */)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(ts.punctuationPart(16 /* CloseParenToken */)); + suffixDisplayParts.push(ts.punctuationPart(16 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { return typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList); }); - suffixParts.push.apply(suffixParts, returnTypeParts); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, + prefixDisplayParts: prefixDisplayParts, + suffixDisplayParts: suffixDisplayParts, separatorDisplayParts: [ts.punctuationPart(22 /* CommaToken */), ts.spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() @@ -16865,15 +16864,15 @@ var ts; } ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; function findListItemInfo(node) { - var syntaxList = findContainingList(node); - if (!syntaxList) { + var list = findContainingList(node); + if (!list) { return undefined; } - var children = syntaxList.getChildren(); - var index = ts.indexOf(children, node); + var children = list.getChildren(); + var listItemIndex = ts.indexOf(children, node); return { - listItemIndex: index, - list: syntaxList + listItemIndex: listItemIndex, + list: list }; } ts.findListItemInfo = findListItemInfo; @@ -20503,7 +20502,7 @@ var ts; var savedWriter = writer; writer = function (filename, data, writeByteOrderMark) { }; - allDiagnostics = allDiagnostics.concat(checker.emitFiles(targetSourceFile).errors); + allDiagnostics = allDiagnostics.concat(checker.invokeEmitter(targetSourceFile).diagnostics); writer = savedWriter; } return allDiagnostics; @@ -22267,7 +22266,7 @@ var ts; writer = undefined; return emitOutput; } - var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); + var emitFilesResult = getFullTypeCheckChecker().invokeEmitter(targetSourceFile); emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; writer = undefined; return emitOutput; @@ -22829,7 +22828,6 @@ var ts; getDefinitionAtPosition: getDefinitionAtPosition, getReferencesAtPosition: getReferencesAtPosition, getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: function (filename, position) { return []; }, getNameOrDottedNameSpan: getNameOrDottedNameSpan, getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, getNavigateToItems: getNavigateToItems, @@ -23049,9 +23047,7 @@ var ts; return 5 /* Identifier */; } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine: getClassificationsForLine }; } ts.createClassifier = createClassifier; function initializeServices() { @@ -23774,12 +23770,6 @@ var ts; return _this.languageService.getOccurrencesAtPosition(fileName, position); }); }; - LanguageServiceShimObject.prototype.getImplementorsAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getImplementorsAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getImplementorsAtPosition(fileName, position); - }); - }; LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, isMemberCompletion) { var _this = this; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")", function () { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b947a271be3..117422366aa 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -75,43 +75,43 @@ module ts { var checker: TypeChecker = { getProgram: () => program, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"), getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"), getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"), getTypeCount: () => typeCount, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getParentOfSymbol: getParentOfSymbol, - getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol, - getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getTypeOfNode: getTypeOfNode, - typeToString: typeToString, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, - getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, - getRootSymbols: getRootSymbols, - getContextualType: getContextualType, - getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getEnumMemberValue: getEnumMemberValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, - getAliasedSymbol: resolveImport, isUndefinedSymbol: symbol => symbol === undefinedSymbol, isArgumentsSymbol: symbol => symbol === argumentsSymbol, - hasEarlyErrors: hasEarlyErrors, - isEmitBlocked: isEmitBlocked + getDiagnostics, + getGlobalDiagnostics, + checkProgram, + invokeEmitter, + getParentOfSymbol, + getNarrowedTypeOfSymbol, + getDeclaredTypeOfSymbol, + getPropertiesOfType, + getPropertyOfType, + getSignaturesOfType, + getIndexTypeOfType, + getReturnTypeOfSignature, + getSymbolsInScope, + getSymbolInfo, + getShorthandAssignmentValueSymbol, + getTypeOfNode, + typeToString, + getSymbolDisplayBuilder, + symbolToString, + getAugmentedPropertiesOfType, + getRootSymbols, + getContextualType, + getFullyQualifiedName, + getResolvedSignature, + getEnumMemberValue, + isValidPropertyAccess, + getSignatureFromDeclaration, + isImplementationOfOverload, + getAliasedSymbol: resolveImport, + hasEarlyErrors, + isEmitBlocked, }; var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined"); @@ -953,7 +953,7 @@ module ts { if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) { return undefined; } - return { aliasesToMakeVisible: aliasesToMakeVisible }; + return { aliasesToMakeVisible }; function getIsDeclarationVisible(declaration: Declaration) { if (!isDeclarationVisible(declaration)) { @@ -9121,22 +9121,22 @@ module ts { function invokeEmitter(targetSourceFile?: SourceFile) { var resolver: EmitResolver = { getProgram: () => program, - getLocalNameOfContainer: getLocalNameOfContainer, - getExpressionNamePrefix: getExpressionNamePrefix, - getExportAssignmentName: getExportAssignmentName, - isReferencedImportDeclaration: isReferencedImportDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName, - hasSemanticErrors: hasSemanticErrors, - isEmitBlocked: isEmitBlocked, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeAtLocation: writeTypeAtLocation, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile, - getConstantValue: getConstantValue, + getLocalNameOfContainer, + getExpressionNamePrefix, + getExportAssignmentName, + isReferencedImportDeclaration, + getNodeCheckFlags, + getEnumMemberValue, + isTopLevelValueImportWithEntityName, + hasSemanticErrors, + isEmitBlocked, + isDeclarationVisible, + isImplementationOfOverload, + writeTypeAtLocation, + writeReturnTypeOfSignatureDeclaration, + isSymbolAccessible, + isImportDeclarationEntityNameReferenceDeclarationVisibile, + getConstantValue, }; checkProgram(); return emitFiles(resolver, targetSourceFile); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 5e61e9e1cb7..3fabf6c8588 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -153,9 +153,9 @@ module ts { parseStrings(commandLine); return { - options: options, - filenames: filenames, - errors: errors + options, + filenames, + errors }; function parseStrings(args: string[]) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index e512688fee2..2c613996689 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -258,9 +258,9 @@ module ts { } return { - file: file, - start: start, - length: length, + file, + start, + length, messageText: text, category: message.category, @@ -335,12 +335,12 @@ module ts { } return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText + file, + start, + length, + code, + category, + messageText }; } diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index a87b1f8cc28..80a32ba330a 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -122,9 +122,9 @@ module ts { let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" }, Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." }, - Unterminated_template_literal: { code: 1160, category: DiagnosticCategory.Error, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, An_object_member_cannot_be_declared_optional: { code: 1160, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, + Unterminated_template_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated template literal." }, + Unterminated_regular_expression_literal: { code: 1162, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index ef4d02edd14..2666a0fd476 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -104,9 +104,9 @@ module ts { } }); return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor + firstAccessor, + getAccessor, + setAccessor }; } @@ -2790,7 +2790,7 @@ module ts { Diagnostics.Exported_type_alias_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1; return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name }; @@ -2887,7 +2887,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name }; @@ -2952,7 +2952,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: (node.parent).name }; @@ -3134,7 +3134,7 @@ module ts { Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node.parameters[0], // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name typeName: node.name @@ -3156,7 +3156,7 @@ module ts { Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node.name, typeName: undefined }; @@ -3286,7 +3286,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node.name || node, }; } @@ -3371,7 +3371,7 @@ module ts { } return { - diagnosticMessage: diagnosticMessage, + diagnosticMessage, errorNode: node, typeName: node.name }; @@ -3556,22 +3556,22 @@ module ts { var hasEmitterError = forEach(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error); // Check and update returnCode for syntactic and semantic - var returnCode: EmitReturnStatus; + var emitResultStatus: EmitReturnStatus; if (isEmitBlocked) { - returnCode = EmitReturnStatus.AllOutputGenerationSkipped; + emitResultStatus = EmitReturnStatus.AllOutputGenerationSkipped; } else if (hasEmitterError) { - returnCode = EmitReturnStatus.EmitErrorsEncountered; + emitResultStatus = EmitReturnStatus.EmitErrorsEncountered; } else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = EmitReturnStatus.DeclarationGenerationSkipped; + emitResultStatus = EmitReturnStatus.DeclarationGenerationSkipped; } else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = EmitReturnStatus.JSGeneratedWithSemanticErrors; + emitResultStatus = EmitReturnStatus.JSGeneratedWithSemanticErrors; } else { - returnCode = EmitReturnStatus.Succeeded; + emitResultStatus = EmitReturnStatus.Succeeded; } return { - emitResultStatus: returnCode, - errors: diagnostics, + emitResultStatus, + diagnostics, sourceMaps: sourceMapDataList }; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index e1e2cd28a00..9e13f50cd88 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -759,13 +759,12 @@ module ts { if (matchResult) { var start = commentRange.pos; var end = commentRange.end; - var fileRef = { - pos: start, - end: end, - filename: matchResult[3] - }; return { - fileReference: fileRef, + fileReference: { + pos: start, + end: end, + filename: matchResult[3] + }, isNoDefaultLib: false }; } @@ -1520,8 +1519,8 @@ module ts { } return { - typeParameters: typeParameters, - parameters: parameters, + typeParameters, + parameters, type: type }; } @@ -2408,6 +2407,7 @@ module ts { function parsePropertyAssignment(): Declaration { var nodePos = scanner.getStartPos(); + var tokenIsIdentifier = isIdentifier(); var nameToken = token; var propertyName = parsePropertyName(); var node: Declaration; @@ -2434,7 +2434,7 @@ module ts { } // Parse to check if it is short-hand property assignment or normal property assignment - if (token !== SyntaxKind.ColonToken && nameToken === SyntaxKind.Identifier) { + if ((token === SyntaxKind.CommaToken || token === SyntaxKind.CloseBraceToken) && tokenIsIdentifier) { node = createNode(SyntaxKind.ShorthandPropertyAssignment, nodePos); node.name = propertyName; } @@ -3558,9 +3558,9 @@ module ts { } commentRanges = undefined; return { - referencedFiles: referencedFiles, - amdDependencies: amdDependencies, - amdModuleName: amdModuleName + referencedFiles, + amdDependencies, + amdModuleName }; } diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 0647d61f24d..e08f481ba9c 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -1167,13 +1167,13 @@ module ts { hasPrecedingLineBreak: () => precedingLineBreak, isIdentifier: () => token === SyntaxKind.Identifier || token > SyntaxKind.LastReservedWord, isReservedWord: () => token >= SyntaxKind.FirstReservedWord && token <= SyntaxKind.LastReservedWord, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan, + reScanGreaterToken, + reScanSlashToken, + reScanTemplateToken, + scan, + setText, + setTextPos, + tryScan, }; } } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index d685a30d959..e58d08589ba 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -99,14 +99,14 @@ var sys: System = (function () { } return { - args: args, + args, newLine: "\r\n", useCaseSensitiveFileNames: false, write(s: string): void { WScript.StdOut.Write(s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, resolvePath(path: string): string { return fso.GetAbsolutePathName(path); }, @@ -191,8 +191,8 @@ var sys: System = (function () { // 1 is a standard descriptor for stdout _fs.writeSync(1, s); }, - readFile: readFile, - writeFile: writeFile, + readFile, + writeFile, watchFile: (fileName, callback) => { // watchFile polls a file every 250ms, picking up file notifications. _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index e5291c9d7f1..79972c7a891 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -192,12 +192,12 @@ module ts { } return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: () => combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), "lib.d.ts"), - writeFile: writeFile, + writeFile, getCurrentDirectory: () => currentDirectory || (currentDirectory = sys.getCurrentDirectory()), useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, - getCanonicalFileName: getCanonicalFileName, + getCanonicalFileName, getNewLine: () => sys.newLine }; } @@ -367,8 +367,8 @@ module ts { } else { var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; + var emitOutput = checker.invokeEmitter(); + var emitErrors = emitOutput.diagnostics; exitStatus = emitOutput.emitResultStatus; var reportStart = new Date().getTime(); errors = concatenate(errors, emitErrors); @@ -394,7 +394,7 @@ module ts { reportTimeStatistic("Total time", reportStart - parseStart); } - return { program: program, exitStatus: exitStatus } + return { program, exitStatus }; } function printVersion() { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 97db90ea048..c9e91de8958 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -719,7 +719,7 @@ module ts { export interface EmitResult { emitResultStatus: EmitReturnStatus; - errors: Diagnostic[]; + diagnostics: Diagnostic[]; sourceMaps: SourceMapData[]; // Array of sourceMapData if compiler emitted sourcemaps } @@ -732,7 +732,7 @@ module ts { getSymbolCount(): number; getTypeCount(): number; checkProgram(): void; - emitFiles(targetSourceFile?: SourceFile): EmitResult; + invokeEmitter(targetSourceFile?: SourceFile): EmitResult; getParentOfSymbol(symbol: Symbol): Symbol; getNarrowedTypeOfSymbol(symbol: Symbol, node: Node): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 144cc9745d9..88fb3639d1e 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -749,29 +749,6 @@ module FourSlash { } } - public verifyImplementorsCountIs(count: number, localFilesOnly: boolean = true) { - var implementors = this.getImplementorsAtCaret(); - var implementorsCount = 0; - - if (localFilesOnly) { - var localFiles = this.testData.files.map(file => file.fileName); - // Count only the references in local files. Filter the ones in lib and other files. - implementors.forEach((entry) => { - if (localFiles.some((filename) => filename === entry.fileName)) { - ++implementorsCount; - } - }); - } - else { - implementorsCount = implementors.length; - } - - if (implementorsCount !== count) { - var condition = localFilesOnly ? "excluding libs" : "including libs"; - this.raiseError("Expected implementors count (" + condition + ") to be " + count + ", but is actually " + implementors.length); - } - } - private getMemberListAtCaret() { return this.languageService.getCompletionsAtPosition(this.activeFile.fileName, this.currentCaretPosition, true); } @@ -788,10 +765,6 @@ module FourSlash { return this.languageService.getReferencesAtPosition(this.activeFile.fileName, this.currentCaretPosition); } - private getImplementorsAtCaret() { - return this.languageService.getImplementorsAtPosition(this.activeFile.fileName, this.currentCaretPosition); - } - private assertionMessage(name: string, actualValue: any, expectedValue: any) { return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue; } @@ -2250,7 +2223,7 @@ module FourSlash { if (errs.length > 0) { throw new Error('Error compiling ' + fileName + ': ' + errs.map(e => e.messageText).join('\r\n')); } - checker.emitFiles(); + checker.invokeEmitter(); result = result || ''; // Might have an empty fourslash file // Compile and execute the test @@ -2284,7 +2257,7 @@ module FourSlash { // List of all the subfiles we've parsed out var files: FourSlashFile[] = []; // Global options - var opts: { [s: string]: string; } = {}; + var globalOptions: { [s: string]: string; } = {}; // Marker positions // Split up the input file by line @@ -2292,7 +2265,7 @@ module FourSlash { // we have to string-based splitting instead and try to figure out the delimiting chars var lines = contents.split('\n'); - var markerMap: MarkerMap = {}; + var markerPositions: MarkerMap = {}; var markers: Marker[] = []; var ranges: Range[] = []; @@ -2333,7 +2306,7 @@ module FourSlash { } else if (fileMetadataNamesIndex === fileMetadataNames.indexOf(testOptMetadataNames.filename)) { // Found an @Filename directive, if this is not the first then create a new subfile if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2353,10 +2326,10 @@ module FourSlash { } } else { // Check if the match is already existed in the global options - if (opts[match[1]] !== undefined) { + if (globalOptions[match[1]] !== undefined) { throw new Error("Global Option : '" + match[1] + "' is already existed"); } - opts[match[1]] = match[2]; + globalOptions[match[1]] = match[2]; } } } else if (line == '' || lineLength === 0) { @@ -2365,7 +2338,7 @@ module FourSlash { } else { // Empty line or code line, terminate current subfile if there is one if (currentFileContent) { - var file = parseFileContent(currentFileContent, currentFileName, markerMap, markers, ranges); + var file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges); file.fileOptions = currentFileOptions; // Store result file @@ -2380,11 +2353,11 @@ module FourSlash { } return { - markerPositions: markerMap, - markers: markers, - globalOptions: opts, - files: files, - ranges: ranges + markerPositions, + markers, + globalOptions, + files, + ranges }; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index aee0ef3c534..5b6db22e1db 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -589,8 +589,8 @@ module Harness { } }, getDefaultLibFilename: () => defaultLibFileName, - writeFile: writeFile, - getCanonicalFileName: getCanonicalFileName, + writeFile, + getCanonicalFileName, useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, getNewLine: ()=> sys.newLine }; @@ -806,11 +806,11 @@ module Harness { // only emit if there weren't parse errors var emitResult: ts.EmitResult; if (!isEmitBlocked) { - emitResult = checker.emitFiles(); + emitResult = checker.invokeEmitter(); } var errors: HarnessDiagnostic[] = []; - program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.errors : []).forEach(err => { + program.getDiagnostics().concat(checker.getDiagnostics()).concat(emitResult ? emitResult.diagnostics : []).forEach(err => { // TODO: new compiler formats errors after this point to add . and newlines so we'll just do it manually for now errors.push(getMinimalDiagnostic(err)); }); @@ -845,7 +845,7 @@ module Harness { declResult = compileResult; }, settingsCallback, options); - return { declInputFiles: declInputFiles, declOtherFiles: declOtherFiles, declResult: declResult }; + return { declInputFiles, declOtherFiles, declResult }; } function addDtsFile(file: { unitName: string; content: string }, dtsFiles: { unitName: string; content: string }[]) { @@ -1169,7 +1169,7 @@ module Harness { var settings = extractCompilerSettings(code); // List of all the subfiles we've parsed out - var files: TestUnitData[] = []; + var testUnitData: TestUnitData[] = []; var lines = Utils.splitContentByNewlines(code); @@ -1205,7 +1205,7 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile); + testUnitData.push(newTestFile); // Reset local data currentFileContent = null; @@ -1230,7 +1230,7 @@ module Harness { } // normalize the fileName for the single file case - currentFileName = files.length > 0 ? currentFileName : Path.getFileName(fileName); + currentFileName = testUnitData.length > 0 ? currentFileName : Path.getFileName(fileName); // EOF, push whatever remains var newTestFile2 = { @@ -1240,9 +1240,9 @@ module Harness { originalFilePath: fileName, references: refs }; - files.push(newTestFile2); + testUnitData.push(newTestFile2); - return { settings: settings, testUnitData: files }; + return { settings, testUnitData }; } } @@ -1338,7 +1338,7 @@ module Harness { actual = actual.replace(/\r\n?/g, '\n'); } - return { expected: expected, actual: actual }; + return { expected, actual }; } function writeComparison(expected: string, actual: string, relativeFilename: string, actualFilename: string, descriptionForDescribe: string) { diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 797bc12a42b..e402c7c6803 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -131,8 +131,8 @@ class ProjectRunner extends RunnerBase { if (!errors.length) { var checker = program.getTypeChecker(/*fullTypeCheck*/ true); errors = checker.getDiagnostics(); - var emitResult = checker.emitFiles(); - errors = ts.concatenate(errors, emitResult.errors); + var emitResult = checker.invokeEmitter(); + errors = ts.concatenate(errors, emitResult.diagnostics); sourceMapData = emitResult.sourceMaps; // Clean up source map data that will be used in baselining @@ -148,10 +148,10 @@ class ProjectRunner extends RunnerBase { } return { - moduleKind: moduleKind, - program: program, - errors: errors, - sourceMapData: sourceMapData + moduleKind, + program, + errors, + sourceMapData }; function createCompilerOptions(): ts.CompilerOptions { @@ -183,10 +183,10 @@ class ProjectRunner extends RunnerBase { function createCompilerHost(): ts.CompilerHost { return { - getSourceFile: getSourceFile, + getSourceFile, getDefaultLibFilename: () => "lib.d.ts", - writeFile: writeFile, - getCurrentDirectory: getCurrentDirectory, + writeFile, + getCurrentDirectory, getCanonicalFileName: Harness.Compiler.getCanonicalFileName, useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames, getNewLine: () => sys.newLine @@ -201,12 +201,12 @@ class ProjectRunner extends RunnerBase { var projectCompilerResult = compileProjectFiles(moduleKind, () => testCase.inputFiles, getSourceFileText, writeFile); return { - moduleKind: moduleKind, + moduleKind, program: projectCompilerResult.program, sourceMapData: projectCompilerResult.sourceMapData, - outputFiles: outputFiles, + outputFiles, errors: projectCompilerResult.errors, - nonSubfolderDiskFiles: nonSubfolderDiskFiles, + nonSubfolderDiskFiles, }; function getSourceFileText(filename: string): string { diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index bfb139fa719..606672e406f 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -117,14 +117,14 @@ module RWC { }); function getHarnessCompilerInputUnit(fileName: string) { - var resolvedPath = ts.normalizeSlashes(sys.resolvePath(fileName)); + var unitName = ts.normalizeSlashes(sys.resolvePath(fileName)); try { - var content = sys.readFile(resolvedPath); + var content = sys.readFile(unitName); } catch (e) { // Leave content undefined. } - return { unitName: resolvedPath, content: content }; + return { unitName, content }; } }); diff --git a/src/services/formatting.ts b/src/services/formatting.ts index 337468803c6..2fdbebad79c 100644 --- a/src/services/formatting.ts +++ b/src/services/formatting.ts @@ -361,8 +361,8 @@ module ts.formatting { delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); } return { - indentation: indentation, - delta: delta + indentation, + delta } } @@ -834,7 +834,7 @@ module ts.formatting { } function newTextChange(start: number, len: number, newText: string): TextChange { - return { span: new TextSpan(start, len), newText: newText } + return { span: new TextSpan(start, len), newText } } function recordDelete(start: number, len: number) { diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index c0ec80c98ea..fd4ae0d2f96 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -262,12 +262,12 @@ module ts.NavigationBar { } return { - text: text, - kind: kind, - kindModifiers: kindModifiers, - spans: spans, - childItems: childItems, - indent: indent, + text, + kind, + kindModifiers, + spans, + childItems, + indent, bolded: false, grayed: false }; diff --git a/src/services/services.ts b/src/services/services.ts index f05f9dd77b8..7f7a05cd3af 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -899,7 +899,6 @@ module ts { getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getImplementorsAtPosition(fileName: string, position: number): ReferenceEntry[]; getNavigateToItems(searchValue: string): NavigateToItem[]; getNavigationBarItems(fileName: string): NavigationBarItem[]; @@ -1376,8 +1375,8 @@ module ts { writeSpace: text => writeKind(text, SymbolDisplayPartKind.space), writeStringLiteral: text => writeKind(text, SymbolDisplayPartKind.stringLiteral), writeParameter: text => writeKind(text, SymbolDisplayPartKind.parameterName), - writeSymbol: writeSymbol, - writeLine: writeLine, + writeSymbol, + writeLine, increaseIndent: () => { indent++; }, decreaseIndent: () => { indent--; }, clear: resetWriter, @@ -1767,7 +1766,7 @@ module ts { sourceFiles.sort((x, y) => y.refCount - x.refCount); return { bucket: name, - sourceFiles: sourceFiles + sourceFiles }; }); return JSON.stringify(bucketInfoArray, null, 2); @@ -1833,10 +1832,10 @@ module ts { } return { - acquireDocument: acquireDocument, - updateDocument: updateDocument, - releaseDocument: releaseDocument, - reportStats: reportStats + acquireDocument, + updateDocument, + releaseDocument, + reportStats }; } @@ -1899,7 +1898,7 @@ module ts { processImport(); } processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; + return { referencedFiles, importedFiles, isLibFile: isNoDefaultLib }; } /// Helpers @@ -2298,7 +2297,7 @@ module ts { // Get emitter-diagnostics requires calling TypeChecker.emitFiles so we have to define CompilerHost.writer which does nothing because emitFiles function has side effects defined by CompilerHost.writer var savedWriter = writer; writer = (filename: string, data: string, writeByteOrderMark: boolean) => { }; - allDiagnostics = allDiagnostics.concat(checker.emitFiles(targetSourceFile).errors); + allDiagnostics = allDiagnostics.concat(checker.invokeEmitter(targetSourceFile).diagnostics); writer = savedWriter; } return allDiagnostics @@ -2503,7 +2502,7 @@ module ts { host.log("getCompletionsAtPosition: Semantic work: " + (new Date().getTime() - semanticStart)); return { - isMemberCompletion: isMemberCompletion, + isMemberCompletion, entries: activeCompletionSession.entries }; @@ -2758,7 +2757,7 @@ module ts { while (true) { node = node.parent; if (!node) { - return node; + return undefined; } switch (node.kind) { case SyntaxKind.SourceFile: @@ -3163,7 +3162,7 @@ module ts { documentation = symbol.getDocumentationComment(); } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; + return { displayParts, documentation, symbolKind }; function addNewLineIfDisplayPartsExist() { if (displayParts.length) { @@ -3264,7 +3263,7 @@ module ts { kind: symbolKind, name: symbolName, containerKind: undefined, - containerName: containerName + containerName }; } @@ -3973,6 +3972,10 @@ module ts { for (var i = 0, n = declarations.length; i < n; i++) { var container = getContainerNode(declarations[i]); + if (!container) { + return undefined; + } + if (scope && scope !== container) { // Different declarations have different containers, bail out return undefined; @@ -4537,8 +4540,8 @@ module ts { fileName: filename, textSpan: TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), // TODO(jfreeman): What should be the containerName when the container has a computed name? - containerName: container.name ? (container.name).text : "", - containerKind: container.name ? getNodeKind(container) : "" + containerName: container && container.name ? (container.name).text : "", + containerKind: container && container.name ? getNodeKind(container) : "" }); } } @@ -4646,7 +4649,7 @@ module ts { // Perform semantic and force a type check before emit to ensure that all symbols are updated // EmitFiles will report if there is an error from TypeChecker and Emitter // Depend whether we will have to emit into a single file or not either emit only selected file in the project, emit all files into a single file - var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); + var emitFilesResult = getFullTypeCheckChecker().invokeEmitter(targetSourceFile); emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; // Reset writer back to undefined to make sure that we produce an error message if CompilerHost.writeFile method is called when we are not in getEmitOutput @@ -4692,10 +4695,13 @@ module ts { else { return SemanticMeaning.Namespace; } - break; case SyntaxKind.ImportDeclaration: return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; + + // An external module can be a Value + case SyntaxKind.SourceFile: + return SemanticMeaning.Namespace | SemanticMeaning.Value; } Debug.fail("Unknown declaration type"); } @@ -5427,46 +5433,45 @@ module ts { return { canRename: true, localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: fullDisplayName, - kind: kind, - kindModifiers: kindModifiers, - triggerSpan: triggerSpan + displayName, + fullDisplayName, + kind, + kindModifiers, + triggerSpan }; } } return { - dispose: dispose, - cleanupSemanticCache: cleanupSemanticCache, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getSyntacticClassifications: getSyntacticClassifications, - getSemanticClassifications: getSemanticClassifications, - getCompletionsAtPosition: getCompletionsAtPosition, - getCompletionEntryDetails: getCompletionEntryDetails, - getSignatureHelpItems: getSignatureHelpItems, - getQuickInfoAtPosition: getQuickInfoAtPosition, - getDefinitionAtPosition: getDefinitionAtPosition, - getReferencesAtPosition: getReferencesAtPosition, - getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: (filename, position) => [], - getNameOrDottedNameSpan: getNameOrDottedNameSpan, - getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: getNavigateToItems, - getRenameInfo: getRenameInfo, - findRenameLocations: findRenameLocations, - getNavigationBarItems: getNavigationBarItems, - getOutliningSpans: getOutliningSpans, - getTodoComments: getTodoComments, - getBraceMatchingAtPosition: getBraceMatchingAtPosition, - getIndentationAtPosition: getIndentationAtPosition, - getFormattingEditsForRange: getFormattingEditsForRange, - getFormattingEditsForDocument: getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: getEmitOutput, - getSignatureAtPosition: getSignatureAtPosition, + dispose, + cleanupSemanticCache, + getSyntacticDiagnostics, + getSemanticDiagnostics, + getCompilerOptionsDiagnostics, + getSyntacticClassifications, + getSemanticClassifications, + getCompletionsAtPosition, + getCompletionEntryDetails, + getSignatureHelpItems, + getQuickInfoAtPosition, + getDefinitionAtPosition, + getReferencesAtPosition, + getOccurrencesAtPosition, + getNameOrDottedNameSpan, + getBreakpointStatementAtPosition, + getNavigateToItems, + getRenameInfo, + findRenameLocations, + getNavigationBarItems, + getOutliningSpans, + getTodoComments, + getBraceMatchingAtPosition, + getIndentationAtPosition, + getFormattingEditsForRange, + getFormattingEditsForDocument, + getFormattingEditsAfterKeystroke, + getEmitOutput, + getSignatureAtPosition, }; } @@ -5764,9 +5769,7 @@ module ts { } } - return { - getClassificationsForLine: getClassificationsForLine - }; + return { getClassificationsForLine }; } function initializeServices() { diff --git a/src/services/shims.ts b/src/services/shims.ts index 38c68c067f8..a355ddafab2 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -133,12 +133,6 @@ module ts { */ getOccurrencesAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] - */ - getImplementorsAtPosition(fileName: string, position: number): string; - /** * Returns a JSON-encoded value of the type: * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; @@ -696,16 +690,6 @@ module ts { }); } - /// GET IMPLEMENTORS - public getImplementorsAtPosition(fileName: string, position: number): string { - return this.forwardJSONCall( - "getImplementorsAtPosition('" + fileName + "', " + position + ")", - () => { - return this.languageService.getImplementorsAtPosition(fileName, position); - }); - } - - /// COMPLETION LISTS /** diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index a4580582ed8..7d063ae069d 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -221,7 +221,7 @@ module ts.SignatureHelp { var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); Debug.assert(list !== undefined); return { - list: list, + list, listItemIndex: 0 }; } @@ -303,40 +303,40 @@ module ts.SignatureHelp { var callTargetDisplayParts = callTargetSymbol && symbolToDisplayParts(typeInfoResolver, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); var items: SignatureHelpItem[] = map(candidates, candidateSignature => { var signatureHelpParameters: SignatureHelpParameter[]; - var prefixParts: SymbolDisplayPart[] = []; - var suffixParts: SymbolDisplayPart[] = []; + var prefixDisplayParts: SymbolDisplayPart[] = []; + var suffixDisplayParts: SymbolDisplayPart[] = []; if (callTargetDisplayParts) { - prefixParts.push.apply(prefixParts, callTargetDisplayParts); + prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); } if (isTypeParameterHelp) { - prefixParts.push(punctuationPart(SyntaxKind.LessThanToken)); + prefixDisplayParts.push(punctuationPart(SyntaxKind.LessThanToken)); var typeParameters = candidateSignature.typeParameters; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); + suffixDisplayParts.push(punctuationPart(SyntaxKind.GreaterThanToken)); var parameterParts = mapToDisplayParts(writer => typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, argumentListOrTypeArgumentList)); - suffixParts.push.apply(suffixParts, parameterParts); + suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); } else { var typeParameterParts = mapToDisplayParts(writer => typeInfoResolver.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, argumentListOrTypeArgumentList)); - prefixParts.push.apply(prefixParts, typeParameterParts); - prefixParts.push(punctuationPart(SyntaxKind.OpenParenToken)); + prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); + prefixDisplayParts.push(punctuationPart(SyntaxKind.OpenParenToken)); var parameters = candidateSignature.parameters; signatureHelpParameters = parameters.length > 0 ? map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixParts.push(punctuationPart(SyntaxKind.CloseParenToken)); + suffixDisplayParts.push(punctuationPart(SyntaxKind.CloseParenToken)); } var returnTypeParts = mapToDisplayParts(writer => typeInfoResolver.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, argumentListOrTypeArgumentList)); - suffixParts.push.apply(suffixParts, returnTypeParts); + suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); return { isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, + prefixDisplayParts, + suffixDisplayParts, separatorDisplayParts: [punctuationPart(SyntaxKind.CommaToken), spacePart()], parameters: signatureHelpParameters, documentation: candidateSignature.getDocumentationComment() @@ -378,11 +378,11 @@ module ts.SignatureHelp { } return { - items: items, - applicableSpan: applicableSpan, - selectedItemIndex: selectedItemIndex, - argumentIndex: argumentIndex, - argumentCount: argumentCount + items, + applicableSpan, + selectedItemIndex, + argumentIndex, + argumentCount }; function createSignatureHelpParameterForParameter(parameter: Symbol): SignatureHelpParameter { @@ -394,8 +394,8 @@ module ts.SignatureHelp { return { name: parameter.name, documentation: parameter.getDocumentationComment(), - displayParts: displayParts, - isOptional: isOptional + displayParts, + isOptional }; } @@ -406,7 +406,7 @@ module ts.SignatureHelp { return { name: typeParameter.symbol.name, documentation: emptyArray, - displayParts: displayParts, + displayParts, isOptional: false }; } diff --git a/src/services/smartIndenter.ts b/src/services/smartIndenter.ts index 7a56ea07be3..e593c6cfd66 100644 --- a/src/services/smartIndenter.ts +++ b/src/services/smartIndenter.ts @@ -222,7 +222,8 @@ module ts.formatting { if (node.parent) { switch (node.parent.kind) { case SyntaxKind.TypeReference: - if ((node.parent).typeArguments) { + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, node.getStart(sourceFile), node.getEnd())) { return (node.parent).typeArguments; } break; @@ -236,21 +237,28 @@ module ts.formatting { case SyntaxKind.Method: case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: - if ((node.parent).typeParameters && node.end < (node.parent).typeParameters.end) { + var start = node.getStart(sourceFile); + if ((node.parent).typeParameters && + rangeContainsStartEnd((node.parent).typeParameters, start, node.getEnd())) { return (node.parent).typeParameters; } - - return (node.parent).parameters; + if (rangeContainsStartEnd((node.parent).parameters, start, node.getEnd())) { + return (node.parent).parameters; + } + break; case SyntaxKind.NewExpression: case SyntaxKind.CallExpression: - if ((node.parent).typeArguments && node.end < (node.parent).typeArguments.end) { + var start = node.getStart(sourceFile); + if ((node.parent).typeArguments && + rangeContainsStartEnd((node.parent).typeArguments, start, node.getEnd())) { return (node.parent).typeArguments; } - - return (node.parent).arguments; + if (rangeContainsStartEnd((node.parent).arguments, start, node.getEnd())) { + return (node.parent).arguments; + } + break; } } - return undefined; } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 8620f8d1920..b0a216c7dcd 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -66,22 +66,22 @@ module ts { } export function findListItemInfo(node: Node): ListItemInfo { - var syntaxList = findContainingList(node); + var list = findContainingList(node); // It is possible at this point for syntaxList to be undefined, either if // node.parent had no list child, or if none of its list children contained // the span of node. If this happens, return undefined. The caller should // handle this case. - if (!syntaxList) { + if (!list) { return undefined; } - var children = syntaxList.getChildren(); - var index = indexOf(children, node); + var children = list.getChildren(); + var listItemIndex = indexOf(children, node); return { - listItemIndex: index, - list: syntaxList + listItemIndex, + list }; } diff --git a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt index c37f308960a..2e363de591e 100644 --- a/tests/baselines/reference/incompleteObjectLiteral1.errors.txt +++ b/tests/baselines/reference/incompleteObjectLiteral1.errors.txt @@ -1,14 +1,11 @@ -tests/cases/compiler/incompleteObjectLiteral1.ts(1,14): error TS1005: ',' expected. +tests/cases/compiler/incompleteObjectLiteral1.ts(1,14): error TS1005: ':' expected. tests/cases/compiler/incompleteObjectLiteral1.ts(1,16): error TS1128: Declaration or statement expected. -tests/cases/compiler/incompleteObjectLiteral1.ts(1,12): error TS2304: Cannot find name 'aa'. -==== tests/cases/compiler/incompleteObjectLiteral1.ts (3 errors) ==== +==== tests/cases/compiler/incompleteObjectLiteral1.ts (2 errors) ==== var tt = { aa; } ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS1128: Declaration or statement expected. - ~~ -!!! error TS2304: Cannot find name 'aa'. var x = tt; \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt index 3c5f4e97d80..33672c3d54c 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.errors.txt @@ -7,18 +7,17 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(9,8): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(10,10): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(12,1): error TS1005: ':' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ',' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ',' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: '=' expected. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(18,1): error TS1128: Declaration or statement expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,6): error TS1005: ':' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,6): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(20,17): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,5): error TS2300: Duplicate identifier 'a'. -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(15,7): error TS2304: Cannot find name 'b'. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(16,5): error TS2300: Duplicate identifier 'a'. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts(17,5): error TS2300: Duplicate identifier 'a'. -==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (18 errors) ==== +==== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorFromNotUsingIdentifier.ts (17 errors) ==== // errors var y = { "stringLiteral", @@ -55,22 +54,20 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr var x = { a.b, ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. - ~ -!!! error TS2304: Cannot find name 'b'. a["ss"], ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS2300: Duplicate identifier 'a'. a[1], ~ -!!! error TS1005: '=' expected. +!!! error TS1005: ':' expected. + ~ +!!! error TS2300: Duplicate identifier 'a'. }; - ~ -!!! error TS1128: Declaration or statement expected. var v = { class }; // error ~ diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt index f5fd8ed53f2..15bac99436f 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesErrorWithModule.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ',' expected. +tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(10,10): error TS1005: ':' expected. tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesErrorWithModule.ts(14,3): error TS2339: Property 'y' does not exist on type 'typeof m'. @@ -14,7 +14,7 @@ tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPr export var y = { m.x // error ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. }; } diff --git a/tests/baselines/reference/parser512097.errors.txt b/tests/baselines/reference/parser512097.errors.txt index 181060db95d..3963d969c34 100644 --- a/tests/baselines/reference/parser512097.errors.txt +++ b/tests/baselines/reference/parser512097.errors.txt @@ -1,16 +1,13 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,14): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,14): error TS1005: ':' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,16): error TS1128: Declaration or statement expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts(1,12): error TS2304: Cannot find name 'aa'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512097.ts (2 errors) ==== var tt = { aa; } // After this point, no useful parsing occurs in the entire file ~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS1128: Declaration or statement expected. - ~~ -!!! error TS2304: Cannot find name 'aa'. if (true) { } \ No newline at end of file diff --git a/tests/baselines/reference/parser645086_1.errors.txt b/tests/baselines/reference/parser645086_1.errors.txt index d326fa23973..f6b76cf26b6 100644 --- a/tests/baselines/reference/parser645086_1.errors.txt +++ b/tests/baselines/reference/parser645086_1.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,13): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,14): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1162: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts (3 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,1 ~ !!! error TS1134: Variable declaration expected. -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parser645086_2.errors.txt b/tests/baselines/reference/parser645086_2.errors.txt index 2d40b3c8f78..558ff5964e0 100644 --- a/tests/baselines/reference/parser645086_2.errors.txt +++ b/tests/baselines/reference/parser645086_2.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,14): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,15): error TS1134: Variable declaration expected. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1162: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts (3 errors) ==== @@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,1 ~ !!! error TS1134: Variable declaration expected. -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt index 1c526f0c9ec..55667d42de5 100644 --- a/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt +++ b/tests/baselines/reference/parserErrorRecovery_ObjectLiteral2.errors.txt @@ -1,14 +1,11 @@ -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(2,1): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(2,1): error TS1005: ':' expected. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(2,7): error TS1005: ':' expected. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts(1,11): error TS2304: Cannot find name 'a'. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ObjectLiterals/parserErrorRecovery_ObjectLiteral2.ts (2 errors) ==== var v = { a - ~ -!!! error TS2304: Cannot find name 'a'. return; ~~~~~~ -!!! error TS1005: ',' expected. +!!! error TS1005: ':' expected. ~ !!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserMissingToken2.errors.txt b/tests/baselines/reference/parserMissingToken2.errors.txt index 31012c0865e..8ac17692335 100644 --- a/tests/baselines/reference/parserMissingToken2.errors.txt +++ b/tests/baselines/reference/parserMissingToken2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,2): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,2): error TS1162: Unterminated regular expression literal. ==== tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts (1 errors) ==== / b; -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt index 7ea76fc24d1..cbe05bd1735 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1161: Unterminated regular expression literal. +tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1162: Unterminated regular expression literal. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,17): error TS1005: ')' expected. tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,1): error TS2304: Cannot find name 'foo'. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre ==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts (3 errors) ==== foo(/notregexp); -!!! error TS1161: Unterminated regular expression literal. +!!! error TS1162: Unterminated regular expression literal. !!! error TS1005: ')' expected. ~~~ diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt index a64f5379e47..97e424c01aa 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1160: Unterminated template literal. +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1161: Unterminated template literal. ==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,1 // Incomplete call, not enough parameters. f `123qdawdrqw -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt index fab10f8a888..cce51b90ef0 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1160: Unterminated template literal. +tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1161: Unterminated template literal. ==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts (1 errors) ==== @@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4 // Incomplete call, not enough parameters, at EOF. f ` -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt index 3bf910f3690..675a987192f 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1158: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1160: Unterminated template literal. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1161: Unterminated template literal. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,20): error TS2304: Cannot find name 'yield'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS2304: Cannot find name 'def'. @@ -26,4 +26,4 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts( } -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt index 4e62197e031..ff81519d360 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS1003: Identifier expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,17): error TS1005: ';' expected. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1158: Invalid template literal; expected '}' -tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1160: Unterminated template literal. +tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1161: Unterminated template literal. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,11): error TS2304: Cannot find name 'gen'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,20): error TS2304: Cannot find name 'yield'. tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,30): error TS2304: Cannot find name 'def'. @@ -26,4 +26,4 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6. } -!!! error TS1160: Unterminated template literal. \ No newline at end of file +!!! error TS1161: Unterminated template literal. \ No newline at end of file diff --git a/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt b/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt index fa8959e90bf..271a1a3074e 100644 --- a/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt +++ b/tests/baselines/reference/unterminatedRegexAtEndOfSource1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1161: Unterminated regular expression literal. +tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1162: Unterminated regular expression literal. ==== tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts (1 errors) ==== var a = / -!!! error TS1161: Unterminated regular expression literal. \ No newline at end of file +!!! error TS1162: Unterminated regular expression literal. \ No newline at end of file diff --git a/tests/cases/fourslash/formattingNestedScopes.ts b/tests/cases/fourslash/formattingNestedScopes.ts new file mode 100644 index 00000000000..269a67dcaaf --- /dev/null +++ b/tests/cases/fourslash/formattingNestedScopes.ts @@ -0,0 +1,27 @@ +/// + +/////*1*/ module My.App { +/////*2*/export var appModule = angular.module("app", [ +/////*3*/ ]).config([() => { +/////*4*/ configureStates +/////*5*/($stateProvider); +/////*6*/}]).run(My.App.setup); +/////*7*/ } + + +format.document() + +goTo.marker("1"); +verify.currentLineContentIs("module My.App {"); +goTo.marker("2"); +verify.currentLineContentIs(" export var appModule = angular.module(\"app\", ["); +goTo.marker("3"); +verify.currentLineContentIs(" ]).config([() => {"); +goTo.marker("4"); +verify.currentLineContentIs(" configureStates"); +goTo.marker("5"); +verify.currentLineContentIs(" ($stateProvider);"); +goTo.marker("6"); +verify.currentLineContentIs(" }]).run(My.App.setup);"); +goTo.marker("7"); +verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/getImplementors1.ts b/tests/cases/fourslash/getImplementors1.ts deleted file mode 100644 index c67e246002c..00000000000 --- a/tests/cases/fourslash/getImplementors1.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////class C { -//// /**/p; -////} - -goTo.marker(); -verify.implementorsCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/getImplementorsForFunction.ts b/tests/cases/fourslash/getImplementorsForFunction.ts deleted file mode 100644 index d2df60dc14d..00000000000 --- a/tests/cases/fourslash/getImplementorsForFunction.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -////function fo/**/o() { -////} - -goTo.marker(); -verify.implementorsCountIs(0); diff --git a/tests/cases/fourslash/quickInfoForRequire.ts b/tests/cases/fourslash/quickInfoForRequire.ts new file mode 100644 index 00000000000..91d59cb4318 --- /dev/null +++ b/tests/cases/fourslash/quickInfoForRequire.ts @@ -0,0 +1,11 @@ +/// + +//@Filename: AA/BB.ts +////export class a{} + +//@Filename: quickInfoForRequire_input.ts +////import a = require("AA/B/*1*/B"); + +goTo.marker('1'); +verify.quickInfoIs('module a'); +verify.referencesCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentInCallExpressions.ts b/tests/cases/fourslash/smartIndentInCallExpressions.ts new file mode 100644 index 00000000000..1e28932678b --- /dev/null +++ b/tests/cases/fourslash/smartIndentInCallExpressions.ts @@ -0,0 +1,12 @@ +/// + +////module My.App { +//// export var appModule = angular.module("app", [ +//// ]).config([() => { +//// configureStates/*1*/($stateProvider); +//// }]).run(My.App.setup); +////} + +goTo.marker("1") +edit.insert("\n"); +verify.indentationIs(12); // 4 (module block) + 4 (function block) + 4 (call expression) \ No newline at end of file diff --git a/tests/cases/fourslash_old/callSignatureHelp.ts b/tests/cases/fourslash_old/callSignatureHelp.ts deleted file mode 100644 index 4e813dd17c4..00000000000 --- a/tests/cases/fourslash_old/callSignatureHelp.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////interface C { -//// (): number; -////} -////var c: C; -////c(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('c(): number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts b/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts deleted file mode 100644 index ebdccef485f..00000000000 --- a/tests/cases/fourslash_old/classExtendsInterfaceSigHelp1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////class C { -//// public foo(x: string); -//// public foo(x: number); -//// public foo(x: any) { return x; } -////} - -////interface I extends C { -//// other(x: any): any; -////} - -////var i: I; -////i.foo(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); -verify.currentParameterSpanIs('x: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts b/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts deleted file mode 100644 index bb04cd2ce68..00000000000 --- a/tests/cases/fourslash_old/completionListInObjectLiteralThatIsParameterOfFunctionCall.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////class C { x: string; } -////class D { x: string; y: string; } -////function foo(t: T, t2: U) { return null; } -////var r3 = foo(new C(), { x: '', z/*1*/ - -goTo.marker('1') -verify.not.completionListContains('z'); -verify.not.completionListContains('x'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/functionOverloadCount.ts b/tests/cases/fourslash_old/functionOverloadCount.ts deleted file mode 100644 index 00856dcb24a..00000000000 --- a/tests/cases/fourslash_old/functionOverloadCount.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////class C1 { -//// public attr(): string; -//// public attr(i: number): string; -//// public attr(i: number, x: boolean): string; -//// public attr(i?: any, x?: any) { -//// return "hi"; -//// } -////} -////var i = new C1; -////i.attr(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts deleted file mode 100644 index fc1e45d7e6b..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp1.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////function f(a: T): T { return null; } -////f(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('f(a: T): T'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts deleted file mode 100644 index 77511677588..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp2.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////var f = (a: T) => a; -////f(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs('f(a: T): T'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts deleted file mode 100644 index 5f3adc60258..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp3.ts +++ /dev/null @@ -1,39 +0,0 @@ -/// - -////function foo1(x: number, callback: (y1: T) => number) { } -////function foo2(x: number, callback: (y2: T) => number) { } -////function foo3(x: number, callback: (y3: T) => number) { } -////function foo4(x: number, callback: (y4: T) => number) { } -////function foo5(x: number, callback: (y5: T) => number) { } -////function foo6(x: number, callback: (y6: T) => number) { } -////function foo7(x: number, callback: (y7: T) => number) { } -//// IDE shows the results on the right of each line, fourslash says different -////foo1(/*1*/ // signature help shows y as T -////foo2(1,/*2*/ // signature help shows y as {} -////foo3(1, (/*3*/ // signature help shows y as T -////foo4(1,/*4*/ // signature help shows y as string -////foo5(1, (/*5*/ // signature help shows y as T -////foo6(1, (/*7*/ // signature help shows y as T - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo1(x: number, callback: (y1: T) => number): void'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('foo3(x: number, callback: (y3: T) => number): void'); - -goTo.marker('4'); -verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void'); - -goTo.marker('5'); -verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: T) => number): void'); - -goTo.marker('6'); -verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void'); -edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests - -goTo.marker('7'); -verify.currentSignatureHelpIs('foo7(x: number, callback: (y7: T) => number): void'); diff --git a/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts b/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts deleted file mode 100644 index dbb0a9fe83e..00000000000 --- a/tests/cases/fourslash_old/genericFunctionSignatureHelp3MultiFile.ts +++ /dev/null @@ -1,46 +0,0 @@ -/// - -// @Filename: genericFunctionSignatureHelp_0.ts -////function foo1(x: number, callback: (y1: T) => number) { } -// @Filename: genericFunctionSignatureHelp_1.ts -////function foo2(x: number, callback: (y2: T) => number) { } -// @Filename: genericFunctionSignatureHelp_2.ts -////function foo3(x: number, callback: (y3: T) => number) { } -// @Filename: genericFunctionSignatureHelp_3.ts -////function foo4(x: number, callback: (y4: T) => number) { } -// @Filename: genericFunctionSignatureHelp_4.ts -////function foo5(x: number, callback: (y5: T) => number) { } -// @Filename: genericFunctionSignatureHelp_5.ts -////function foo6(x: number, callback: (y6: T) => number) { } -// @Filename: genericFunctionSignatureHelp_6.ts -////function foo7(x: number, callback: (y7: T) => number) { } -// @Filename: genericFunctionSignatureHelp_7.ts -////foo1(/*1*/ // signature help shows y as T -////foo2(1,/*2*/ // signature help shows y as {} -////foo3(1, (/*3*/ // signature help shows y as T -////foo4(1,/*4*/ // signature help shows y as string -////foo5(1, (/*5*/ // signature help shows y as T -////foo6(1, (/*7*/ // signature help shows y as T - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo1(x: number, callback: (y1: T) => number): void'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('foo3(x: number, callback: (y3: T) => number): void'); - -goTo.marker('4'); -verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void'); - -goTo.marker('5'); -verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: T) => number): void'); - -goTo.marker('6'); -verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void'); -edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests - -goTo.marker('7'); -verify.currentSignatureHelpIs('foo7(x: number, callback: (y7: T) => number): void'); diff --git a/tests/cases/fourslash_old/getOutliningSpans.ts b/tests/cases/fourslash_old/getOutliningSpans.ts deleted file mode 100644 index 56a4aa7120c..00000000000 --- a/tests/cases/fourslash_old/getOutliningSpans.ts +++ /dev/null @@ -1,97 +0,0 @@ -/// - -////// interface -////interface IFoo[| { -//// getDist(): number; -////}|] -//// -////// class members -////class Foo[| { -//// constructor()[| { -//// }|] -//// -//// public foo(): number[| { -//// return 0; -//// }|] -//// -//// public get X()[| { -//// return 1; -//// }|] -//// -//// public set X(v: number)[| { -//// }|] -//// -//// public member = function f()[| { -//// -//// }|] -////}|] -//// -////// modules -////module m1[| { -//// module m2[| { }|] -//// module m3[| { -//// function foo()[| { -//// -//// }|] -//// -//// interface IFoo2[| { -//// -//// }|] -//// -//// class foo2 implements IFoo2[| { -//// -//// }|] -//// }|] -////}|] -//// -////// function declaration -////function foo(): number[| { -//// return 0; -////}|] -//// -////// function expressions -////(function f()[| { -//// -////}|]) -//// -////// trivia handeling -////class ClassFooWithTrivia[| /* some comments */ -//// /* more trivia */ { -//// -//// -//// /*some trailing trivia */ -////}|] /* even more */ -//// -//////outline with deep nesting -////module m1[|{ -//// module m2[| { -//// module m3[| { -//// module m4[| { -//// module m5[| { -//// module m6[| { -//// module m7[| { -//// module m8[| { -//// module m9[| { -//// module m10[| { -//// module m11 { -//// module m12 { -//// export interface IFoo { -//// } -//// } -//// } -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -//// }|] -////}|] -//// -//////outline after a deeply nested node -////class AfterNestedNodes[| { -////}|] - -verify.outliningSpansInCurrentFile(test.ranges()); diff --git a/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts b/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts deleted file mode 100644 index 8a06efbaa44..00000000000 --- a/tests/cases/fourslash_old/incrementalEditInvocationExpressionAboveInterfaceDeclaration.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////declare function alert(message?: any): void; -/////*1*/ -////interface Foo { -//// setISO8601(dString): Date; -////} - -diagnostics.setEditValidation(IncrementalEditValidation.None); - -// Do resolve without typeCheck -goTo.marker('1'); -edit.insert("alert("); -verify.currentSignatureHelpIs("alert(message?: any): void"); - -// TypeCheck -verify.errorExistsAfterMarker('1'); diff --git a/tests/cases/fourslash_old/paramHelpOnCommaInString.ts b/tests/cases/fourslash_old/paramHelpOnCommaInString.ts deleted file mode 100644 index 00271781582..00000000000 --- a/tests/cases/fourslash_old/paramHelpOnCommaInString.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////function blah(foo: string, bar: number) { -////} -////blah('hola/*1*/,/*2*/') - -// making sure the comma in a string literal doesn't trigger param help on the second function param -goTo.marker('1'); -verify.currentParameterHelpArgumentNameIs('foo'); -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/parameterInfoOnParameterType.ts b/tests/cases/fourslash_old/parameterInfoOnParameterType.ts deleted file mode 100644 index d28e675e24f..00000000000 --- a/tests/cases/fourslash_old/parameterInfoOnParameterType.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////function foo(a: string) { }; -////var b = "test"; -////foo("test"/*1*/); -////foo(b/*2*/); - -goTo.marker("1"); -verify.currentParameterHelpArgumentNameIs("a"); -goTo.marker("2"); -verify.currentParameterHelpArgumentNameIs("a"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/restArgSignatureHelp.ts b/tests/cases/fourslash_old/restArgSignatureHelp.ts deleted file mode 100644 index baa8702a5f6..00000000000 --- a/tests/cases/fourslash_old/restArgSignatureHelp.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////function f(...x: any[]) { } -////f(/**/); - -goTo.marker(); -verify.currentParameterHelpArgumentNameIs('x'); diff --git a/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts b/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts deleted file mode 100644 index cc723c713d6..00000000000 --- a/tests/cases/fourslash_old/signatureHelpAnonymousFunction.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////var anonymousFunctionTest = function(n: number, s: string): (a: number, b: string) => string { -//// return null; -////} -////anonymousFunctionTest(5, "")(/*anonymousFunction1*/1, /*anonymousFunction2*/""); - -goTo.marker('anonymousFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('(a: number, b: string): string'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('anonymousFunction2'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); diff --git a/tests/cases/fourslash_old/signatureHelpAtEOF.ts b/tests/cases/fourslash_old/signatureHelpAtEOF.ts deleted file mode 100644 index 64c4aaeeb2c..00000000000 --- a/tests/cases/fourslash_old/signatureHelpAtEOF.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////function Foo(arg1: string, arg2: string) { -////} -//// -////Foo(/**/ - -goTo.marker(); -verify.signatureHelpPresent(); -verify.signatureHelpCountIs(1); - -verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); -verify.currentParameterHelpArgumentNameIs("arg1"); -verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts b/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts deleted file mode 100644 index 2b0b07056bf..00000000000 --- a/tests/cases/fourslash_old/signatureHelpBeforeSemicolon1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////function Foo(arg1: string, arg2: string) { -////} -//// -////Foo(/**/; - -goTo.marker(); -verify.signatureHelpPresent(); -verify.signatureHelpCountIs(1); - -verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void"); -verify.currentSignatureParamterCountIs(2); -verify.currentParameterHelpArgumentNameIs("arg1"); -verify.currentParameterSpanIs("arg1: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpCallExpression.ts b/tests/cases/fourslash_old/signatureHelpCallExpression.ts deleted file mode 100644 index 50d89aaae4e..00000000000 --- a/tests/cases/fourslash_old/signatureHelpCallExpression.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -////function fnTest(str: string, num: number) { } -////fnTest(/*1*/'', /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('fnTest(str: string, num: number): void'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructExpression.ts b/tests/cases/fourslash_old/signatureHelpConstructExpression.ts deleted file mode 100644 index a88cb3fce68..00000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////class sampleCls { constructor(str: string, num: number) { } } -////var x = new sampleCls(/*1*/"", /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); - -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts b/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts deleted file mode 100644 index b066eab3fd4..00000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructorInheritance.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -////class base { -//// constructor(s: string); -//// constructor(n: number); -//// constructor(a: any) { } -////} -////class B1 extends base { } -////class B2 extends B1 { } -////class B3 extends B2 { -//// constructor() { -//// super(/*indirectSuperCall*/3); -//// } -////} - - -goTo.marker('indirectSuperCall'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('B2(n: number): B2'); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts b/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts deleted file mode 100644 index ce276e09d8f..00000000000 --- a/tests/cases/fourslash_old/signatureHelpConstructorOverload.ts +++ /dev/null @@ -1,16 +0,0 @@ -/// - -////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } -////var x = new clsOverload(/*1*/); -////var y = new clsOverload(/*2*/''); - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); -verify.currentSignatureHelpIs('clsOverload(): clsOverload'); - -goTo.marker('2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload'); -verify.currentParameterHelpArgumentNameIs('test'); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts b/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts deleted file mode 100644 index 58e083ea2ed..00000000000 --- a/tests/cases/fourslash_old/signatureHelpForSuperCalls1.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -////class A { } -////class B extends A { } -////class C extends B { -//// constructor() { -//// super(/*1*/ // sig help here? -//// } -////} -////class A2 { } -////class B2 extends A2 { -//// constructor(x:number) {} -//// } -////class C2 extends B2 { -//// constructor() { -//// super(/*2*/ // sig help here? -//// } -////} - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('1'); -verify.signatureHelpPresent(); -verify.currentSignatureHelpIs('B(): B'); - -goTo.marker('2'); -verify.currentSignatureHelpIs('B2(x: number): B2'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts b/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts deleted file mode 100644 index 2c1cdb51291..00000000000 --- a/tests/cases/fourslash_old/signatureHelpFunctionOverload.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////function functionOverload(); -////function functionOverload(test: string); -////function functionOverload(test?: string) { } -////functionOverload(/*functionOverload1*/); -////functionOverload(""/*functionOverload2*/); - -goTo.marker('functionOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParamterCountIs(0); -verify.currentSignatureHelpIs('functionOverload(): any'); - -goTo.marker('functionOverload2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs('functionOverload(test: string): any'); -verify.currentParameterHelpArgumentNameIs("test"); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts b/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts deleted file mode 100644 index cb2264f2c42..00000000000 --- a/tests/cases/fourslash_old/signatureHelpFunctionParameter.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////function parameterFunction(callback: (a: number, b: string) => void) { -//// callback(/*parameterFunction1*/5, /*parameterFunction2*/""); -////} - -goTo.marker('parameterFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('parameterFunction2'); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts b/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts deleted file mode 100644 index 9e42d25dbe9..00000000000 --- a/tests/cases/fourslash_old/signatureHelpImplicitConstructor.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////class ImplicitConstructor { -////} -////var implicitConstructor = new ImplicitConstructor(/**/); - -goTo.marker(); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor"); -verify.currentSignatureParamterCountIs(0); diff --git a/tests/cases/fourslash_old/signatureHelpInCallback.ts b/tests/cases/fourslash_old/signatureHelpInCallback.ts deleted file mode 100644 index dd4856b48ef..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInCallback.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////declare function forEach(f: () => void); -////forEach(/*1*/() => { -//// /*2*/ -////}); - -goTo.marker('1'); -verify.signatureHelpPresent(); -goTo.marker('2'); -verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts b/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts deleted file mode 100644 index 12036cd6db6..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInCompleteGenericsCall.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -////function foo(x: number, callback: (x: T) => number) { -////} -////foo(/*1*/ - -goTo.marker('1'); -verify.currentSignatureHelpIs("foo(x: number, callback: (x: T) => number): void"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts b/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts deleted file mode 100644 index 2339af02529..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file0.ts -////declare function fn(x: string, y: number); - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file1.ts -////declare function fn(x: string); - -// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file2.ts -////fn(/*1*/ - -diagnostics.setEditValidation(IncrementalEditValidation.None); -goTo.marker('1'); -verify.signatureHelpCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts b/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts deleted file mode 100644 index 2e097b2a76a..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInIncompleteInvocationExpression.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -/////** -//// * Returns the substring at the specified location within a String object. -//// * @param start The zero-based index integer indicating the beginning of the substring. -//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. -//// * If end is omitted, the characters from start through the end of the original string are returned. -//// */ -////function foo(start: number, end?: number) { -//// return ""; -////} -//// -////foo(/*1*/ -goTo.marker('1'); -verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring."); -edit.insert("10,"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(" "); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); diff --git a/tests/cases/fourslash_old/signatureHelpInParenthetical.ts b/tests/cases/fourslash_old/signatureHelpInParenthetical.ts deleted file mode 100644 index 0628d904fdc..00000000000 --- a/tests/cases/fourslash_old/signatureHelpInParenthetical.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -//// class base { constructor (public n: number, public y: string) { } } -//// (new base(/**/ - -goTo.marker(); -verify.currentParameterHelpArgumentNameIs('n'); -edit.insert('0, '); -verify.currentParameterHelpArgumentNameIs('y'); diff --git a/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts b/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts deleted file mode 100644 index e73217b1d8c..00000000000 --- a/tests/cases/fourslash_old/signatureHelpIncompleteCalls.ts +++ /dev/null @@ -1,31 +0,0 @@ -/// - -////module IncompleteCalls { -//// class Foo { -//// public f1() { } -//// public f2(n: number): number { return 0; } -//// public f3(n: number, s: string) : string { return ""; } -//// } -//// var x = new Foo(); -//// x.f1(); -//// x.f2(5); -//// x.f3(5, ""); -//// x.f1(/*incompleteCalls1*/ -//// x.f2(5,/*incompleteCalls2*/ -//// x.f3(5,/*incompleteCalls3*/ -////} - -goTo.marker('incompleteCalls1'); -verify.currentSignatureHelpIs("f1(): void"); -verify.currentSignatureParamterCountIs(0); - -goTo.marker('incompleteCalls2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs("f2(n: number): number"); -goTo.marker('incompleteCalls3'); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs("f3(n: number, s: string): string"); - -verify.currentParameterHelpArgumentNameIs("s"); -verify.currentParameterSpanIs("s: string"); - diff --git a/tests/cases/fourslash_old/signatureHelpNoArguments.ts b/tests/cases/fourslash_old/signatureHelpNoArguments.ts deleted file mode 100644 index 16a1896a741..00000000000 --- a/tests/cases/fourslash_old/signatureHelpNoArguments.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// - - -////function foo(n: number): string { -////} -//// -////foo(/**/ - -goTo.marker(); -verify.currentSignatureHelpIs("foo(n: number): string"); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts b/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts deleted file mode 100644 index cbc5df697b9..00000000000 --- a/tests/cases/fourslash_old/signatureHelpObjectLiteral.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////var objectLiteral = { n: 5, s: "", f: (a: number, b: string) => "" }; -////objectLiteral.f(/*objectLiteral1*/4, /*objectLiteral2*/""); - -goTo.marker('objectLiteral1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParamterCountIs(2); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); - -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('objectLiteral2'); -verify.currentSignatureHelpIs('f(a: number, b: string): string'); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts b/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts deleted file mode 100644 index 8edd0617d70..00000000000 --- a/tests/cases/fourslash_old/signatureHelpOnOverloadOnConst.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -////function x1(x: 'hi'); -////function x1(y: 'bye'); -////function x1(z: string); -////function x1(a: any) { -////} -//// -////x1(''/*1*/); -////x1('hi'/*2*/); -////x1('bye'/*3*/); - -goTo.marker('1'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("z"); -verify.currentParameterSpanIs("z: string"); - -goTo.marker('2'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: 'hi'"); - -goTo.marker('3'); -verify.signatureHelpCountIs(3); -verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: 'bye'"); diff --git a/tests/cases/fourslash_old/signatureHelpOnOverloads.ts b/tests/cases/fourslash_old/signatureHelpOnOverloads.ts deleted file mode 100644 index 9712c9dc301..00000000000 --- a/tests/cases/fourslash_old/signatureHelpOnOverloads.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////declare function fn(x: string); -////declare function fn(x: string, y: number); -////fn(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("fn(x: string): any"); -verify.currentParameterHelpArgumentNameIs("x"); -verify.currentParameterSpanIs("x: string"); - -edit.insert("'',"); - -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("fn(x: string, y: number): any"); -verify.currentParameterHelpArgumentNameIs("y"); -verify.currentParameterSpanIs("y: number"); diff --git a/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts b/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts deleted file mode 100644 index 5613ca71a70..00000000000 --- a/tests/cases/fourslash_old/signatureHelpOnSuperWhenMembersAreNotResolved.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -////class A { } -////class B extends A { constructor(public x: string) { } } -////class C extends B { -//// constructor() { -//// /*1*/ -//// } -////} - -diagnostics.setEditValidation(IncrementalEditValidation.None); -goTo.marker("1"); -edit.insert("super("); -verify.currentSignatureHelpIs("B(x: string): B"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts deleted file mode 100644 index 81af0422f9a..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleConstructorCall.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// - -////class ConstructorCall { -//// constructor(str: string, num: number) { -//// } -////} -////var x = new ConstructorCall(/*constructorCall1*/1,/*constructorCall2*/2); - -goTo.marker('constructorCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); -goTo.marker('constructorCall2'); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("num"); -verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts deleted file mode 100644 index 6e5817ad90d..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleFunctionCall.ts +++ /dev/null @@ -1,19 +0,0 @@ -/// - -////// Simple function test -////function functionCall(str: string, num: number) { -////} -////functionCall(/*functionCall1*/); -////functionCall("", /*functionCall2*/1); - - -goTo.marker('functionCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); -goTo.marker('functionCall2'); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("num"); -verify.currentParameterSpanIs("num: number"); - diff --git a/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts b/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts deleted file mode 100644 index ff8913a6b04..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSimpleSuperCall.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -////class SuperCallBase { -//// constructor(b: boolean) { -//// } -////} -////class SuperCall extends SuperCallBase { -//// constructor() { -//// super(/*superCall*/); -//// } -////} - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('superCall'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("SuperCallBase(b: boolean): SuperCallBase"); -verify.currentParameterHelpArgumentNameIs("b"); -verify.currentParameterSpanIs("b: boolean"); diff --git a/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts b/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts deleted file mode 100644 index 1be8c3202a1..00000000000 --- a/tests/cases/fourslash_old/signatureHelpSuperConstructorOverload.ts +++ /dev/null @@ -1,28 +0,0 @@ -/// - -////class SuperOverloadlBase { -//// constructor(); -//// constructor(test: string); -//// constructor(test?: string) { -//// } -////} -////class SuperOverLoad1 extends SuperOverloadlBase { -//// constructor() { -//// super(/*superOverload1*/); -//// } -////} -////class SuperOverLoad2 extends SuperOverloadlBase { -//// constructor() { -//// super(""/*superOverload2*/); -//// } -////} - -goTo.marker('superOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase"); -verify.currentSignatureParamterCountIs(0); -goTo.marker('superOverload2'); -verify.currentSignatureParamterCountIs(1); -verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase"); -verify.currentParameterHelpArgumentNameIs("test"); -verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts b/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts deleted file mode 100644 index 61e51d0a4e7..00000000000 --- a/tests/cases/fourslash_old/signatureHelpWhenEditingCallExpression.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// - -/////** -//// * Returns the substring at the specified location within a String object. -//// * @param start The zero-based index integer indicating the beginning of the substring. -//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. -//// * If end is omitted, the characters from start through the end of the original string are returned. -//// */ -////function foo(start: number, end?: number) { -//// return ""; -////} -//// -////fo/*1*/ -goTo.marker('1'); -verify.not.signatureHelpPresent(); -edit.insert("o"); -verify.not.signatureHelpPresent(); -edit.insert("("); -verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring."); -edit.insert("10,"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(" "); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(", "); -edit.backspace(3); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert("12"); -verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned."); -edit.insert(")"); -verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash_old/staticGenericOverloads1.ts b/tests/cases/fourslash_old/staticGenericOverloads1.ts deleted file mode 100644 index 141d88eed4a..00000000000 --- a/tests/cases/fourslash_old/staticGenericOverloads1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/// - -////class A { -//// static B(v: A): A; -//// static B(v: S): A; -//// static B(v: any): A { -//// return null; -//// } -////} - -////var a = new A(); -////A.B(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); -edit.insert('a'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs('B(v: A): A') -edit.insert('); A.B('); -verify.currentSignatureHelpIs('B(v: A): A'); -edit.insert('a'); -verify.currentSignatureHelpIs('B(v: A): A') diff --git a/tests/cases/fourslash_old/todoComments1.ts b/tests/cases/fourslash_old/todoComments1.ts deleted file mode 100644 index 900b4694c6b..00000000000 --- a/tests/cases/fourslash_old/todoComments1.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // [|TODO|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments10.ts b/tests/cases/fourslash_old/todoComments10.ts deleted file mode 100644 index 26ee7a40141..00000000000 --- a/tests/cases/fourslash_old/todoComments10.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|todo 1|] -//// [|hack 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments11.ts b/tests/cases/fourslash_old/todoComments11.ts deleted file mode 100644 index 976368315d4..00000000000 --- a/tests/cases/fourslash_old/todoComments11.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO(jason) 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments12.ts b/tests/cases/fourslash_old/todoComments12.ts deleted file mode 100644 index d9cd3dea4db..00000000000 --- a/tests/cases/fourslash_old/todoComments12.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO(jason) 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["HACK", "TODO(jason)"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments13.ts b/tests/cases/fourslash_old/todoComments13.ts deleted file mode 100644 index 93147b30e47..00000000000 --- a/tests/cases/fourslash_old/todoComments13.ts +++ /dev/null @@ -1,4 +0,0 @@ -//// TODO - -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments14.ts b/tests/cases/fourslash_old/todoComments14.ts deleted file mode 100644 index 46f8f48fe30..00000000000 --- a/tests/cases/fourslash_old/todoComments14.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// BAR // [|TODO|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments15.ts b/tests/cases/fourslash_old/todoComments15.ts deleted file mode 100644 index 22cee54d0fc..00000000000 --- a/tests/cases/fourslash_old/todoComments15.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// "// HACK 1"; -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments16.ts b/tests/cases/fourslash_old/todoComments16.ts deleted file mode 100644 index bbdeac0c5e8..00000000000 --- a/tests/cases/fourslash_old/todoComments16.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// //// [|HACK 1|] -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments17.ts b/tests/cases/fourslash_old/todoComments17.ts deleted file mode 100644 index 52316941602..00000000000 --- a/tests/cases/fourslash_old/todoComments17.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// /**** [|HACK 1 |]*/ a -debugger; -verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments2.ts b/tests/cases/fourslash_old/todoComments2.ts deleted file mode 100644 index b58b0fda7a7..00000000000 --- a/tests/cases/fourslash_old/todoComments2.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // not TODO -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments3.ts b/tests/cases/fourslash_old/todoComments3.ts deleted file mode 100644 index 62eb02642e9..00000000000 --- a/tests/cases/fourslash_old/todoComments3.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // [|TODO with stuff|] -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments4.ts b/tests/cases/fourslash_old/todoComments4.ts deleted file mode 100644 index c9ec94785f8..00000000000 --- a/tests/cases/fourslash_old/todoComments4.ts +++ /dev/null @@ -1,3 +0,0 @@ -//// // TODOnomatch -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments5.ts b/tests/cases/fourslash_old/todoComments5.ts deleted file mode 100644 index 157ac162a8c..00000000000 --- a/tests/cases/fourslash_old/todoComments5.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO 1|] -//// [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments6.ts b/tests/cases/fourslash_old/todoComments6.ts deleted file mode 100644 index 0d2692511cb..00000000000 --- a/tests/cases/fourslash_old/todoComments6.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// * [|TODO 1|] -//// * [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments7.ts b/tests/cases/fourslash_old/todoComments7.ts deleted file mode 100644 index ffb5bcf6603..00000000000 --- a/tests/cases/fourslash_old/todoComments7.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO 1|] -//// [|HACK 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments8.ts b/tests/cases/fourslash_old/todoComments8.ts deleted file mode 100644 index 5d53b7b57c2..00000000000 --- a/tests/cases/fourslash_old/todoComments8.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|HACK 1|] -//// [|TODO 2|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file diff --git a/tests/cases/fourslash_old/todoComments9.ts b/tests/cases/fourslash_old/todoComments9.ts deleted file mode 100644 index 36cba71cecf..00000000000 --- a/tests/cases/fourslash_old/todoComments9.ts +++ /dev/null @@ -1,6 +0,0 @@ -//// /* -//// [|TODO HACK|] -//// [|HACK TODO|] -//// */ -debugger; -verify.todoCommentsInCurrentFile(["TODO", "HACK"]); \ No newline at end of file