Merge branch 'master' into grammarChecks

Conflicts:
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
	tests/baselines/reference/objectTypesWithOptionalProperties.errors.txt
This commit is contained in:
Cyrus Najmabadi 2014-11-19 17:29:39 -08:00
commit f605699604
100 changed files with 409 additions and 1305 deletions

View file

@ -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);

View file

@ -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 () {

View file

@ -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);

View file

@ -153,9 +153,9 @@ module ts {
parseStrings(commandLine);
return {
options: options,
filenames: filenames,
errors: errors
options,
filenames,
errors
};
function parseStrings(args: string[]) {

View file

@ -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
};
}

View file

@ -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." },

View file

@ -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: (<Declaration>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>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>node.name,
typeName: undefined
};
@ -3286,7 +3286,7 @@ module ts {
}
return {
diagnosticMessage: diagnosticMessage,
diagnosticMessage,
errorNode: <Node>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
};
}

View file

@ -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 = <ShortHandPropertyDeclaration>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
};
}

View file

@ -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,
};
}
}

View file

@ -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);

View file

@ -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() {

View file

@ -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;

View file

@ -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<string>(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
};
}

View file

@ -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) {

View file

@ -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 {

View file

@ -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 };
}
});

View file

@ -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) {

View file

@ -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
};

View file

@ -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 ? (<Identifier>container.name).text : "",
containerKind: container.name ? getNodeKind(container) : ""
containerName: container && container.name ? (<Identifier>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() {

View file

@ -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
/**

View file

@ -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
};
}

View file

@ -222,7 +222,8 @@ module ts.formatting {
if (node.parent) {
switch (node.parent.kind) {
case SyntaxKind.TypeReference:
if ((<TypeReferenceNode>node.parent).typeArguments) {
if ((<TypeReferenceNode>node.parent).typeArguments &&
rangeContainsStartEnd((<TypeReferenceNode>node.parent).typeArguments, node.getStart(sourceFile), node.getEnd())) {
return (<TypeReferenceNode>node.parent).typeArguments;
}
break;
@ -236,21 +237,28 @@ module ts.formatting {
case SyntaxKind.Method:
case SyntaxKind.CallSignature:
case SyntaxKind.ConstructSignature:
if ((<SignatureDeclaration>node.parent).typeParameters && node.end < (<SignatureDeclaration>node.parent).typeParameters.end) {
var start = node.getStart(sourceFile);
if ((<SignatureDeclaration>node.parent).typeParameters &&
rangeContainsStartEnd((<SignatureDeclaration>node.parent).typeParameters, start, node.getEnd())) {
return (<SignatureDeclaration>node.parent).typeParameters;
}
return (<SignatureDeclaration>node.parent).parameters;
if (rangeContainsStartEnd((<SignatureDeclaration>node.parent).parameters, start, node.getEnd())) {
return (<SignatureDeclaration>node.parent).parameters;
}
break;
case SyntaxKind.NewExpression:
case SyntaxKind.CallExpression:
if ((<CallExpression>node.parent).typeArguments && node.end < (<CallExpression>node.parent).typeArguments.end) {
var start = node.getStart(sourceFile);
if ((<CallExpression>node.parent).typeArguments &&
rangeContainsStartEnd((<CallExpression>node.parent).typeArguments, start, node.getEnd())) {
return (<CallExpression>node.parent).typeArguments;
}
return (<CallExpression>node.parent).arguments;
if (rangeContainsStartEnd((<CallExpression>node.parent).arguments, start, node.getEnd())) {
return (<CallExpression>node.parent).arguments;
}
break;
}
}
return undefined;
}

View file

@ -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
};
}

View file

@ -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;

View file

@ -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
~

View file

@ -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.
};
}

View file

@ -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) {
}

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

@ -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.

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

@ -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.
~~~

View file

@ -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.
!!! error TS1161: Unterminated template literal.

View file

@ -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.
!!! error TS1161: Unterminated template literal.

View file

@ -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.
!!! error TS1161: Unterminated template literal.

View file

@ -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.
!!! error TS1161: Unterminated template literal.

View file

@ -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.
!!! error TS1162: Unterminated regular expression literal.

View file

@ -0,0 +1,27 @@
/// <reference path='fourslash.ts'/>
/////*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("}");

View file

@ -1,8 +0,0 @@
///<reference path="fourslash.ts" />
////class C {
//// /**/p;
////}
goTo.marker();
verify.implementorsCountIs(0);

View file

@ -1,6 +0,0 @@
///<reference path="fourslash.ts" />
////function fo/**/o() {
////}
goTo.marker();
verify.implementorsCountIs(0);

View file

@ -0,0 +1,11 @@
/// <reference path='fourslash.ts'/>
//@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);

View file

@ -0,0 +1,12 @@
/// <reference path='fourslash.ts'/>
////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)

View file

@ -1,10 +0,0 @@
/// <reference path='fourslash.ts'/>
////interface C {
//// (): number;
////}
////var c: C;
////c(/**/
goTo.marker();
verify.currentSignatureHelpIs('c(): number');

View file

@ -1,18 +0,0 @@
/// <reference path='fourslash.ts'/>
////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');

View file

@ -1,10 +0,0 @@
/// <reference path='fourslash.ts'/>
////class C { x: string; }
////class D { x: string; y: string; }
////function foo<T, U extends T>(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');

View file

@ -1,15 +0,0 @@
/// <reference path="fourslash.ts"/>
////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);

View file

@ -1,7 +0,0 @@
/// <reference path='fourslash.ts'/>
////function f<T>(a: T): T { return null; }
////f(/**/
goTo.marker();
verify.currentSignatureHelpIs('f<T>(a: T): T');

View file

@ -1,7 +0,0 @@
/// <reference path='fourslash.ts'/>
////var f = <T>(a: T) => a;
////f(/**/
goTo.marker();
verify.currentSignatureHelpIs('f<T>(a: T): T');

View file

@ -1,39 +0,0 @@
/// <reference path='fourslash.ts'/>
////function foo1<T>(x: number, callback: (y1: T) => number) { }
////function foo2<T>(x: number, callback: (y2: T) => number) { }
////function foo3<T>(x: number, callback: (y3: T) => number) { }
////function foo4<T>(x: number, callback: (y4: T) => number) { }
////function foo5<T>(x: number, callback: (y5: T) => number) { }
////function foo6<T>(x: number, callback: (y6: T) => number) { }
////function foo7<T>(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<string>(1,/*4*/ // signature help shows y as string
////foo5<string>(1, (/*5*/ // signature help shows y as T
////foo6(1, </*6*/ // signature help shows y as {}
////foo7(1, <string>(/*7*/ // signature help shows y as T
goTo.marker('1');
verify.currentSignatureHelpIs('foo1<T>(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<T>(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<T>(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<T>(x: number, callback: (y7: T) => number): void');

View file

@ -1,46 +0,0 @@
/// <reference path='fourslash.ts'/>
// @Filename: genericFunctionSignatureHelp_0.ts
////function foo1<T>(x: number, callback: (y1: T) => number) { }
// @Filename: genericFunctionSignatureHelp_1.ts
////function foo2<T>(x: number, callback: (y2: T) => number) { }
// @Filename: genericFunctionSignatureHelp_2.ts
////function foo3<T>(x: number, callback: (y3: T) => number) { }
// @Filename: genericFunctionSignatureHelp_3.ts
////function foo4<T>(x: number, callback: (y4: T) => number) { }
// @Filename: genericFunctionSignatureHelp_4.ts
////function foo5<T>(x: number, callback: (y5: T) => number) { }
// @Filename: genericFunctionSignatureHelp_5.ts
////function foo6<T>(x: number, callback: (y6: T) => number) { }
// @Filename: genericFunctionSignatureHelp_6.ts
////function foo7<T>(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<string>(1,/*4*/ // signature help shows y as string
////foo5<string>(1, (/*5*/ // signature help shows y as T
////foo6(1, </*6*/ // signature help shows y as {}
////foo7(1, <string>(/*7*/ // signature help shows y as T
goTo.marker('1');
verify.currentSignatureHelpIs('foo1<T>(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<T>(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<T>(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<T>(x: number, callback: (y7: T) => number): void');

View file

@ -1,97 +0,0 @@
/// <reference path="fourslash.ts"/>
////// 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());

View file

@ -1,17 +0,0 @@
/// <reference path="fourslash.ts" />
////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');

View file

@ -1,11 +0,0 @@
/// <reference path='fourslash.ts'/>
////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');

View file

@ -1,11 +0,0 @@
/// <reference path="fourslash.ts"/>
////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");

View file

@ -1,7 +0,0 @@
/// <reference path='fourslash.ts' />
////function f(...x: any[]) { }
////f(/**/);
goTo.marker();
verify.currentParameterHelpArgumentNameIs('x');

View file

@ -1,17 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,15 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,15 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,16 +0,0 @@
/// <reference path='fourslash.ts'/>
////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");

View file

@ -1,17 +0,0 @@
/// <reference path='fourslash.ts'/>
////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");

View file

@ -1,22 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,16 +0,0 @@
/// <reference path='fourslash.ts'/>
////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");

View file

@ -1,28 +0,0 @@
/// <reference path='fourslash.ts'/>
////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');

View file

@ -1,18 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,17 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,10 +0,0 @@
/// <reference path='fourslash.ts' />
////class ImplicitConstructor {
////}
////var implicitConstructor = new ImplicitConstructor(/**/);
goTo.marker();
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor");
verify.currentSignatureParamterCountIs(0);

View file

@ -1,11 +0,0 @@
/// <reference path='fourslash.ts' />
////declare function forEach(f: () => void);
////forEach(/*1*/() => {
//// /*2*/
////});
goTo.marker('1');
verify.signatureHelpPresent();
goTo.marker('2');
verify.not.signatureHelpPresent();

View file

@ -1,8 +0,0 @@
/// <reference path='fourslash.ts'/>
////function foo<T>(x: number, callback: (x: T) => number) {
////}
////foo(/*1*/
goTo.marker('1');
verify.currentSignatureHelpIs("foo<T>(x: number, callback: (x: T) => number): void");

View file

@ -1,14 +0,0 @@
/// <reference path='fourslash.ts' />
// @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);

View file

@ -1,19 +0,0 @@
/// <reference path='fourslash.ts' />
/////**
//// * 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.");

View file

@ -1,9 +0,0 @@
/// <reference path='fourslash.ts' />
//// class base { constructor (public n: number, public y: string) { } }
//// (new base(/**/
goTo.marker();
verify.currentParameterHelpArgumentNameIs('n');
edit.insert('0, ');
verify.currentParameterHelpArgumentNameIs('y');

View file

@ -1,31 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,12 +0,0 @@
/// <reference path='fourslash.ts' />
////function foo(n: number): string {
////}
////
////foo(/**/
goTo.marker();
verify.currentSignatureHelpIs("foo(n: number): string");
verify.currentParameterHelpArgumentNameIs("n");
verify.currentParameterSpanIs("n: number");

View file

@ -1,17 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,26 +0,0 @@
/// <reference path='fourslash.ts'/>
////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'");

View file

@ -1,18 +0,0 @@
/// <reference path='fourslash.ts'/>
////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");

View file

@ -1,14 +0,0 @@
/// <reference path="fourslash.ts" />
////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");

View file

@ -1,17 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,19 +0,0 @@
/// <reference path='fourslash.ts' />
////// 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");

View file

@ -1,20 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,28 +0,0 @@
/// <reference path='fourslash.ts' />
////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");

View file

@ -1,30 +0,0 @@
/// <reference path='fourslash.ts' />
/////**
//// * 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();

View file

@ -1,22 +0,0 @@
/// <reference path='fourslash.ts'/>
////class A<T> {
//// static B<S>(v: A<S>): A<S>;
//// static B<S>(v: S): A<S>;
//// static B<S>(v: any): A<S> {
//// return null;
//// }
////}
////var a = new A<number>();
////A.B(/**/
goTo.marker();
verify.signatureHelpCountIs(2);
edit.insert('a');
verify.signatureHelpCountIs(2);
verify.currentSignatureHelpIs('B(v: A<number>): A<number>')
edit.insert('); A.B(');
verify.currentSignatureHelpIs('B<S>(v: A<S>): A<S>');
edit.insert('a');
verify.currentSignatureHelpIs('B(v: A<number>): A<number>')

View file

@ -1,3 +0,0 @@
//// // [|TODO|]
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|todo 1|]
//// [|hack 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO", "HACK"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|TODO(jason) 1|]
//// [|HACK 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|TODO(jason) 1|]
//// [|HACK 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["HACK", "TODO(jason)"]);

View file

@ -1,4 +0,0 @@
//// TODO
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,3 +0,0 @@
//// BAR // [|TODO|]
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,3 +0,0 @@
//// "// HACK 1";
debugger;
verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]);

View file

@ -1,3 +0,0 @@
//// //// [|HACK 1|]
debugger;
verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]);

View file

@ -1,3 +0,0 @@
//// /**** [|HACK 1 |]*/ a
debugger;
verify.todoCommentsInCurrentFile(["TODO(jason)", "HACK"]);

View file

@ -1,3 +0,0 @@
//// // not TODO
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,3 +0,0 @@
//// // [|TODO with stuff|]
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,3 +0,0 @@
//// // TODOnomatch
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|TODO 1|]
//// [|TODO 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,6 +0,0 @@
//// /*
//// * [|TODO 1|]
//// * [|TODO 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|TODO 1|]
//// [|HACK 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO", "HACK"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|HACK 1|]
//// [|TODO 2|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO", "HACK"]);

View file

@ -1,6 +0,0 @@
//// /*
//// [|TODO HACK|]
//// [|HACK TODO|]
//// */
debugger;
verify.todoCommentsInCurrentFile(["TODO", "HACK"]);