Merge branch 'master' into requireJson

This commit is contained in:
Sheetal Nandi
2018-04-13 15:26:16 -07:00
400 changed files with 11097 additions and 11468 deletions
+4
View File
@@ -18,3 +18,7 @@
path = tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
url = https://github.com/Microsoft/TypeScript-WeChat-Starter.git
ignore = all
[submodule "tests/cases/user/webpack/webpack"]
path = tests/cases/user/webpack/webpack
url = https://github.com/webpack/webpack.git
ignore = all
+5 -86
View File
@@ -87,93 +87,10 @@ var typingsInstallerSources = filesFromConfig(path.join(serverDirectory, "typing
var watchGuardSources = filesFromConfig(path.join(serverDirectory, "watchGuard/tsconfig.json"));
var serverSources = filesFromConfig(path.join(serverDirectory, "tsconfig.json"));
var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, "tsconfig.library.json"));
var harnessSources = filesFromConfig("./src/harness/tsconfig.json");
var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json');
var harnessCoreSources = [
"harness.ts",
"virtualFileSystem.ts",
"virtualFileSystemWithWatch.ts",
"sourceMapRecorder.ts",
"harnessLanguageService.ts",
"fourslash.ts",
"runnerbase.ts",
"compilerRunner.ts",
"typeWriter.ts",
"fourslashRunner.ts",
"projectsRunner.ts",
"loggedIO.ts",
"rwcRunner.ts",
"externalCompileRunner.ts",
"test262Runner.ts",
"./parallel/shared.ts",
"./parallel/host.ts",
"./parallel/worker.ts",
"runner.ts"
].map(function (f) {
return path.join(harnessDirectory, f);
});
var harnessSources = harnessCoreSources.concat([
"base64.ts",
"incrementalParser.ts",
"jsDocParsing.ts",
"services/colorization.ts",
"services/documentRegistry.ts",
"services/preProcessFile.ts",
"services/patternMatcher.ts",
"session.ts",
"versionCache.ts",
"convertToBase64.ts",
"transpile.ts",
"reuseProgramStructure.ts",
"textStorage.ts",
"moduleResolution.ts",
"tsconfigParsing.ts",
"asserts.ts",
"builder.ts",
"commandLineParsing.ts",
"configurationExtension.ts",
"convertCompilerOptionsFromJson.ts",
"convertTypeAcquisitionFromJson.ts",
"tsserverProjectSystem.ts",
"tscWatchMode.ts",
"compileOnSave.ts",
"typingsInstaller.ts",
"projectErrors.ts",
"matchFiles.ts",
"organizeImports.ts",
"initializeTSConfig.ts",
"extractConstants.ts",
"extractFunctions.ts",
"extractRanges.ts",
"extractTestHelpers.ts",
"printer.ts",
"textChanges.ts",
"telemetry.ts",
"transform.ts",
"customTransforms.ts",
"programMissingFiles.ts",
"programNoParseFalsyFileNames.ts",
"symbolWalker.ts",
"languageService.ts",
"publicApi.ts",
"hostNewLineSupport.ts",
].map(function (f) {
return path.join(unittestsDirectory, f);
})).concat([
"protocol.ts",
"utilities.ts",
"scriptVersionCache.ts",
"scriptInfo.ts",
"project.ts",
"typingsCache.ts",
"editorServices.ts",
"session.ts",
].map(function (f) {
return path.join(serverDirectory, f);
}));
var es2015LibrarySources = [
"es2015.core.d.ts",
"es2015.collection.d.ts",
@@ -451,6 +368,8 @@ task("lib", libraryTargets);
// Generate diagnostics
var processDiagnosticMessagesJs = path.join(scriptsDirectory, "processDiagnosticMessages.js");
var processDiagnosticMessagesTs = path.join(scriptsDirectory, "processDiagnosticMessages.ts");
var processDiagnosticMessagesSources = filesFromConfig("./scripts/processDiagnosticMessages.tsconfig.json");
var diagnosticMessagesJson = path.join(compilerDirectory, "diagnosticMessages.json");
var diagnosticInfoMapTs = path.join(compilerDirectory, "diagnosticInformationMap.generated.ts");
var generatedDiagnosticMessagesJSON = path.join(compilerDirectory, "diagnosticMessages.generated.json");
@@ -460,8 +379,8 @@ file(processDiagnosticMessagesTs);
// processDiagnosticMessages script
compileFile(processDiagnosticMessagesJs,
[processDiagnosticMessagesTs],
[processDiagnosticMessagesTs],
processDiagnosticMessagesSources,
processDiagnosticMessagesSources,
[],
/*useBuiltCompiler*/ false);
+369 -416
View File
File diff suppressed because it is too large Load Diff
+6 -8
View File
@@ -1,9 +1,7 @@
/// <reference path="../src/compiler/sys.ts" />
/// <reference path="../src/compiler/core.ts" />
interface DiagnosticDetails {
category: string;
code: number;
reportsUnnecessary?: {};
isEarly?: boolean;
}
@@ -56,17 +54,17 @@ function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, inputFil
let result =
"// <auto-generated />\r\n" +
"// generated from '" + inputFilePathRel + "' by '" + thisFilePathRel + "'\r\n" +
"/// <reference path=\"types.ts\" />\r\n" +
"/* @internal */\r\n" +
"namespace ts {\r\n" +
" function diag(code: number, category: DiagnosticCategory, key: string, message: string): DiagnosticMessage {\r\n" +
" return { code, category, key, message };\r\n" +
" function diag(code: number, category: DiagnosticCategory, key: string, message: string, reportsUnnecessary?: {}): DiagnosticMessage {\r\n" +
" return { code, category, key, message, reportsUnnecessary };\r\n" +
" }\r\n" +
" // tslint:disable-next-line variable-name\r\n" +
" export const Diagnostics = {\r\n";
messageTable.forEach(({ code, category }, name) => {
messageTable.forEach(({ code, category, reportsUnnecessary }, name) => {
const propName = convertPropertyName(name);
result += ` ${propName}: diag(${code}, DiagnosticCategory.${category}, "${createKey(propName, code)}", ${JSON.stringify(name)}),\r\n`;
const argReportsUnnecessary = reportsUnnecessary ? `, /*reportsUnnecessary*/ ${reportsUnnecessary}` : "";
result += ` ${propName}: diag(${code}, DiagnosticCategory.${category}, "${createKey(propName, code)}", ${JSON.stringify(name)}${argReportsUnnecessary}),\r\n`;
});
result += " };\r\n}";
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"removeComments": false,
"outFile": "processDiagnosticMessages.js",
"target": "es5",
"declaration": false,
"lib": [
"es6",
"scripthost"
]
},
"files": [
"../src/compiler/types.ts",
"../src/compiler/performance.ts",
"../src/compiler/core.ts",
"../src/compiler/sys.ts",
"processDiagnosticMessages.ts"
]
}
+2 -5
View File
@@ -28,13 +28,11 @@ function walk(ctx: Lint.WalkContext<void>): void {
function shouldIgnoreCalledExpression(expression: ts.Expression): boolean {
if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) {
const methodName = (expression as ts.PropertyAccessExpression).name.text;
if (methodName.indexOf("set") === 0) {
if (methodName.startsWith("set") || methodName.startsWith("assert")) {
return true;
}
switch (methodName) {
case "apply":
case "assert":
case "assertEqual":
case "call":
case "equal":
case "fail":
@@ -46,11 +44,10 @@ function walk(ctx: Lint.WalkContext<void>): void {
}
else if (expression.kind === ts.SyntaxKind.Identifier) {
const functionName = (expression as ts.Identifier).text;
if (functionName.indexOf("set") === 0) {
if (functionName.startsWith("set") || functionName.startsWith("assert")) {
return true;
}
switch (functionName) {
case "assert":
case "contains":
case "createAnonymousType":
case "createImportSpecifier":
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="utilities.ts"/>
/// <reference path="parser.ts"/>
/* @internal */
namespace ts {
export const enum ModuleInstanceState {
-2
View File
@@ -1,5 +1,3 @@
/// <reference path="builderState.ts" />
/*@internal*/
namespace ts {
/**
-1
View File
@@ -1,4 +1,3 @@
/// <reference path="program.ts" />
namespace ts {
export interface EmitOutput {
outputFiles: OutputFile[];
+102 -43
View File
@@ -1,7 +1,3 @@
/// <reference path="moduleNameResolver.ts"/>
/// <reference path="binder.ts"/>
/// <reference path="symbolWalker.ts" />
/* @internal */
namespace ts {
const ambientModuleSymbolRegex = /^".+"$/;
@@ -2216,7 +2212,22 @@ namespace ts {
// An external module with an 'export =' declaration resolves to the target of the 'export =' declaration,
// and an external module with no 'export =' declaration resolves to the module itself.
function resolveExternalModuleSymbol(moduleSymbol: Symbol, dontResolveAlias?: boolean): Symbol {
return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get(InternalSymbolName.ExportEquals), dontResolveAlias)) || moduleSymbol;
return moduleSymbol && getMergedSymbol(resolveSymbol(getCommonJsExportEquals(moduleSymbol), dontResolveAlias)) || moduleSymbol;
}
function getCommonJsExportEquals(moduleSymbol: Symbol): Symbol {
const exported = moduleSymbol.exports.get(InternalSymbolName.ExportEquals);
if (!exported || !exported.exports || moduleSymbol.exports.size === 1) {
return exported;
}
const merged = cloneSymbol(exported);
moduleSymbol.exports.forEach((s, name) => {
if (name === InternalSymbolName.ExportEquals) return;
if (!merged.exports.has(name)) {
merged.exports.set(name, s);
}
});
return merged;
}
// An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export ='
@@ -2740,7 +2751,7 @@ namespace ts {
}
function hasVisibleDeclarations(symbol: Symbol, shouldComputeAliasToMakeVisible: boolean): SymbolVisibilityResult {
let aliasesToMakeVisible: AnyImportSyntax[];
let aliasesToMakeVisible: LateVisibilityPaintedStatement[];
if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) {
return undefined;
}
@@ -2754,15 +2765,13 @@ namespace ts {
const anyImportSyntax = getAnyImportSyntax(declaration);
if (anyImportSyntax &&
!hasModifier(anyImportSyntax, ModifierFlags.Export) && // import clause without export
isDeclarationVisible(<Declaration>anyImportSyntax.parent)) {
// In function "buildTypeDisplay" where we decide whether to write type-alias or serialize types,
// we want to just check if type- alias is accessible or not but we don't care about emitting those alias at that time
// since we will do the emitting later in trackSymbol.
if (shouldComputeAliasToMakeVisible) {
getNodeLinks(declaration).isVisible = true;
aliasesToMakeVisible = appendIfUnique(aliasesToMakeVisible, anyImportSyntax);
}
return true;
isDeclarationVisible(anyImportSyntax.parent)) {
return addVisibleAlias(declaration, anyImportSyntax);
}
else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) &&
!hasModifier(declaration.parent.parent, ModifierFlags.Export) && // unexported variable statement
isDeclarationVisible(declaration.parent.parent.parent)) {
return addVisibleAlias(declaration, declaration.parent.parent);
}
// Declaration is not visible
@@ -2771,6 +2780,17 @@ namespace ts {
return true;
}
function addVisibleAlias(declaration: Declaration, aliasingStatement: LateVisibilityPaintedStatement) {
// In function "buildTypeDisplay" where we decide whether to write type-alias or serialize types,
// we want to just check if type- alias is accessible or not but we don't care about emitting those alias at that time
// since we will do the emitting later in trackSymbol.
if (shouldComputeAliasToMakeVisible) {
getNodeLinks(declaration).isVisible = true;
aliasesToMakeVisible = appendIfUnique(aliasesToMakeVisible, aliasingStatement);
}
return true;
}
}
function isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult {
@@ -3835,7 +3855,7 @@ namespace ts {
return symbolName(symbol);
}
function isDeclarationVisible(node: Declaration | AnyImportSyntax): boolean {
function isDeclarationVisible(node: Node): boolean {
if (node) {
const links = getNodeLinks(node);
if (links.isVisible === undefined) {
@@ -3849,7 +3869,7 @@ namespace ts {
function determineIfDeclarationIsVisible() {
switch (node.kind) {
case SyntaxKind.BindingElement:
return isDeclarationVisible(<Declaration>node.parent.parent);
return isDeclarationVisible(node.parent.parent);
case SyntaxKind.VariableDeclaration:
if (isBindingPattern((node as VariableDeclaration).name) &&
!((node as VariableDeclaration).name as BindingPattern).elements.length) {
@@ -3875,7 +3895,7 @@ namespace ts {
return isGlobalSourceFile(parent);
}
// Exported members/ambient module elements (exception import declaration) are visible if parent is visible
return isDeclarationVisible(<Declaration>parent);
return isDeclarationVisible(parent);
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.PropertySignature:
@@ -3905,7 +3925,7 @@ namespace ts {
case SyntaxKind.UnionType:
case SyntaxKind.IntersectionType:
case SyntaxKind.ParenthesizedType:
return isDeclarationVisible(<Declaration>node.parent);
return isDeclarationVisible(node.parent);
// Default binding, import specifier and namespace import is visible
// only on demand so by default it is not visible
@@ -4150,14 +4170,17 @@ namespace ts {
else {
// Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form)
const name = declaration.propertyName || <Identifier>declaration.name;
if (isComputedNonLiteralName(name)) {
// computed properties with non-literal names are treated as 'any'
const isLate = isLateBindableName(name);
const isWellKnown = isComputedPropertyName(name) && isWellKnownSymbolSyntactically(name.expression);
if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
return anyType;
}
// Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature,
// or otherwise the type of the string index signature.
const text = getTextOfPropertyName(name);
const text = isLate ? getLateBoundNameFromType(checkComputedPropertyName(name as ComputedPropertyName) as LiteralType | UniqueESSymbolType) :
isWellKnown ? getPropertyNameForKnownSymbolName(idText(((name as ComputedPropertyName).expression as PropertyAccessExpression).name)) :
getTextOfPropertyName(name);
// Relax null check on ambient destructuring parameters, since the parameters have no implementation and are just documentation
if (strictNullChecks && declaration.flags & NodeFlags.Ambient && isParameterDeclaration(declaration)) {
@@ -4343,14 +4366,15 @@ namespace ts {
for (const declaration of symbol.declarations) {
let declarationInConstructor = false;
const expression = declaration.kind === SyntaxKind.BinaryExpression ? <BinaryExpression>declaration :
declaration.kind === SyntaxKind.PropertyAccessExpression ? <BinaryExpression>getAncestor(declaration, SyntaxKind.BinaryExpression) :
declaration.kind === SyntaxKind.PropertyAccessExpression ? cast(declaration.parent, isBinaryExpression) :
undefined;
if (!expression) {
return unknownType;
}
if (isPropertyAccessExpression(expression.left) && expression.left.expression.kind === SyntaxKind.ThisKeyword) {
const special = getSpecialPropertyAssignmentKind(expression);
if (special === SpecialPropertyAssignmentKind.ThisProperty) {
const thisContainer = getThisContainer(expression, /*includeArrowFunctions*/ false);
// Properties defined in a constructor (or javascript constructor function) don't get undefined added.
// Function expressions that are assigned to the prototype count as methods.
@@ -4380,7 +4404,33 @@ namespace ts {
}
else if (!jsDocType) {
// If we don't have an explicit JSDoc type, get the type from the expression.
const type = getWidenedLiteralType(checkExpressionCached(expression.right));
let type = getWidenedLiteralType(checkExpressionCached(expression.right));
if (getObjectFlags(type) & ObjectFlags.Anonymous &&
special === SpecialPropertyAssignmentKind.ModuleExports &&
symbol.escapedName === InternalSymbolName.ExportEquals) {
const exportedType = resolveStructuredTypeMembers(type as AnonymousType);
const members = createSymbolTable();
copyEntries(exportedType.members, members);
symbol.exports.forEach((s, name) => {
if (members.has(name)) {
const exportedMember = exportedType.members.get(name);
const union = createSymbol(s.flags | exportedMember.flags, name);
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
members.set(name, union);
}
else {
members.set(name, s);
}
});
type = createAnonymousType(
exportedType.symbol,
members,
exportedType.callSignatures,
exportedType.constructSignatures,
exportedType.stringIndexInfo,
exportedType.numberIndexInfo);
}
let anyedType = type;
if (isEmptyArrayLiteralType(type)) {
anyedType = anyArrayType;
@@ -7163,15 +7213,15 @@ namespace ts {
return symbol.members.get(InternalSymbolName.Index);
}
function getIndexDeclarationOfSymbol(symbol: Symbol, kind: IndexKind): SignatureDeclaration {
function getIndexDeclarationOfSymbol(symbol: Symbol, kind: IndexKind): IndexSignatureDeclaration {
const syntaxKind = kind === IndexKind.Number ? SyntaxKind.NumberKeyword : SyntaxKind.StringKeyword;
const indexSymbol = getIndexSymbol(symbol);
if (indexSymbol) {
for (const decl of indexSymbol.declarations) {
const node = <SignatureDeclaration>decl;
const node = cast(decl, isIndexSignatureDeclaration);
if (node.parameters.length === 1) {
const parameter = node.parameters[0];
if (parameter && parameter.type && parameter.type.kind === syntaxKind) {
if (parameter.type && parameter.type.kind === syntaxKind) {
return node;
}
}
@@ -7181,7 +7231,7 @@ namespace ts {
return undefined;
}
function createIndexInfo(type: Type, isReadonly: boolean, declaration?: SignatureDeclaration): IndexInfo {
function createIndexInfo(type: Type, isReadonly: boolean, declaration?: IndexSignatureDeclaration): IndexInfo {
return { type, isReadonly, declaration };
}
@@ -13833,7 +13883,8 @@ namespace ts {
const assignmentKind = getAssignmentTargetKind(node);
if (assignmentKind) {
if (!(localOrExportSymbol.flags & SymbolFlags.Variable)) {
if (!(localOrExportSymbol.flags & SymbolFlags.Variable) &&
!(isInJavaScriptFile(node) && localOrExportSymbol.flags & SymbolFlags.ValueModule)) {
error(node, Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol));
return unknownType;
}
@@ -16621,12 +16672,18 @@ namespace ts {
}
}
}
const suggestion = getSuggestionForNonexistentProperty(propNode, containingType);
if (suggestion !== undefined) {
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestion);
const promisedType = getPromisedTypeOfPromise(containingType);
if (promisedType && getPropertyOfType(promisedType, propNode.escapedText)) {
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await, declarationNameToString(propNode), typeToString(containingType));
}
else {
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType));
const suggestion = getSuggestionForNonexistentProperty(propNode, containingType);
if (suggestion !== undefined) {
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestion);
}
else {
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType));
}
}
diagnostics.add(createDiagnosticForNodeFromMessageChain(propNode, errorInfo));
}
@@ -19038,6 +19095,9 @@ namespace ts {
const links = getNodeLinks(node);
const type = getTypeOfSymbol(node.symbol);
if (isTypeAny(type)) {
return type;
}
// Check if function expression is contextually typed and assign parameter types if so.
if (!(links.flags & NodeCheckFlags.ContextChecked)) {
@@ -19800,8 +19860,9 @@ namespace ts {
// VarExpr = ValueExpr
// requires VarExpr to be classified as a reference
// A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1)
// and the type of the non - compound operation to be assignable to the type of VarExpr.
if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)) {
// and the type of the non-compound operation to be assignable to the type of VarExpr.
if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access)
&& (!isIdentifier(left) || unescapeLeadingUnderscores(left.escapedText) !== "exports")) {
// to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported
checkTypeAssignableTo(valueType, leftType, left, /*headMessage*/ undefined);
}
@@ -21819,6 +21880,10 @@ namespace ts {
// and give a better error message when the host function mentions `arguments`
// but the tag doesn't have an array type
if (decl) {
const i = getJSDocTags(decl).filter(isJSDocParameterTag).indexOf(node);
if (i > -1 && i < decl.parameters.length && isBindingPattern(decl.parameters[i].name)) {
return;
}
if (!containsArgumentsReference(decl)) {
error(node.name,
Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,
@@ -24573,7 +24638,7 @@ namespace ts {
const exportEqualsSymbol = moduleSymbol.exports.get("export=" as __String);
if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) {
const declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration;
if (!isTopLevelInExternalModuleAugmentation(declaration)) {
if (!isTopLevelInExternalModuleAugmentation(declaration) && !isInJavaScriptFile(declaration)) {
error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
}
}
@@ -24654,7 +24719,6 @@ namespace ts {
case SyntaxKind.ConstructorType:
case SyntaxKind.CallSignature:
case SyntaxKind.ConstructSignature:
return checkSignatureDeclaration(<SignatureDeclaration>node);
case SyntaxKind.IndexSignature:
return checkSignatureDeclaration(<SignatureDeclaration>node);
case SyntaxKind.MethodDeclaration:
@@ -24774,8 +24838,6 @@ namespace ts {
case SyntaxKind.ExportAssignment:
return checkExportAssignment(<ExportAssignment>node);
case SyntaxKind.EmptyStatement:
checkGrammarStatementInAmbientContext(node);
return;
case SyntaxKind.DebuggerStatement:
checkGrammarStatementInAmbientContext(node);
return;
@@ -25453,9 +25515,6 @@ namespace ts {
}
function getShorthandAssignmentValueSymbol(location: Node): Symbol {
// The function returns a value symbol of an identifier in the short-hand property assignment.
// This is necessary as an identifier in short-hand property assignment can contains two meaning:
// property name and property value.
if (location && location.kind === SyntaxKind.ShorthandPropertyAssignment) {
return resolveEntityName((<ShorthandPropertyAssignment>location).name, SymbolFlags.Value | SymbolFlags.Alias);
}
-6
View File
@@ -1,9 +1,3 @@
/// <reference path="sys.ts"/>
/// <reference path="types.ts"/>
/// <reference path="core.ts"/>
/// <reference path="diagnosticInformationMap.generated.ts"/>
/// <reference path="parser.ts"/>
namespace ts {
/* @internal */
export const compileOnSaveCommandLineOption: CommandLineOption = { name: "compileOnSave", type: "boolean" };
-2
View File
@@ -1,5 +1,3 @@
/// <reference path="sourcemap.ts" />
/* @internal */
namespace ts {
export interface CommentWriter {
+19 -17
View File
@@ -1,6 +1,3 @@
/// <reference path="types.ts"/>
/// <reference path="performance.ts" />
namespace ts {
// WARNING: The script `configureNightly.ts` uses a regexp to parse out these values.
// If changing the text in this section, be sure to test `configureNightly` too.
@@ -1268,10 +1265,7 @@ namespace ts {
});
}
export function assign<T1 extends MapLike<{}>, T2, T3>(t: T1, arg1: T2, arg2: T3): T1 & T2 & T3;
export function assign<T1 extends MapLike<{}>, T2>(t: T1, arg1: T2): T1 & T2;
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]): any;
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]) {
export function assign<T extends object>(t: T, ...args: T[]) {
for (const arg of args) {
for (const p in arg) {
if (hasProperty(arg, p)) {
@@ -1317,12 +1311,13 @@ namespace ts {
* the same key with the given 'makeKey' function, then the element with the higher
* index in the array will be the one associated with the produced key.
*/
export function arrayToMap<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string): Map<T>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string, makeValue: (value: T) => U): Map<U>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string, makeValue: (value: T) => T | U = identity): Map<T | U> {
export function arrayToMap<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined): Map<T>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined, makeValue: (value: T) => U): Map<U>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined, makeValue: (value: T) => T | U = identity): Map<T | U> {
const result = createMap<T | U>();
for (const value of array) {
result.set(makeKey(value), makeValue(value));
const key = makeKey(value);
if (key !== undefined) result.set(key, makeValue(value));
}
return result;
}
@@ -1343,8 +1338,9 @@ namespace ts {
* @param array the array of input elements.
*/
export function arrayToSet(array: ReadonlyArray<string>): Map<true>;
export function arrayToSet<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string): Map<true>;
export function arrayToSet(array: ReadonlyArray<any>, makeKey?: (value: any) => string): Map<true> {
export function arrayToSet<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined): Map<true>;
export function arrayToSet<T>(array: ReadonlyArray<T>, makeKey: (value: T) => __String | undefined): UnderscoreEscapedMap<true>;
export function arrayToSet(array: ReadonlyArray<any>, makeKey?: (value: any) => string | __String | undefined): Map<true> | UnderscoreEscapedMap<true> {
return arrayToMap<any, true>(array, makeKey || (s => s), () => true);
}
@@ -1606,7 +1602,7 @@ namespace ts {
messageText: text,
category: message.category,
code: message.code,
reportsUnnecessary: message.unused,
reportsUnnecessary: message.reportsUnnecessary,
};
}
@@ -1637,7 +1633,7 @@ namespace ts {
messageText: text,
category: message.category,
code: message.code,
reportsUnnecessary: message.unused,
reportsUnnecessary: message.reportsUnnecessary,
};
}
@@ -1727,6 +1723,10 @@ namespace ts {
return compareComparableValues(a, b);
}
export function min<T>(a: T, b: T, compare: Comparer<T>): T {
return compare(a, b) === Comparison.LessThan ? a : b;
}
/**
* Compare two strings using a case-insensitive ordinal comparison.
*
@@ -2246,6 +2246,8 @@ namespace ts {
* Adds a trailing directory separator to a path, if it does not already have one.
* @param path The path.
*/
export function ensureTrailingDirectorySeparator(path: Path): Path;
export function ensureTrailingDirectorySeparator(path: string): string;
export function ensureTrailingDirectorySeparator(path: string) {
if (path.charAt(path.length - 1) !== directorySeparator) {
return path + directorySeparator;
@@ -3124,8 +3126,8 @@ namespace ts {
return (arg: T) => f(arg) && g(arg);
}
export function or<T>(f: (arg: T) => boolean, g: (arg: T) => boolean) {
return (arg: T) => f(arg) || g(arg);
export function or<T>(f: (arg: T) => boolean, g: (arg: T) => boolean): (arg: T) => boolean {
return arg => f(arg) || g(arg);
}
export function assertTypeIsNever(_: never): void { } // tslint:disable-line no-empty
+12 -5
View File
@@ -2012,7 +2012,10 @@
"category": "Error",
"code": 2569
},
"Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?": {
"category": "Error",
"code": 2570
},
"JSX element attributes type '{0}' may not be a union type.": {
"category": "Error",
"code": 2600
@@ -3287,7 +3290,7 @@
"'{0}' is declared but its value is never read.": {
"category": "Error",
"code": 6133,
"unused": true
"reportsUnnecessary": true
},
"Report errors on unused locals.": {
"category": "Message",
@@ -3308,7 +3311,7 @@
"Property '{0}' is declared but its value is never read.": {
"category": "Error",
"code": 6138,
"unused": true
"reportsUnnecessary": true
},
"Import emit helpers from 'tslib'.": {
"category": "Message",
@@ -3521,7 +3524,7 @@
"All imports in import declaration are unused.": {
"category": "Error",
"code": 6192,
"unused": true
"reportsUnnecessary": true
},
"Found 1 error.": {
"category": "Message",
@@ -3615,7 +3618,7 @@
"Unused label.": {
"category": "Error",
"code": 7028,
"unused": true
"reportsUnnecessary": true
},
"Fallthrough case in switch.": {
"category": "Error",
@@ -4167,5 +4170,9 @@
"Convert all constructor functions to classes": {
"category": "Message",
"code": 95045
},
"Generate 'get' and 'set' accessors": {
"category": "Message",
"code": 95046
}
}
-5
View File
@@ -1,8 +1,3 @@
/// <reference path="checker.ts" />
/// <reference path="transformer.ts" />
/// <reference path="sourcemap.ts" />
/// <reference path="comments.ts" />
namespace ts {
const brackets = createBracketsMap();
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="core.ts"/>
/// <reference path="utilities.ts"/>
namespace ts {
function createSynthesizedNode(kind: SyntaxKind): Node {
const node = createNode(kind, -1, -1);
+5 -7
View File
@@ -1,6 +1,3 @@
/// <reference path="core.ts" />
/// <reference path="diagnosticInformationMap.generated.ts" />
namespace ts {
/* @internal */
export function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void;
@@ -118,7 +115,8 @@ namespace ts {
}
}
function readJson(path: string, host: ModuleResolutionHost): PackageJson {
/* @internal */
export function readJson(path: string, host: { readFile(fileName: string): string | undefined }): object {
try {
const jsonText = host.readFile(path);
return jsonText ? JSON.parse(jsonText) : {};
@@ -301,7 +299,7 @@ namespace ts {
// `types-publisher` sometimes creates packages with `"typings": null` for packages that don't provide their own types.
// See `createNotNeededPackageJSON` in the types-publisher` repo.
// tslint:disable-next-line:no-null-keyword
const isNotNeededPackage = host.fileExists(packageJsonPath) && readJson(packageJsonPath, host).typings === null;
const isNotNeededPackage = host.fileExists(packageJsonPath) && (readJson(packageJsonPath, host) as PackageJson).typings === null;
if (!isNotNeededPackage) {
// Return just the type directive names
result.push(getBaseFileName(normalized));
@@ -995,7 +993,7 @@ namespace ts {
const directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host);
const packageJsonPath = pathToPackageJson(nodeModuleDirectory);
if (directoryExists && host.fileExists(packageJsonPath)) {
const packageJsonContent = readJson(packageJsonPath, host);
const packageJsonContent = readJson(packageJsonPath, host) as PackageJson;
if (subModuleName === "") { // looking up the root - need to handle types/typings/main redirects for subModuleName
const path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state);
if (typeof path === "string") {
@@ -1046,7 +1044,7 @@ namespace ts {
const onlyRecordFailures = !directoryProbablyExists(getDirectoryPath(file), state.host);
const fromFile = tryFile(file, failedLookupLocations, onlyRecordFailures, state);
if (fromFile) {
const resolved = fromFile && resolvedIfExtensionMatches(extensions, fromFile);
const resolved = resolvedIfExtensionMatches(extensions, fromFile);
if (resolved) {
return resolved;
}
+15 -13
View File
@@ -1,6 +1,3 @@
/// <reference path="utilities.ts"/>
/// <reference path="scanner.ts"/>
namespace ts {
const enum SignatureFlags {
None = 0,
@@ -6402,8 +6399,8 @@ namespace ts {
case "arg":
case "argument":
case "param":
tag = parseParameterOrPropertyTag(atToken, tagName, PropertyLikeParse.Parameter);
break;
addTag(parseParameterOrPropertyTag(atToken, tagName, PropertyLikeParse.Parameter, indent));
return;
case "return":
case "returns":
tag = parseReturnTag(atToken, tagName);
@@ -6552,7 +6549,7 @@ namespace ts {
}
}
function parseParameterOrPropertyTag(atToken: AtToken, tagName: Identifier, target: PropertyLikeParse): JSDocParameterTag | JSDocPropertyTag {
function parseParameterOrPropertyTag(atToken: AtToken, tagName: Identifier, target: PropertyLikeParse, indent: number | undefined): JSDocParameterTag | JSDocPropertyTag {
let typeExpression = tryParseTypeExpression();
let isNameFirst = !typeExpression;
skipWhitespace();
@@ -6567,6 +6564,8 @@ namespace ts {
const result = target === PropertyLikeParse.Parameter ?
<JSDocParameterTag>createNode(SyntaxKind.JSDocParameterTag, atToken.pos) :
<JSDocPropertyTag>createNode(SyntaxKind.JSDocPropertyTag, atToken.pos);
let comment: string | undefined;
if (indent !== undefined) comment = parseTagComments(indent + scanner.getStartPos() - atToken.pos);
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target);
if (nestedTypeLiteral) {
typeExpression = nestedTypeLiteral;
@@ -6578,6 +6577,7 @@ namespace ts {
result.name = name;
result.isNameFirst = isNameFirst;
result.isBracketed = isBracketed;
result.comment = comment;
return finishNode(result);
}
@@ -6824,7 +6824,7 @@ namespace ts {
if (target !== t) {
return false;
}
const tag = parseParameterOrPropertyTag(atToken, tagName, target);
const tag = parseParameterOrPropertyTag(atToken, tagName, target, /*indent*/ undefined);
tag.comment = parseTagComments(tag.end - tag.pos);
return tag;
}
@@ -7641,7 +7641,7 @@ namespace ts {
const tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im;
const singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;
function extractPragmas(pragmas: PragmaPsuedoMapEntry[], range: CommentRange, text: string) {
const tripleSlash = tripleSlashXMLCommentStartRegEx.exec(text);
const tripleSlash = range.kind === SyntaxKind.SingleLineCommentTrivia && tripleSlashXMLCommentStartRegEx.exec(text);
if (tripleSlash) {
const name = tripleSlash[1].toLowerCase() as keyof PragmaPsuedoMap; // Technically unsafe cast, but we do it so the below check to make it safe typechecks
const pragma = commentPragmas[name] as PragmaDefinition;
@@ -7678,15 +7678,17 @@ namespace ts {
return;
}
const singleLine = singleLinePragmaRegEx.exec(text);
const singleLine = range.kind === SyntaxKind.SingleLineCommentTrivia && singleLinePragmaRegEx.exec(text);
if (singleLine) {
return addPragmaForMatch(pragmas, range, PragmaKindFlags.SingleLine, singleLine);
}
const multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating)
let multiLineMatch: RegExpExecArray;
while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {
addPragmaForMatch(pragmas, range, PragmaKindFlags.MultiLine, multiLineMatch);
if (range.kind === SyntaxKind.MultiLineCommentTrivia) {
const multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating)
let multiLineMatch: RegExpExecArray;
while (multiLineMatch = multiLinePragmaRegEx.exec(text)) {
addPragmaForMatch(pragmas, range, PragmaKindFlags.MultiLine, multiLineMatch);
}
}
}
-5
View File
@@ -1,7 +1,3 @@
/// <reference path="sys.ts" />
/// <reference path="emitter.ts" />
/// <reference path="core.ts" />
namespace ts {
const ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/;
@@ -577,7 +573,6 @@ namespace ts {
const packageIdToSourceFile = createMap<SourceFile>();
// Maps from a SourceFile's `.path` to the name of the package it was imported with.
let sourceFileToPackageName = createMap<string>();
// See `sourceFileIsRedirectedTo`.
let redirectTargetsSet = createMap<true>();
const filesByName = createMap<SourceFile | undefined>();
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="types.ts"/>
/// <reference path="core.ts"/>
/// <reference path="watchUtilities.ts"/>
/*@internal*/
namespace ts {
/** This is the cache of module/typedirectives resolution that can be retained across program */
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="core.ts"/>
/// <reference path="diagnosticInformationMap.generated.ts"/>
namespace ts {
export type ErrorCallback = (message: DiagnosticMessage, length: number) => void;
-2
View File
@@ -1,5 +1,3 @@
/// <reference path="checker.ts"/>
/* @internal */
namespace ts {
export interface SourceMapWriter {
-2
View File
@@ -1,5 +1,3 @@
/// <reference path="core.ts"/>
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
declare function clearTimeout(handle: any): void;
-15
View File
@@ -1,18 +1,3 @@
/// <reference path="visitor.ts" />
/// <reference path="transformers/utilities.ts" />
/// <reference path="transformers/ts.ts" />
/// <reference path="transformers/jsx.ts" />
/// <reference path="transformers/esnext.ts" />
/// <reference path="transformers/es2017.ts" />
/// <reference path="transformers/es2016.ts" />
/// <reference path="transformers/es2015.ts" />
/// <reference path="transformers/generators.ts" />
/// <reference path="transformers/es5.ts" />
/// <reference path="transformers/module/module.ts" />
/// <reference path="transformers/module/system.ts" />
/// <reference path="transformers/module/es2015.ts" />
/// <reference path="transformers/declarations.ts" />
/* @internal */
namespace ts {
function getModuleTransformer(moduleKind: ModuleKind): TransformerFactory<SourceFile> {
+85 -57
View File
@@ -1,7 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/// <reference path="./declarations/diagnostics.ts" />
/*@internal*/
namespace ts {
export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): Diagnostic[] {
@@ -27,10 +23,12 @@ namespace ts {
let needsDeclare = true;
let isBundledEmit = false;
let resultHasExternalModuleIndicator = false;
let needsScopeFixMarker = false;
let resultHasScopeMarker = false;
let enclosingDeclaration: Node;
let necessaryTypeRefernces: Map<true>;
let possibleImports: AnyImportSyntax[];
let importDeclarationMap: Map<AnyImportSyntax | undefined>;
let lateMarkedStatements: LateVisibilityPaintedStatement[];
let lateStatementReplacementMap: Map<LateVisibilityPaintedStatement | undefined>;
let suppressNewDiagnosticContexts: boolean;
const symbolTracker: SymbolTracker = {
@@ -63,12 +61,12 @@ namespace ts {
if (symbolAccessibilityResult.accessibility === SymbolAccessibility.Accessible) {
// Add aliases back onto the possible imports list if they're not there so we can try them again with updated visibility info
if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) {
if (!possibleImports) {
possibleImports = symbolAccessibilityResult.aliasesToMakeVisible;
if (!lateMarkedStatements) {
lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible;
}
else {
for (const ref of symbolAccessibilityResult.aliasesToMakeVisible) {
pushIfUnique(possibleImports, ref);
pushIfUnique(lateMarkedStatements, ref);
}
}
}
@@ -142,10 +140,12 @@ namespace ts {
hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib;
currentSourceFile = sourceFile;
enclosingDeclaration = sourceFile;
possibleImports = undefined;
lateMarkedStatements = undefined;
suppressNewDiagnosticContexts = false;
importDeclarationMap = createMap();
lateStatementReplacementMap = createMap();
getSymbolAccessibilityDiagnostic = throwDiagnostic;
needsScopeFixMarker = false;
resultHasScopeMarker = false;
collectReferences(sourceFile, refs);
if (isExternalModule(sourceFile)) {
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
@@ -161,7 +161,7 @@ namespace ts {
}
needsDeclare = true;
const updated = visitNodes(sourceFile.statements, visitDeclarationStatements);
return updateSourceFileNode(sourceFile, updated, /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false);
return updateSourceFileNode(sourceFile, filterCandidateImports(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false);
}
));
bundle.syntheticFileReferences = [];
@@ -175,14 +175,16 @@ namespace ts {
// Single source file
needsDeclare = true;
needsScopeFixMarker = false;
resultHasScopeMarker = false;
enclosingDeclaration = node;
currentSourceFile = node;
getSymbolAccessibilityDiagnostic = throwDiagnostic;
isBundledEmit = false;
resultHasExternalModuleIndicator = false;
suppressNewDiagnosticContexts = false;
possibleImports = undefined;
importDeclarationMap = createMap();
lateMarkedStatements = undefined;
lateStatementReplacementMap = createMap();
necessaryTypeRefernces = undefined;
const refs = collectReferences(currentSourceFile, createMap());
const references: FileReference[] = [];
@@ -192,7 +194,7 @@ namespace ts {
const statements = visitNodes(node.statements, visitDeclarationStatements);
let combinedStatements = setTextRange(createNodeArray(filterCandidateImports(statements)), node.statements);
const emittedImports = filter(combinedStatements, isAnyImportSyntax);
if (isExternalModule(node) && !resultHasExternalModuleIndicator) {
if (isExternalModule(node) && (!resultHasExternalModuleIndicator || (needsScopeFixMarker && !resultHasScopeMarker))) {
combinedStatements = setTextRange(createNodeArray([...combinedStatements, createExportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createNamedExports([]), /*moduleSpecifier*/ undefined)]), combinedStatements);
}
const updated = updateSourceFileNode(node, combinedStatements, /*isDeclarationFile*/ true, references, getFileReferencesForUsedTypeReferences(), node.hasNoDefaultLib);
@@ -532,7 +534,7 @@ namespace ts {
// Nothing visible
}
function filterCandidateImports(statements: ReadonlyArray<Statement>): ReadonlyArray<Statement> {
function filterCandidateImports(statements: NodeArray<Statement>): NodeArray<Statement> {
// This is a `while` loop because `handleSymbolAccessibilityError` can see additional import aliases marked as visible during
// error handling which must now be included in the output and themselves checked for errors.
// For example:
@@ -547,45 +549,63 @@ namespace ts {
// In such a scenario, only Q and D are initially visible, but we don't consider imports as private names - instead we say they if they are referenced they must
// be recorded. So while checking D's visibility we mark C as visible, then we must check C which in turn marks B, completing the chain of
// dependent imports and allowing a valid declaration file output. Today, this dependent alias marking only happens for internal import aliases.
const unconsideredImports: AnyImportSyntax[] = [];
while (length(possibleImports)) {
const i = possibleImports.shift();
const unconsideredStatements: LateVisibilityPaintedStatement[] = [];
while (length(lateMarkedStatements)) {
const i = lateMarkedStatements.shift();
if ((isSourceFile(i.parent) ? i.parent : i.parent.parent) !== enclosingDeclaration) { // Filter to only declarations in the current scope
unconsideredImports.push(i);
unconsideredStatements.push(i);
continue;
}
// Eagerly transform import equals - if they're not visible, we'll get nothing, if they are, we'll immediately add them since it's complete
if (i.kind === SyntaxKind.ImportEqualsDeclaration) {
const result = transformImportEqualsDeclaration(i);
importDeclarationMap.set("" + getNodeId(i), result);
continue;
if (!isLateVisibilityPaintedStatement(i)) {
return Debug.fail(`Late replaced statement was foudn which is not handled by the declaration transformer!: ${(ts as any).SyntaxKind ? (ts as any).SyntaxKind[(i as any).kind] : (i as any).kind}`);
}
switch (i.kind) {
case SyntaxKind.ImportEqualsDeclaration: {
const result = transformImportEqualsDeclaration(i);
lateStatementReplacementMap.set("" + getNodeId(i), result);
break;
}
case SyntaxKind.ImportDeclaration: {
const result = transformImportDeclaration(i);
lateStatementReplacementMap.set("" + getNodeId(i), result);
break;
}
case SyntaxKind.VariableStatement: {
const result = transformVariableStatement(i, /*privateDeclaration*/ true); // Transform the statement (potentially again, possibly revealing more sub-nodes)
lateStatementReplacementMap.set("" + getNodeId(i), result);
break;
}
default: Debug.assertNever(i, "Unhandled late painted statement!");
}
// Import declarations, on the other hand, can be partially painted by multiple aliases; so we can see many indeterminate states
// until we've marked all possible visibility
const result = transformImportDeclaration(i);
importDeclarationMap.set("" + getNodeId(i), result);
}
// Filtering available imports is the last thing done within a scope, so the possible set becomes those which could not
// be considered in the child scope
possibleImports = unconsideredImports;
lateMarkedStatements = unconsideredStatements;
// And lastly, we need to get the final form of all those indetermine import declarations from before and add them to the output list
// (and remove them from the set to examine for outter declarations)
return mapDefined(statements, statement => {
if (isImportDeclaration(statement) || isImportEqualsDeclaration(statement)) {
const key = "" + getNodeId(statement);
if (importDeclarationMap.has(key)) {
const result = importDeclarationMap.get(key);
importDeclarationMap.delete(key);
return result;
}
else {
return undefined;
return visitNodes(statements, visitLateVisibilityMarkedStatements);
}
function visitLateVisibilityMarkedStatements(statement: Statement) {
if (isLateVisibilityPaintedStatement(statement)) {
const key = "" + getNodeId(statement);
if (lateStatementReplacementMap.has(key)) {
const result = lateStatementReplacementMap.get(key);
lateStatementReplacementMap.delete(key);
if (result && isSourceFile(statement.parent) && !isAnyImportOrReExport(result) && !isExportAssignment(result) && !hasModifier(result, ModifierFlags.Export)) {
// Top-level declarations in .d.ts files are always considered exported even without a modifier unless there's an export assignment or specifier
needsScopeFixMarker = true;
}
return result;
}
else {
return statement;
return getParseTreeNode(statement) ? undefined : statement;
}
});
}
else {
return statement;
}
}
function visitDeclarationSubtree(input: Node): VisitResult<Node> {
@@ -816,6 +836,7 @@ namespace ts {
case SyntaxKind.ExportDeclaration: {
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
}
// Always visible if the parent node isn't dropped for being not visible
// Rewrite external module names if necessary
@@ -825,6 +846,7 @@ namespace ts {
// Always visible if the parent node isn't dropped for being not visible
if (isSourceFile(input.parent)) {
resultHasExternalModuleIndicator = true;
resultHasScopeMarker = true;
}
if (input.expression.kind === SyntaxKind.Identifier) {
return input;
@@ -844,8 +866,8 @@ namespace ts {
case SyntaxKind.ImportDeclaration: {
// Different parts of the import may be marked visible at different times (via visibility checking), so we defer our first look until later
// to reduce the likelihood we need to rewrite it
possibleImports = possibleImports || [];
pushIfUnique(possibleImports, input);
lateMarkedStatements = lateMarkedStatements || [];
pushIfUnique(lateMarkedStatements, input);
return input;
}
}
@@ -866,7 +888,7 @@ namespace ts {
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input as DeclarationDiagnosticProducing);
}
let oldPossibleImports: typeof possibleImports;
let oldPossibleImports: typeof lateMarkedStatements;
switch (input.kind) {
case SyntaxKind.TypeAliasDeclaration: // Type aliases get `declare`d if need be (for legacy support), but that's all
@@ -906,8 +928,8 @@ namespace ts {
case SyntaxKind.ModuleDeclaration: {
previousNeedsDeclare = needsDeclare;
needsDeclare = false;
oldPossibleImports = possibleImports;
possibleImports = undefined;
oldPossibleImports = lateMarkedStatements;
lateMarkedStatements = undefined;
const inner = input.body;
if (inner && inner.kind === SyntaxKind.ModuleBlock) {
const statements = visitNodes(inner.statements, visitDeclarationStatements);
@@ -1029,10 +1051,9 @@ namespace ts {
}
}
case SyntaxKind.VariableStatement: {
if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return;
const nodes = visitNodes(input.declarationList.declarations, visitDeclarationSubtree);
if (!length(nodes)) return;
return cleanup(updateVariableStatement(input, createNodeArray(ensureModifiers(input)), updateVariableDeclarationList(input.declarationList, nodes)));
const result = transformVariableStatement(input);
lateStatementReplacementMap.set("" + getNodeId(input), result); // Don't actually elide yet; just leave as original node - will be elided/swapped by late pass
return cleanup(input);
}
case SyntaxKind.EnumDeclaration: {
return cleanup(updateEnumDeclaration(input, /*decorators*/ undefined, createNodeArray(ensureModifiers(input)), input.name, createNodeArray(mapDefined(input.members, m => {
@@ -1053,12 +1074,12 @@ namespace ts {
}
if (input.kind === SyntaxKind.ModuleDeclaration) {
needsDeclare = previousNeedsDeclare;
possibleImports = concatenate(oldPossibleImports, possibleImports);
lateMarkedStatements = concatenate(oldPossibleImports, lateMarkedStatements);
}
if (canProdiceDiagnostic) {
getSymbolAccessibilityDiagnostic = oldDiag;
}
if (returnValue) {
if (returnValue && (!isLateVisibilityPaintedStatement(input) || lateStatementReplacementMap.get("" + getNodeId(input)))) {
if (!resultHasExternalModuleIndicator && hasModifier(input, ModifierFlags.Export) && isSourceFile(input.parent)) {
// Exported top-level member indicates moduleness
resultHasExternalModuleIndicator = true;
@@ -1071,6 +1092,13 @@ namespace ts {
}
}
function transformVariableStatement(input: VariableStatement, privateDeclaration?: boolean) {
if (!forEach(input.declarationList.declarations, getBindingNameVisible)) return;
const nodes = visitNodes(input.declarationList.declarations, visitDeclarationSubtree);
if (!length(nodes)) return;
return updateVariableStatement(input, createNodeArray(ensureModifiers(input, privateDeclaration)), updateVariableDeclarationList(input.declarationList, nodes));
}
function recreateBindingPattern(d: BindingPattern): VariableDeclaration[] {
return flatten<VariableDeclaration>(mapDefined(d.elements, e => recreateBindingElement(e)));
}
@@ -1122,21 +1150,21 @@ namespace ts {
return false;
}
function ensureModifiers(node: Node): ReadonlyArray<Modifier> {
function ensureModifiers(node: Node, privateDeclaration?: boolean): ReadonlyArray<Modifier> {
const currentFlags = getModifierFlags(node);
const newFlags = ensureModifierFlags(node);
const newFlags = ensureModifierFlags(node, privateDeclaration);
if (currentFlags === newFlags) {
return node.modifiers;
}
return createModifiersFromModifierFlags(newFlags);
}
function ensureModifierFlags(node: Node): ModifierFlags {
function ensureModifierFlags(node: Node, privateDeclaration?: boolean): ModifierFlags {
let mask = ModifierFlags.All ^ (ModifierFlags.Public | ModifierFlags.Async); // No async modifiers in declaration files
let additions = (needsDeclare && !isAlwaysType(node)) ? ModifierFlags.Ambient : ModifierFlags.None;
const parentIsFile = node.parent.kind === SyntaxKind.SourceFile;
if (!parentIsFile || (isBundledEmit && parentIsFile && isExternalModule(node.parent as SourceFile))) {
mask ^= ((isBundledEmit && parentIsFile ? 0 : ModifierFlags.Export) | ModifierFlags.Default | ModifierFlags.Ambient);
mask ^= ((privateDeclaration || (isBundledEmit && parentIsFile) ? 0 : ModifierFlags.Export) | ModifierFlags.Default | ModifierFlags.Ambient);
additions = ModifierFlags.None;
}
return maskModifierFlags(node, mask, additions);
@@ -1,6 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/*@internal*/
namespace ts {
interface FlattenContext {
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/// <reference path="./destructuring.ts" />
/*@internal*/
namespace ts {
const enum ES2015SubstitutionFlags {
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/*@internal*/
namespace ts {
export function transformES2016(context: TransformationContext) {
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/*@internal*/
namespace ts {
type SuperContainer = ClassDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration;
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/*@internal*/
namespace ts {
/**
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/// <reference path="es2017.ts" />
/*@internal*/
namespace ts {
const enum ESNextSubstitutionFlags {
-3
View File
@@ -1,6 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
// Transforms generator functions into a compatible ES5 representation with similar runtime
// semantics. This is accomplished by first transforming the body of each generator
// function into an intermediate representation that is the compiled into a JavaScript
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/// <reference path="./esnext.ts" />
/*@internal*/
namespace ts {
export function transformJsx(context: TransformationContext) {
@@ -1,6 +1,3 @@
/// <reference path="../../factory.ts" />
/// <reference path="../../visitor.ts" />
/*@internal*/
namespace ts {
export function transformES2015Module(context: TransformationContext) {
@@ -1,7 +1,3 @@
/// <reference path="../../factory.ts" />
/// <reference path="../../visitor.ts" />
/// <reference path="../destructuring.ts" />
/*@internal*/
namespace ts {
export function transformModule(context: TransformationContext) {
@@ -1,7 +1,3 @@
/// <reference path="../../factory.ts" />
/// <reference path="../../visitor.ts" />
/// <reference path="../destructuring.ts" />
/*@internal*/
namespace ts {
export function transformSystemModule(context: TransformationContext) {
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="../factory.ts" />
/// <reference path="../visitor.ts" />
/// <reference path="./destructuring.ts" />
/*@internal*/
namespace ts {
/**
+3 -7
View File
@@ -1,7 +1,3 @@
/// <reference path="program.ts"/>
/// <reference path="watch.ts"/>
/// <reference path="commandLineParser.ts"/>
namespace ts {
interface Statistic {
name: string;
@@ -22,7 +18,7 @@ namespace ts {
}
let reportDiagnostic = createDiagnosticReporter(sys);
function udpateReportDiagnostic(options: CompilerOptions) {
function updateReportDiagnostic(options: CompilerOptions) {
if (options.pretty) {
reportDiagnostic = createDiagnosticReporter(sys, /*pretty*/ true);
}
@@ -111,7 +107,7 @@ namespace ts {
const commandLineOptions = commandLine.options;
if (configFileName) {
const configParseResult = parseConfigFileWithSystem(configFileName, commandLineOptions, sys, reportDiagnostic);
udpateReportDiagnostic(configParseResult.options);
updateReportDiagnostic(configParseResult.options);
if (isWatchSet(configParseResult.options)) {
reportWatchModeWithoutSysSupport();
createWatchOfConfigFile(configParseResult, commandLineOptions);
@@ -121,7 +117,7 @@ namespace ts {
}
}
else {
udpateReportDiagnostic(commandLineOptions);
updateReportDiagnostic(commandLineOptions);
if (isWatchSet(commandLineOptions)) {
reportWatchModeWithoutSysSupport();
createWatchOfFilesAndCompilerOptions(commandLine.fileNames, commandLineOptions);
+11 -10
View File
@@ -6,36 +6,38 @@
"declaration": true
},
"files": [
"core.ts",
"performance.ts",
"sys.ts",
"types.ts",
"performance.ts",
"core.ts",
"sys.ts",
"diagnosticInformationMap.generated.ts",
"scanner.ts",
"parser.ts",
"utilities.ts",
"parser.ts",
"binder.ts",
"symbolWalker.ts",
"moduleNameResolver.ts",
"checker.ts",
"factory.ts",
"visitor.ts",
"transformers/utilities.ts",
"transformers/destructuring.ts",
"transformers/ts.ts",
"transformers/jsx.ts",
"transformers/esnext.ts",
"transformers/es2017.ts",
"transformers/esnext.ts",
"transformers/jsx.ts",
"transformers/es2016.ts",
"transformers/es2015.ts",
"transformers/es5.ts",
"transformers/generators.ts",
"transformers/destructuring.ts",
"transformers/module/module.ts",
"transformers/module/system.ts",
"transformers/module/es2015.ts",
"transformers/declarations/diagnostics.ts",
"transformers/declarations.ts",
"transformer.ts",
"comments.ts",
"sourcemap.ts",
"comments.ts",
"emitter.ts",
"watchUtilities.ts",
"program.ts",
@@ -44,7 +46,6 @@
"resolutionCache.ts",
"watch.ts",
"commandLineParser.ts",
"tsc.ts",
"diagnosticInformationMap.generated.ts"
"tsc.ts"
]
}
+11 -4
View File
@@ -2528,7 +2528,7 @@ namespace ts {
/**
* If two source files are for the same version of the same package, one will redirect to the other.
* (See `createRedirectSourceFile` in program.ts.)
* The redirect will have this set. The other will not have anything set, but see Program#sourceFileIsRedirectedTo.
* The redirect will have this set. The redirected-to source file will be in `redirectTargetsSet`.
*/
/* @internal */ redirectInfo?: RedirectInfo | undefined;
@@ -2853,6 +2853,10 @@ namespace ts {
getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[];
getSymbolAtLocation(node: Node): Symbol | undefined;
getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[];
/**
* The function returns the value (local variable) symbol of an identifier in the short-hand property assignment.
* This is necessary as an identifier in short-hand property assignment can contains two meaning: property name and property value.
*/
getShorthandAssignmentValueSymbol(location: Node): Symbol | undefined;
getExportSpecifierLocalTargetSymbol(location: ExportSpecifier): Symbol | undefined;
/**
@@ -3207,10 +3211,13 @@ namespace ts {
/* @internal */
export type RequireOrImportCall = CallExpression & { arguments: [StringLiteralLike] };
/* @internal */
export type LateVisibilityPaintedStatement = AnyImportSyntax | VariableStatement;
/* @internal */
export interface SymbolVisibilityResult {
accessibility: SymbolAccessibility;
aliasesToMakeVisible?: AnyImportSyntax[]; // aliases that need to have this symbol visible
aliasesToMakeVisible?: LateVisibilityPaintedStatement[]; // aliases that need to have this symbol visible
errorSymbolName?: string; // Optional symbol name that results in error
errorNode?: Node; // optional node that results in error
}
@@ -3982,7 +3989,7 @@ namespace ts {
export interface IndexInfo {
type: Type;
isReadonly: boolean;
declaration?: SignatureDeclaration;
declaration?: IndexSignatureDeclaration;
}
/* @internal */
@@ -4083,7 +4090,7 @@ namespace ts {
category: DiagnosticCategory;
code: number;
message: string;
unused?: {};
reportsUnnecessary?: {};
}
/**
+35 -7
View File
@@ -1,5 +1,3 @@
/// <reference path="sys.ts" />
/* @internal */
namespace ts {
export const resolvingEmptyArray: never[] = [] as never[];
@@ -546,6 +544,17 @@ namespace ts {
}
}
export function isLateVisibilityPaintedStatement(node: Node): node is LateVisibilityPaintedStatement {
switch (node.kind) {
case SyntaxKind.ImportDeclaration:
case SyntaxKind.ImportEqualsDeclaration:
case SyntaxKind.VariableStatement:
return true;
default:
return false;
}
}
export function isAnyImportOrReExport(node: Node): node is AnyImportOrReExport {
return isAnyImportSyntax(node) || isExportDeclaration(node);
}
@@ -4278,7 +4287,7 @@ namespace ts {
}
}
export function isParameterPropertyDeclaration(node: Node): boolean {
export function isParameterPropertyDeclaration(node: Node): node is ParameterDeclaration {
return hasModifier(node, ModifierFlags.ParameterPropertyModifier) && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent);
}
@@ -4637,11 +4646,21 @@ namespace ts {
* parameters by name and binding patterns do not have a name.
*/
export function getJSDocParameterTags(param: ParameterDeclaration): ReadonlyArray<JSDocParameterTag> {
if (param.name && isIdentifier(param.name)) {
const name = param.name.escapedText;
return getJSDocTags(param.parent).filter((tag): tag is JSDocParameterTag => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
if (param.name) {
if (isIdentifier(param.name)) {
const name = param.name.escapedText;
return getJSDocTags(param.parent).filter((tag): tag is JSDocParameterTag => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name);
}
else {
const i = param.parent.parameters.indexOf(param);
Debug.assert(i > -1, "Parameters should always be in their parents' parameter list");
const paramTags = getJSDocTags(param.parent).filter(isJSDocParameterTag);
if (i < paramTags.length) {
return [paramTags[i]];
}
}
}
// a binding pattern doesn't have a name, so it's not possible to match it a JSDoc parameter, which is identified by name
// return empty array for: out-of-order binding patterns and JSDoc function syntax, which has un-named parameters
return emptyArray;
}
@@ -5634,6 +5653,10 @@ namespace ts {
|| kind === SyntaxKind.MissingDeclaration;
}
export function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement {
return isTypeElement(node) || isClassElement(node);
}
export function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike {
const kind = node.kind;
return kind === SyntaxKind.PropertyAssignment
@@ -6316,4 +6339,9 @@ namespace ts {
export function isStringLiteralLike(node: Node): node is StringLiteralLike {
return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral;
}
/** @internal */
export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports {
return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports;
}
}
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="checker.ts" />
/// <reference path="factory.ts" />
/// <reference path="utilities.ts" />
namespace ts {
const isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="program.ts" />
/// <reference path="builder.ts" />
/// <reference path="resolutionCache.ts"/>
/*@internal*/
namespace ts {
const sysFormatDiagnosticsHost: FormatDiagnosticsHost = sys ? {
-2
View File
@@ -1,5 +1,3 @@
/// <reference path="core.ts" />
/* @internal */
namespace ts {
/**
+17 -1
View File
@@ -1081,8 +1081,20 @@ namespace FourSlash {
}
}
private verifyDocumentHighlightsRespectFilesList(files: ReadonlyArray<string>): void {
const startFile = this.activeFile.fileName;
for (const fileName of files) {
const searchFileNames = startFile === fileName ? [startFile] : [startFile, fileName];
const highlights = this.getDocumentHighlightsAtCurrentPosition(searchFileNames);
if (!highlights.every(dh => ts.contains(searchFileNames, dh.fileName))) {
this.raiseError(`When asking for document highlights only in files ${searchFileNames}, got document highlights in ${unique(highlights, dh => dh.fileName)}`);
}
}
}
public verifyReferencesOf(range: Range, references: Range[]) {
this.goToRangeStart(range);
this.verifyDocumentHighlightsRespectFilesList(unique(references, e => e.fileName));
this.verifyReferencesAre(references);
}
@@ -1094,7 +1106,7 @@ namespace FourSlash {
}
}
public verifyReferenceGroups(starts: string | string[] | Range | Range[], parts: FourSlashInterface.ReferenceGroup[]): void {
public verifyReferenceGroups(starts: string | string[] | Range | Range[], parts: FourSlashInterface.ReferenceGroup[] | undefined): void {
interface ReferenceGroupJson {
definition: string | { text: string, range: ts.TextSpan };
references: ts.ReferenceEntry[];
@@ -1128,6 +1140,10 @@ namespace FourSlash {
};
});
this.assertObjectsEqual(fullActual, fullExpected);
if (parts) {
this.verifyDocumentHighlightsRespectFilesList(unique(ts.flatMap(parts, p => p.ranges), r => r.fileName));
}
}
}
+95 -80
View File
@@ -13,132 +13,147 @@
]
},
"files": [
"../compiler/core.ts",
"../compiler/performance.ts",
"../compiler/sys.ts",
"../compiler/types.ts",
"../compiler/performance.ts",
"../compiler/core.ts",
"../compiler/sys.ts",
"../compiler/diagnosticInformationMap.generated.ts",
"../compiler/scanner.ts",
"../compiler/parser.ts",
"../compiler/utilities.ts",
"../compiler/parser.ts",
"../compiler/binder.ts",
"../compiler/symbolWalker.ts",
"../compiler/moduleNameResolver.ts",
"../compiler/checker.ts",
"../compiler/factory.ts",
"../compiler/visitor.ts",
"../compiler/transformers/utilities.ts",
"../compiler/transformers/destructuring.ts",
"../compiler/transformers/ts.ts",
"../compiler/transformers/jsx.ts",
"../compiler/transformers/esnext.ts",
"../compiler/transformers/es2017.ts",
"../compiler/transformers/esnext.ts",
"../compiler/transformers/jsx.ts",
"../compiler/transformers/es2016.ts",
"../compiler/transformers/es2015.ts",
"../compiler/transformers/es5.ts",
"../compiler/transformers/generators.ts",
"../compiler/transformers/es5.ts",
"../compiler/transformers/destructuring.ts",
"../compiler/transformers/module/module.ts",
"../compiler/transformers/module/system.ts",
"../compiler/transformers/module/es2015.ts",
"../compiler/transformers/declarations/diagnostics.ts",
"../compiler/transformers/declarations.ts",
"../compiler/transformer.ts",
"../compiler/comments.ts",
"../compiler/sourcemap.ts",
"../compiler/comments.ts",
"../compiler/emitter.ts",
"../compiler/watchUtilities.ts",
"../compiler/program.ts",
"../compiler/builderState.ts",
"../compiler/builder.ts",
"../compiler/resolutionCache.ts",
"../compiler/watch.ts",
"../compiler/commandLineParser.ts",
"../compiler/diagnosticInformationMap.generated.ts",
"../services/breakpoints.ts",
"../services/navigateTo.ts",
"../services/navigationBar.ts",
"../services/outliningElementsCollector.ts",
"../services/patternMatcher.ts",
"../services/types.ts",
"../services/utilities.ts",
"../services/classifier.ts",
"../services/pathCompletions.ts",
"../services/completions.ts",
"../services/services.ts",
"../services/shims.ts",
"../services/signatureHelp.ts",
"../services/utilities.ts",
"../services/documentHighlights.ts",
"../services/documentRegistry.ts",
"../services/importTracker.ts",
"../services/findAllReferences.ts",
"../services/goToDefinition.ts",
"../services/jsDoc.ts",
"../services/semver.ts",
"../services/jsTyping.ts",
"../services/formatting/formatting.ts",
"../services/navigateTo.ts",
"../services/navigationBar.ts",
"../services/organizeImports.ts",
"../services/outliningElementsCollector.ts",
"../services/patternMatcher.ts",
"../services/preProcess.ts",
"../services/rename.ts",
"../services/signatureHelp.ts",
"../services/suggestionDiagnostics.ts",
"../services/symbolDisplay.ts",
"../services/transpile.ts",
"../services/formatting/formattingContext.ts",
"../services/formatting/formattingScanner.ts",
"../services/formatting/rule.ts",
"../services/formatting/rules.ts",
"../services/formatting/rulesMap.ts",
"../services/formatting/formatting.ts",
"../services/formatting/smartIndenter.ts",
"../services/textChanges.ts",
"../services/codeFixProvider.ts",
"../services/codefixes/fixes.ts",
"../services/codefixes/helpers.ts",
"../services/refactorProvider.ts",
"../services/codefixes/addMissingInvocationForDecorator.ts",
"../services/codefixes/annotateWithTypeFromJSDoc.ts",
"../services/codefixes/convertFunctionToEs6Class.ts",
"../services/codefixes/convertToEs6Module.ts",
"../services/codefixes/correctQualifiedNameToIndexedAccessType.ts",
"../services/codefixes/fixClassIncorrectlyImplementsInterface.ts",
"../services/codefixes/importFixes.ts",
"../services/codefixes/fixSpelling.ts",
"../services/codefixes/fixAddMissingMember.ts",
"../services/codefixes/fixCannotFindModule.ts",
"../services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts",
"../services/codefixes/fixClassSuperMustPrecedeThisAccess.ts",
"../services/codefixes/fixConstructorForDerivedNeedSuperCall.ts",
"../services/codefixes/fixExtendsInterfaceBecomesImplements.ts",
"../services/codefixes/fixForgottenThisPropertyAccess.ts",
"../services/codefixes/fixUnusedIdentifier.ts",
"../services/codefixes/fixJSDocTypes.ts",
"../services/codefixes/fixAwaitInSyncFunction.ts",
"../services/codefixes/disableJsDiagnostics.ts",
"../services/codefixes/helpers.ts",
"../services/codefixes/inferFromUsage.ts",
"../services/codefixes/fixInvalidImportSyntax.ts",
"../services/codefixes/fixStrictClassInitialization.ts",
"../services/codefixes/useDefaultImport.ts",
"../services/codefixes/fixes.ts",
"../services/refactors/extractSymbol.ts",
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
"../services/refactors/refactors.ts",
"../services/sourcemaps.ts",
"../services/services.ts",
"../services/breakpoints.ts",
"../services/transform.ts",
"../services/shims.ts",
"../server/typingsInstaller/typingsInstaller.ts",
"../server/types.ts",
"../server/shared.ts",
"../server/utilities.ts",
"../server/protocol.ts",
"../server/scriptInfo.ts",
"../server/typingsCache.ts",
"../server/project.ts",
"../server/editorServices.ts",
"../server/session.ts",
"../server/scriptVersionCache.ts",
"harness.ts",
"sourceMapRecorder.ts",
"harnessLanguageService.ts",
"fourslash.ts",
"runnerbase.ts",
"compilerRunner.ts",
"typeWriter.ts",
"virtualFileSystem.ts",
"harness.ts",
"virtualFileSystemWithWatch.ts",
"harnessLanguageService.ts",
"fourslashRunner.ts",
"fourslash.ts",
"typeWriter.ts",
"compilerRunner.ts",
"projectsRunner.ts",
"loggedIO.ts",
"rwcRunner.ts",
"externalCompileRunner.ts",
"test262Runner.ts",
"./parallel/shared.ts",
"./parallel/host.ts",
"./parallel/worker.ts",
"runner.ts",
"virtualFileSystemWithWatch.ts",
"../server/protocol.ts",
"../server/session.ts",
"../server/client.ts",
"../server/editorServices.ts",
"./unittests/base64.ts",
"./unittests/incrementalParser.ts",
"./unittests/jsDocParsing.ts",
"./unittests/services/colorization.ts",
"./unittests/services/documentRegistry.ts",
"./unittests/services/preProcessFile.ts",
"./unittests/services/patternMatcher.ts",
"./unittests/session.ts",
"./unittests/symbolWalker.ts",
"./unittests/versionCache.ts",
"./unittests/convertToBase64.ts",
"./unittests/transpile.ts",
"./unittests/reuseProgramStructure.ts",
"./unittests/moduleResolution.ts",
"./unittests/tsconfigParsing.ts",
"./unittests/asserts.ts",
"./unittests/builder.ts",
"./unittests/commandLineParsing.ts",
"./unittests/configurationExtension.ts",
"./unittests/convertCompilerOptionsFromJson.ts",
"./unittests/convertTypeAcquisitionFromJson.ts",
"./unittests/tsserverProjectSystem.ts",
"./unittests/tscWatchMode.ts",
"./unittests/matchFiles.ts",
"./unittests/organizeImports.ts",
"./unittests/initializeTSConfig.ts",
"./unittests/compileOnSave.ts",
"./unittests/typingsInstaller.ts",
"./unittests/projectErrors.ts",
"./unittests/printer.ts",
"./unittests/transform.ts",
"./unittests/customTransforms.ts",
"./unittests/extractConstants.ts",
"./unittests/extractFunctions.ts",
"./unittests/extractRanges.ts",
"./unittests/extractTestHelpers.ts",
"./unittests/textChanges.ts",
"./unittests/telemetry.ts",
"./unittests/languageService.ts",
"./unittests/programMissingFiles.ts",
"./unittests/programNoParseFalsyFileNames.ts",
"./unittests/publicApi.ts",
"./unittests/hostNewLineSupport.ts"
]
"parallel/host.ts",
"parallel/worker.ts",
"parallel/shared.ts",
"runner.ts"
],
"include": ["unittests/**.ts"]
}
+6
View File
@@ -305,6 +305,12 @@ namespace ts {
* @param x hi
< > still part of the previous comment
*/`);
parsesCorrectly("Nested @param tags",
`/**
* @param {object} o Doc doc
* @param {string} o.f Doc for f
*/`);
});
});
describe("getFirstToken", () => {
+18
View File
@@ -247,6 +247,24 @@ import D from "lib";
},
libFile);
testOrganizeImports("Unused_false_positive_shorthand_assignment",
{
path: "/test.ts",
content: `
import { x } from "a";
const o = { x };
`
});
testOrganizeImports("Unused_false_positive_export_shorthand",
{
path: "/test.ts",
content: `
import { x } from "a";
export { x };
`
});
testOrganizeImports("MoveToTop",
{
path: "/test.ts",
+70 -212
View File
@@ -95,376 +95,245 @@ describe("PatternMatcher", () => {
describe("SingleWordPattern", () => {
it("PreferCaseSensitiveExact", () => {
const match = getFirstMatch("Foo", "Foo");
assert.equal(ts.PatternMatchKind.exact, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("Foo", "Foo", { kind: ts.PatternMatchKind.exact, isCaseSensitive: true });
});
it("PreferCaseSensitiveExactInsensitive", () => {
const match = getFirstMatch("foo", "Foo");
assert.equal(ts.PatternMatchKind.exact, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("foo", "Foo", { kind: ts.PatternMatchKind.exact, isCaseSensitive: false });
});
it("PreferCaseSensitivePrefix", () => {
const match = getFirstMatch("Foo", "Fo");
assert.equal(ts.PatternMatchKind.prefix, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("Foo", "Fo", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("PreferCaseSensitivePrefixCaseInsensitive", () => {
const match = getFirstMatch("Foo", "fo");
assert.equal(ts.PatternMatchKind.prefix, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("Foo", "fo", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("PreferCaseSensitiveCamelCaseMatchSimple", () => {
const match = getFirstMatch("FogBar", "FB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("FogBar", "FB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveCamelCaseMatchPartialPattern", () => {
const match = getFirstMatch("FogBar", "FoB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("FogBar", "FoB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveCamelCaseMatchToLongPattern1", () => {
const match = getFirstMatch("FogBar", "FBB");
assert.isTrue(match === undefined);
assertSegmentMatch("FogBar", "FBB", undefined);
});
it("PreferCaseSensitiveCamelCaseMatchToLongPattern2", () => {
const match = getFirstMatch("FogBar", "FoooB");
assert.isTrue(match === undefined);
assertSegmentMatch("FogBar", "FoooB", undefined);
});
it("CamelCaseMatchPartiallyUnmatched", () => {
const match = getFirstMatch("FogBarBaz", "FZ");
assert.isTrue(match === undefined);
assertSegmentMatch("FogBarBaz", "FZ", undefined);
});
it("CamelCaseMatchCompletelyUnmatched", () => {
const match = getFirstMatch("FogBarBaz", "ZZ");
assert.isTrue(match === undefined);
assertSegmentMatch("FogBarBaz", "ZZ", undefined);
});
it("TwoUppercaseCharacters", () => {
const match = getFirstMatch("SimpleUIElement", "SiUI");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("SimpleUIElement", "SiUI", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveLowercasePattern", () => {
const match = getFirstMatch("FogBar", "b");
assert.equal(ts.PatternMatchKind.substring, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("FogBar", "b", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("PreferCaseSensitiveLowercasePattern2", () => {
const match = getFirstMatch("FogBar", "fB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("FogBar", "fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("PreferCaseSensitiveTryUnderscoredName", () => {
const match = getFirstMatch("_fogBar", "_fB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("_fogBar", "_fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveTryUnderscoredName2", () => {
const match = getFirstMatch("_fogBar", "fB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("_fogBar", "fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveTryUnderscoredNameInsensitive", () => {
const match = getFirstMatch("_FogBar", "_fB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("_FogBar", "_fB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("PreferCaseSensitiveMiddleUnderscore", () => {
const match = getFirstMatch("Fog_Bar", "FB");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("Fog_Bar", "FB", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveMiddleUnderscore2", () => {
const match = getFirstMatch("Fog_Bar", "F_B");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(true, match.isCaseSensitive);
assertSegmentMatch("Fog_Bar", "F_B", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("PreferCaseSensitiveMiddleUnderscore3", () => {
const match = getFirstMatch("Fog_Bar", "F__B");
assert.isTrue(undefined === match);
assertSegmentMatch("Fog_Bar", "F__B", undefined);
});
it("PreferCaseSensitiveMiddleUnderscore4", () => {
const match = getFirstMatch("Fog_Bar", "f_B");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("Fog_Bar", "f_B", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("PreferCaseSensitiveMiddleUnderscore5", () => {
const match = getFirstMatch("Fog_Bar", "F_b");
assert.equal(ts.PatternMatchKind.camelCase, match.kind);
assert.equal(false, match.isCaseSensitive);
assertSegmentMatch("Fog_Bar", "F_b", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: false });
});
it("AllLowerPattern1", () => {
const match = getFirstMatch("FogBarChangedEventArgs", "changedeventargs");
assert.isTrue(undefined !== match);
assertSegmentMatch("FogBarChangedEventArgs", "changedeventargs", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("AllLowerPattern2", () => {
const match = getFirstMatch("FogBarChangedEventArgs", "changedeventarrrgh");
assert.isTrue(undefined === match);
assertSegmentMatch("FogBarChangedEventArgs", "changedeventarrrgh", undefined);
});
it("AllLowerPattern3", () => {
const match = getFirstMatch("ABCDEFGH", "bcd");
assert.isTrue(undefined !== match);
assertSegmentMatch("ABCDEFGH", "bcd", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("AllLowerPattern4", () => {
const match = getFirstMatch("AbcdefghijEfgHij", "efghij");
assert.isTrue(undefined === match);
assertSegmentMatch("AbcdefghijEfgHij", "efghij", undefined);
});
});
describe("MultiWordPattern", () => {
it("ExactWithLowercase", () => {
const matches = getAllMatches("AddMetadataReference", "addmetadatareference");
assertContainsKind(ts.PatternMatchKind.exact, matches);
assertSegmentMatch("AddMetadataReference", "addmetadatareference", { kind: ts.PatternMatchKind.exact, isCaseSensitive: false });
});
it("SingleLowercasedSearchWord1", () => {
const matches = getAllMatches("AddMetadataReference", "add");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertSegmentMatch("AddMetadataReference", "add", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("SingleLowercasedSearchWord2", () => {
const matches = getAllMatches("AddMetadataReference", "metadata");
assertContainsKind(ts.PatternMatchKind.substring, matches);
assertSegmentMatch("AddMetadataReference", "metadata", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
it("SingleUppercaseSearchWord1", () => {
const matches = getAllMatches("AddMetadataReference", "Add");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertSegmentMatch("AddMetadataReference", "Add", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("SingleUppercaseSearchWord2", () => {
const matches = getAllMatches("AddMetadataReference", "Metadata");
assertContainsKind(ts.PatternMatchKind.substring, matches);
assertSegmentMatch("AddMetadataReference", "Metadata", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("SingleUppercaseSearchLetter1", () => {
const matches = getAllMatches("AddMetadataReference", "A");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertSegmentMatch("AddMetadataReference", "A", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("SingleUppercaseSearchLetter2", () => {
const matches = getAllMatches("AddMetadataReference", "M");
assertContainsKind(ts.PatternMatchKind.substring, matches);
assertSegmentMatch("AddMetadataReference", "M", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("TwoLowercaseWords", () => {
const matches = getAllMatches("AddMetadataReference", "add metadata");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertContainsKind(ts.PatternMatchKind.substring, matches);
it("TwoLowercaseWords0", () => {
assertSegmentMatch("AddMetadataReference", "add metadata", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("TwoLowercaseWords", () => {
const matches = getAllMatches("AddMetadataReference", "A M");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertContainsKind(ts.PatternMatchKind.substring, matches);
it("TwoLowercaseWords1", () => {
assertSegmentMatch("AddMetadataReference", "A M", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("TwoLowercaseWords", () => {
const matches = getAllMatches("AddMetadataReference", "AM");
assertContainsKind(ts.PatternMatchKind.camelCase, matches);
it("TwoLowercaseWords2", () => {
assertSegmentMatch("AddMetadataReference", "AM", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("TwoLowercaseWords", () => {
const matches = getAllMatches("AddMetadataReference", "ref Metadata");
assertArrayEquals(ts.map(matches, m => m.kind), [ts.PatternMatchKind.substring, ts.PatternMatchKind.substring]);
it("TwoLowercaseWords3", () => {
assertSegmentMatch("AddMetadataReference", "ref Metadata", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("TwoLowercaseWords", () => {
const matches = getAllMatches("AddMetadataReference", "ref M");
assertArrayEquals(ts.map(matches, m => m.kind), [ts.PatternMatchKind.substring, ts.PatternMatchKind.substring]);
it("TwoLowercaseWords4", () => {
assertSegmentMatch("AddMetadataReference", "ref M", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("MixedCamelCase", () => {
const matches = getAllMatches("AddMetadataReference", "AMRe");
assertContainsKind(ts.PatternMatchKind.camelCase, matches);
assertSegmentMatch("AddMetadataReference", "AMRe", { kind: ts.PatternMatchKind.camelCase, isCaseSensitive: true });
});
it("BlankPattern", () => {
const matches = getAllMatches("AddMetadataReference", "");
assert.isTrue(matches === undefined);
assertInvalidPattern("");
});
it("WhitespaceOnlyPattern", () => {
const matches = getAllMatches("AddMetadataReference", " ");
assert.isTrue(matches === undefined);
assertInvalidPattern(" ");
});
it("EachWordSeparately1", () => {
const matches = getAllMatches("AddMetadataReference", "add Meta");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertContainsKind(ts.PatternMatchKind.substring, matches);
assertSegmentMatch("AddMetadataReference", "add Meta", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: false });
});
it("EachWordSeparately2", () => {
const matches = getAllMatches("AddMetadataReference", "Add meta");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertContainsKind(ts.PatternMatchKind.substring, matches);
assertSegmentMatch("AddMetadataReference", "Add meta", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("EachWordSeparately3", () => {
const matches = getAllMatches("AddMetadataReference", "Add Meta");
assertContainsKind(ts.PatternMatchKind.prefix, matches);
assertContainsKind(ts.PatternMatchKind.substring, matches);
assertSegmentMatch("AddMetadataReference", "Add Meta", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("MixedCasing", () => {
const matches = getAllMatches("AddMetadataReference", "mEta");
assert.isTrue(matches === undefined);
assertSegmentMatch("AddMetadataReference", "mEta", undefined);
});
it("MixedCasing2", () => {
const matches = getAllMatches("AddMetadataReference", "Data");
assert.isTrue(matches === undefined);
assertSegmentMatch("AddMetadataReference", "Data", undefined);
});
it("AsteriskSplit", () => {
const matches = getAllMatches("GetKeyWord", "K*W");
assertArrayEquals(ts.map(matches, m => m.kind), [ts.PatternMatchKind.substring, ts.PatternMatchKind.substring]);
assertSegmentMatch("GetKeyWord", "K*W", { kind: ts.PatternMatchKind.substring, isCaseSensitive: true });
});
it("LowercaseSubstring1", () => {
const matches = getAllMatches("Operator", "a");
assert.isTrue(matches === undefined);
assertSegmentMatch("Operator", "a", undefined);
});
it("LowercaseSubstring2", () => {
const matches = getAllMatches("FooAttribute", "a");
assertContainsKind(ts.PatternMatchKind.substring, matches);
assert.isFalse(matches[0].isCaseSensitive);
assertSegmentMatch("FooAttribute", "a", { kind: ts.PatternMatchKind.substring, isCaseSensitive: false });
});
});
describe("DottedPattern", () => {
it("DottedPattern1", () => {
const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "B.Q");
assert.equal(ts.PatternMatchKind.prefix, match.kind);
assert.equal(true, match.isCaseSensitive);
assertFullMatch("Foo.Bar.Baz", "Quux", "B.Q", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("DottedPattern2", () => {
const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "C.Q");
assert.isTrue(match === undefined);
assertFullMatch("Foo.Bar.Baz", "Quux", "C.Q", undefined);
});
it("DottedPattern3", () => {
const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "B.B.Q");
assert.equal(ts.PatternMatchKind.prefix, match.kind);
assert.equal(true, match.isCaseSensitive);
assertFullMatch("Foo.Bar.Baz", "Quux", "B.B.Q", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("DottedPattern4", () => {
const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "Baz.Quux");
assert.equal(ts.PatternMatchKind.exact, match.kind);
assert.equal(true, match.isCaseSensitive);
assertFullMatch("Foo.Bar.Baz", "Quux", "Baz.Quux", { kind: ts.PatternMatchKind.exact, isCaseSensitive: true });
});
it("DottedPattern5", () => {
const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "F.B.B.Quux");
assert.equal(ts.PatternMatchKind.exact, match.kind);
assert.equal(true, match.isCaseSensitive);
assertFullMatch("Foo.Bar.Baz", "Quux", "F.B.B.Quux", { kind: ts.PatternMatchKind.prefix, isCaseSensitive: true });
});
it("DottedPattern6", () => {
const match = getFirstMatchForDottedPattern("Foo.Bar.Baz", "Quux", "F.F.B.B.Quux");
assert.isTrue(match === undefined);
assertFullMatch("Foo.Bar.Baz", "Quux", "F.F.B.B.Quux", undefined);
});
it("DottedPattern7", () => {
let match = getFirstMatch("UIElement", "UIElement");
match = getFirstMatch("GetKeyword", "UIElement");
assert.isTrue(match === undefined);
assertSegmentMatch("UIElement", "UIElement", { kind: ts.PatternMatchKind.exact, isCaseSensitive: true });
assertSegmentMatch("GetKeyword", "UIElement", undefined);
});
});
function getFirstMatch(candidate: string, pattern: string): ts.PatternMatch {
const matches = ts.createPatternMatcher(pattern).getMatchesForLastSegmentOfPattern(candidate);
return matches ? matches[0] : undefined;
function assertSegmentMatch(candidate: string, pattern: string, expected: ts.PatternMatch | undefined): void {
assert.deepEqual(ts.createPatternMatcher(pattern).getMatchForLastSegmentOfPattern(candidate), expected);
}
function getAllMatches(candidate: string, pattern: string): ts.PatternMatch[] {
return ts.createPatternMatcher(pattern).getMatchesForLastSegmentOfPattern(candidate);
function assertInvalidPattern(pattern: string) {
assert.equal(ts.createPatternMatcher(pattern), undefined);
}
function getFirstMatchForDottedPattern(dottedContainer: string, candidate: string, pattern: string): ts.PatternMatch {
const matches = ts.createPatternMatcher(pattern).getMatches(dottedContainer.split("."), candidate);
return matches ? matches[0] : undefined;
function assertFullMatch(dottedContainer: string, candidate: string, pattern: string, expected: ts.PatternMatch | undefined): void {
assert.deepEqual(ts.createPatternMatcher(pattern).getFullMatch(dottedContainer.split("."), candidate), expected);
}
function spanListToSubstrings(identifier: string, spans: ts.TextSpan[]) {
return ts.map(spans, s => identifier.substr(s.start, s.length));
return spans.map(s => identifier.substr(s.start, s.length));
}
function breakIntoCharacterSpans(identifier: string) {
@@ -474,23 +343,12 @@ describe("PatternMatcher", () => {
function breakIntoWordSpans(identifier: string) {
return spanListToSubstrings(identifier, ts.breakIntoWordSpans(identifier));
}
function assertArrayEquals<T>(array1: T[], array2: T[]) {
assert.equal(array1.length, array2.length);
for (let i = 0; i < array1.length; i++) {
assert.equal(array1[i], array2[i]);
}
}
function verifyBreakIntoCharacterSpans(original: string, ...parts: string[]): void {
assertArrayEquals(parts, breakIntoCharacterSpans(original));
assert.deepEqual(parts, breakIntoCharacterSpans(original));
}
function verifyBreakIntoWordSpans(original: string, ...parts: string[]): void {
assertArrayEquals(parts, breakIntoWordSpans(original));
}
function assertContainsKind(kind: ts.PatternMatchKind, results: ts.PatternMatch[]) {
assert.isTrue(ts.forEach(results, r => r.kind === kind));
assert.deepEqual(parts, breakIntoWordSpans(original));
}
});
+56 -5
View File
@@ -4131,10 +4131,10 @@ namespace ts.projectSystem {
checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] });
});
it("info diagnostics", () => {
it("suggestion diagnostics", () => {
const file: FileOrFolder = {
path: "/a.js",
content: 'require("b")',
content: "function f(p) {}",
};
const host = createServerHost([file]);
@@ -4177,13 +4177,64 @@ namespace ts.projectSystem {
checkErrorMessage(session, "suggestionDiag", {
file: file.path,
diagnostics: [
createDiagnostic({ line: 1, offset: 1 }, { line: 1, offset: 13 }, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)
createDiagnostic({ line: 1, offset: 12 }, { line: 1, offset: 13 }, Diagnostics._0_is_declared_but_its_value_is_never_read, ["p"], "suggestion", /*reportsUnnecssary*/ true)
],
});
checkCompleteEvent(session, 2, expectedSequenceId);
session.clearMessages();
});
it("disable suggestion diagnostics", () => {
const file: FileOrFolder = {
path: "/a.js",
content: 'require("b")',
};
const host = createServerHost([file]);
const session = createSession(host, { canUseEvents: true });
const service = session.getProjectService();
session.executeCommandSeq<protocol.OpenRequest>({
command: server.CommandNames.Open,
arguments: { file: file.path, fileContent: file.content },
});
session.executeCommandSeq<protocol.ConfigureRequest>({
command: server.CommandNames.Configure,
arguments: {
preferences: { disableSuggestions: true }
},
});
checkNumberOfProjects(service, { inferredProjects: 1 });
session.clearMessages();
const expectedSequenceId = session.getNextSeq();
host.checkTimeoutQueueLengthAndRun(2);
checkProjectUpdatedInBackgroundEvent(session, [file.path]);
session.clearMessages();
session.executeCommandSeq<protocol.GeterrRequest>({
command: server.CommandNames.Geterr,
arguments: {
delay: 0,
files: [file.path],
}
});
host.checkTimeoutQueueLengthAndRun(1);
checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true);
session.clearMessages();
host.runQueuedImmediateCallbacks(1);
checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] });
// No suggestion event, we're done.
checkCompleteEvent(session, 2, expectedSequenceId);
session.clearMessages();
});
it("suppressed diagnostic events", () => {
const file: FileOrFolder = {
path: "/a.ts",
@@ -4241,8 +4292,8 @@ namespace ts.projectSystem {
session.clearMessages();
});
function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray<string> = []): protocol.Diagnostic {
return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category: diagnosticCategoryName(message), source: undefined };
function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray<string> = [], category = diagnosticCategoryName(message), reportsUnnecessary?: {}): protocol.Diagnostic {
return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category, reportsUnnecessary, source: undefined };
}
});
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -772,8 +772,7 @@ interface Date {
interface DateConstructor {
new(): Date;
new(value: number): Date;
new(value: string): Date;
new(value: number | string): Date;
new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
(): string;
readonly prototype: Date;
@@ -3771,6 +3771,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[找到 {0} 个错误。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[找到 1 个错误。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -3879,6 +3897,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generate_get_and_set_accessors_95046" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generate 'get' and 'set' accessors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[生成 "get" 和 "set" 访问器]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
@@ -5988,6 +6015,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型“{1}”上不存在属性“{0}”。是否忘记使用 "await"?]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -642,6 +642,9 @@
<Item ItemId=";A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest parameter or binding pattern may not have a trailing comma.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[REST 參數或繫結模式的結尾不得為逗點。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -903,18 +906,27 @@
<Item ItemId=";Add_all_missing_async_modifiers_95041" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing 'async' modifiers]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增缺少的所有 'async' 修飾詞]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_members_95022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing members]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增遺漏的所有成員]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_super_calls_95039" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing super calls]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增缺少的所有 super 呼叫]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -939,6 +951,9 @@
<Item ItemId=";Add_definite_assignment_assertions_to_all_uninitialized_properties_95028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add definite assignment assertions to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未初始化的屬性新增明確的指派判斷提示]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -966,6 +981,9 @@
<Item ItemId=";Add_initializers_to_all_uninitialized_properties_95027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add initializers to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未初始化的屬性新增初始設定式]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -984,6 +1002,9 @@
<Item ItemId=";Add_this_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to all unresolved variables matching a member name]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有用以比對成員名稱未解析的變數新增 'this.']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1002,18 +1023,27 @@
<Item ItemId=";Add_to_all_uncalled_decorators_95044" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '()' to all uncalled decorators]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未呼叫的裝飾項目新增 '()']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_ts_ignore_to_all_error_messages_95042" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '@ts-ignore' to all error messages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有錯誤訊息新增 '@ts-ignore']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_undefined_type_to_all_uninitialized_properties_95029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add undefined type to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未初始化的屬性新增未定義的類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1524,6 +1554,9 @@
<Item ItemId=";Annotate_everything_with_types_from_JSDoc_95043" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Annotate everything with types from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[標註具備 JSDoc 之類型的所有項目 ]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2151,18 +2184,27 @@
<Item ItemId=";Change_all_extended_interfaces_to_implements_95038" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all extended interfaces to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有延伸介面變更為 'implements']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_95030" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有 jsdoc 樣式的類型變更為 TypeScript]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有 jsdoc 樣式的類型變更為 TypeScript (並為 null 類型新增 '| undefined')]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2475,12 +2517,18 @@
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有建構函式轉換為類別]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_to_default_imports_95035" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all to default imports]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[全部轉換為預設匯入]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2664,6 +2712,9 @@
<Item ItemId=";Delete_all_unused_declarations_95024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused declarations]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[刪除所有未使用的宣告]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3714,6 +3765,27 @@
<Item ItemId=";Fix_all_detected_spelling_errors_95026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Fix all detected spelling errors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[修正偵測到的所有拼字錯誤]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[找到 {0} 個錯誤。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[找到 1 個錯誤。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3825,6 +3897,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generate_get_and_set_accessors_95046" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generate 'get' and 'set' accessors]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
@@ -4032,12 +4110,18 @@
<Item ItemId=";Implement_all_inherited_abstract_classes_95040" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all inherited abstract classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[實作所有繼承的抽象類別]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_all_unimplemented_interfaces_95032" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all unimplemented interfaces]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[實作所有未實作的介面]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4239,6 +4323,9 @@
<Item ItemId=";Infer_all_types_from_usage_95023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer all types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[從用法推斷所有類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4356,6 +4443,9 @@
<Item ItemId=";Install_all_missing_types_packages_95033" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Install all missing types packages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[安裝缺少的所有類型套件]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4851,6 +4941,9 @@
<Item ItemId=";Make_all_super_calls_the_first_statement_in_their_constructor_95036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make all 'super()' calls the first statement in their constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[在其建構函式的第一個陳述式中呼叫所有的 'super()']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4950,12 +5043,18 @@
<Item ItemId=";Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_1340" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a type, but is used as a type here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[模組 '{0}' 未參考任何類型,但在此用為類型。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a value, but is used as a value here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[模組 '{0}' 未參考任何值,但在此用為值。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5853,6 +5952,9 @@
<Item ItemId=";Prefix_all_unused_declarations_with_where_possible_95025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix all unused declarations with '_' where possible]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[若可行,為所有未使用的宣告加上前置詞 '_']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5910,6 +6012,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -6756,6 +6864,9 @@
<Item ItemId=";Rewrite_all_as_indexed_access_types_95034" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite all as indexed access types]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將全部重寫為經過編製索引的存取類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7500,6 +7611,9 @@
<Item ItemId=";The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['for...in' 陳述式的右方必須是類型 'any'、物件類型或型別參數,但此處為類型 '{0}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7821,6 +7935,9 @@
<Item ItemId=";Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 不是陣列類型。請使用編譯器選項 '-downlevelIteration' 允許逐一查看迭代器。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7836,6 +7953,9 @@
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 不是陣列類型或字串類型。請使用編譯器選項 '-downlevelIteration' 允許逐一查看迭代器。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7896,12 +8016,18 @@
<Item ItemId=";Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.asyncIterator]5D;()' method that returns an async iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 必須具備會傳回非同步迭代器的 '[Symbol.asyncIterator]5D;()' 方法。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 必須具備會傳回迭代器的 '[Symbol.iterator]5D;()' 方法。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7986,6 +8112,9 @@
<Item ItemId=";Type_arguments_cannot_be_used_here_1342" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type arguments cannot be used here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[此處不得使用型別引數。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3780,6 +3780,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Našel se tento počet chyb: {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Našla se 1 chyba.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5997,6 +6015,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -3768,6 +3768,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0} Fehler gefunden.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 Fehler gefunden.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5982,6 +6000,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -3780,6 +3780,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Se encontró {0} errores.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Se encontró 1 error.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5997,6 +6015,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -651,6 +651,9 @@
<Item ItemId=";A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest parameter or binding pattern may not have a trailing comma.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les modèles de liaison ou les paramètres rest ne doivent pas avoir de virgule de fin.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -912,18 +915,27 @@
<Item ItemId=";Add_all_missing_async_modifiers_95041" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing 'async' modifiers]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter tous les modificateurs 'async' manquants]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_members_95022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing members]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter tous les membres manquants]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_super_calls_95039" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing super calls]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter tous les appels super manquants]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -948,6 +960,9 @@
<Item ItemId=";Add_definite_assignment_assertions_to_all_uninitialized_properties_95028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add definite assignment assertions to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter des assertions d'affectation définie à toutes les propriétés non initialisées]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -996,6 +1011,9 @@
<Item ItemId=";Add_this_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to all unresolved variables matching a member name]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter 'this.' à toutes les variables non résolues correspondant à un nom de membre]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1014,12 +1032,18 @@
<Item ItemId=";Add_to_all_uncalled_decorators_95044" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '()' to all uncalled decorators]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter '()' à tous les décorateurs non appelés]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_ts_ignore_to_all_error_messages_95042" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '@ts-ignore' to all error messages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajouter '@ts-ignore' à tous les messages d'erreur]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1539,6 +1563,9 @@
<Item ItemId=";Annotate_everything_with_types_from_JSDoc_95043" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Annotate everything with types from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Annoter tout avec des types de JSDoc]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2166,18 +2193,27 @@
<Item ItemId=";Change_all_extended_interfaces_to_implements_95038" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all extended interfaces to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Remplacer toutes les interfaces étendues par 'implements']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_95030" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Remplacer tous les types jsdoc-style par TypeScript]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Remplacer tous les types jsdoc-type par TypeScript (et ajouter '| undefined' aux types nullable)]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2490,12 +2526,18 @@
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Convertir toutes les fonctions de constructeur en classes]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_to_default_imports_95035" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all to default imports]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Convertir tout en importations par défaut]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3732,6 +3774,27 @@
<Item ItemId=";Fix_all_detected_spelling_errors_95026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Fix all detected spelling errors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Corriger toutes les fautes d'orthographe détectées]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0} erreurs trouvées.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 erreur trouvée.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4050,6 +4113,9 @@
<Item ItemId=";Implement_all_inherited_abstract_classes_95040" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all inherited abstract classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implémenter toutes les classes abstraites héritées]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4260,6 +4326,9 @@
<Item ItemId=";Infer_all_types_from_usage_95023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer all types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déduire tous les types de l'utilisation]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4377,6 +4446,9 @@
<Item ItemId=";Install_all_missing_types_packages_95033" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Install all missing types packages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Installer tous les packages de types manquants]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4872,6 +4944,9 @@
<Item ItemId=";Make_all_super_calls_the_first_statement_in_their_constructor_95036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make all 'super()' calls the first statement in their constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Faire de tous les appels 'super()' la première instruction dans leur constructeur]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4971,12 +5046,18 @@
<Item ItemId=";Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_1340" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a type, but is used as a type here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le module '{0}' ne fait pas référence à un type, mais est utilisé en tant que type ici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a value, but is used as a value here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le module '{0}' ne fait pas référence à une valeur, mais est utilisé en tant que valeur ici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5874,6 +5955,9 @@
<Item ItemId=";Prefix_all_unused_declarations_with_where_possible_95025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix all unused declarations with '_' where possible]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Préfixer toutes les déclarations inutilisées avec '_' si possible]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5931,6 +6015,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -6777,6 +6867,9 @@
<Item ItemId=";Rewrite_all_as_indexed_access_types_95034" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite all as indexed access types]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Réécrire tout comme types d'accès indexés]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7521,6 +7614,9 @@
<Item ItemId=";The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La partie droite d'une instruction 'for...in' doit être de type 'any', un type d'objet ou un paramètre de type, mais elle a le type '{0}' ici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7842,6 +7938,9 @@
<Item ItemId=";Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' nest pas un type de tableau. Utilisez l'option du compilateur '--downlevelIteration' pour autoriser l'itération des itérateurs.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7857,6 +7956,9 @@
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' nest pas un type de tableau ou un type string. Utilisez l'option du compilateur '--downlevelIteration' pour autoriser l'itération des itérateurs.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7917,12 +8019,18 @@
<Item ItemId=";Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.asyncIterator]5D;()' method that returns an async iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' doit avoir une méthode '[Symbol.asyncIterator]5D;()' qui retourne un itérateur asynchrone.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' doit avoir une méthode '[Symbol.iterator]5D;()' qui retourne un itérateur.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -8007,6 +8115,9 @@
<Item ItemId=";Type_arguments_cannot_be_used_here_1342" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type arguments cannot be used here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Impossible d'utiliser des arguments de type ici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3771,6 +3771,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Sono stati trovati {0} errori.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[È stato trovato 1 errore.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -3879,6 +3897,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generate_get_and_set_accessors_95046" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generate 'get' and 'set' accessors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Generare le funzioni di accesso 'get' e 'set']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
@@ -5988,6 +6015,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La proprietà '{0}' non esiste nel tipo '{1}'. Si è dimenticato di usare 'await'?]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -3771,6 +3771,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0} 件のエラーが見つかりました。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 件のエラーが見つかりました。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5988,6 +6006,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -3771,6 +3771,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0}개 오류가 발견되었습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1개 오류가 발견되었습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5988,6 +6006,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -3761,6 +3761,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Znaleziono błędy: {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Znaleziono 1 błąd.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -3869,6 +3887,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generate_get_and_set_accessors_95046" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generate 'get' and 'set' accessors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Generuj metody dostępu „get” i „set”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
@@ -5975,6 +6002,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Właściwość „{0}” nie istnieje w typie „{1}”. Czy zapomniano użyć elementu „await”?]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -2702,6 +2702,9 @@
<Item ItemId=";Delete_all_unused_declarations_95024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused declarations]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Excluir todas as declarações não usadas]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3758,6 +3761,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Encontrados {0} erros.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Encontrado 1 erro.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5912,6 +5933,9 @@
<Item ItemId=";Prefix_all_unused_declarations_with_where_possible_95025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix all unused declarations with '_' where possible]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Prefixar com '_' todas as declarações não usadas quando possível]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5969,6 +5993,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -3770,6 +3770,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Найдено ошибок: {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Найдено ошибок: 1.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_package_json_at_0_6099" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 'package.json' at '{0}'.]]></Val>
@@ -5987,6 +6005,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -632,6 +632,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest parameter or binding pattern may not have a trailing comma.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Bir rest parametresi veya bağlama deseninin sonunda virgül olamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_return_statement_can_only_be_used_within_a_function_body_1108" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'return' statement can only be used within a function body.]]></Val>
@@ -890,18 +899,27 @@
<Item ItemId=";Add_all_missing_async_modifiers_95041" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing 'async' modifiers]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm eksik 'async' değiştiricileri ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_members_95022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing members]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm eksik üyeleri ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_super_calls_95039" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing super calls]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm eksik süper çağrıları ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -926,6 +944,9 @@
<Item ItemId=";Add_definite_assignment_assertions_to_all_uninitialized_properties_95028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add definite assignment assertions to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm başlatılmamış özelliklere kesin atama onayları ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -953,6 +974,9 @@
<Item ItemId=";Add_initializers_to_all_uninitialized_properties_95027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add initializers to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm başlatılmamış özelliklere başlatıcılar ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -971,6 +995,9 @@
<Item ItemId=";Add_this_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to all unresolved variables matching a member name]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Bir üye adıyla eşleşen tüm çözülmemiş değişkenlere 'this.' ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -989,18 +1016,27 @@
<Item ItemId=";Add_to_all_uncalled_decorators_95044" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '()' to all uncalled decorators]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Çağrılmayan tüm dekoratörlere '()' ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_ts_ignore_to_all_error_messages_95042" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '@ts-ignore' to all error messages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm hata iletilerine '@ts-ignore' ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_undefined_type_to_all_uninitialized_properties_95029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add undefined type to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm başlatılmamış özelliklere tanımsız tür ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1511,6 +1547,9 @@
<Item ItemId=";Annotate_everything_with_types_from_JSDoc_95043" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Annotate everything with types from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Her şeye JSDoc'tan türler ile not ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2138,18 +2177,27 @@
<Item ItemId=";Change_all_extended_interfaces_to_implements_95038" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all extended interfaces to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm genişletilmiş arabirimleri 'implements' olarak değiştir]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_95030" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm jsdoc-style türlerini TypeScript olarak değiştir]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm jsdoc-style türlerini TypeScript olarak değiştir (ve null yapılabilir türlere '| undefined' ekle)]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2462,12 +2510,18 @@
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm oluşturucu işlevleri sınıflara dönüştür]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_to_default_imports_95035" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all to default imports]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tümünü varsayılan içeri aktarmalara dönüştür]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2651,6 +2705,9 @@
<Item ItemId=";Delete_all_unused_declarations_95024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused declarations]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kullanılmayan tüm bildirimleri sil]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3701,6 +3758,27 @@
<Item ItemId=";Fix_all_detected_spelling_errors_95026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Fix all detected spelling errors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Algılanan tüm yazım hatalarını düzelt]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[{0} hata bulundu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[1 hata bulundu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4019,12 +4097,18 @@
<Item ItemId=";Implement_all_inherited_abstract_classes_95040" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all inherited abstract classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Devralınan tüm soyut sınıfları uygula]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_all_unimplemented_interfaces_95032" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all unimplemented interfaces]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uygulanmayan tüm arabirimleri uygula]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4226,6 +4310,9 @@
<Item ItemId=";Infer_all_types_from_usage_95023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer all types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm türleri kullanımdan çıkar]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4343,6 +4430,9 @@
<Item ItemId=";Install_all_missing_types_packages_95033" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Install all missing types packages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm eksik tür paketlerini yükle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4838,6 +4928,9 @@
<Item ItemId=";Make_all_super_calls_the_first_statement_in_their_constructor_95036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make all 'super()' calls the first statement in their constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tüm 'super()' çağrılarını kendi oluşturucularının ilk deyimi yap]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4934,6 +5027,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_1340" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a type, but is used as a type here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' modülü bir türe başvurmuyor ancak burada bir tür olarak kullanılmış.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a value, but is used as a value here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' modülü bir değere başvurmuyor ancak burada bir değer olarak kullanılmış.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity.]]></Val>
@@ -5828,6 +5939,9 @@
<Item ItemId=";Prefix_all_unused_declarations_with_where_possible_95025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix all unused declarations with '_' where possible]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Mümkün olduğunda tüm kullanılmayan bildirimlerin başına '_' ekle]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5885,6 +5999,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -6731,6 +6851,9 @@
<Item ItemId=";Rewrite_all_as_indexed_access_types_95034" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite all as indexed access types]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tümünü dizinlenmiş erişim türleri olarak yeniden yaz]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7472,11 +7595,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.]]></Val>
<Val><![CDATA[The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['for...in' deyiminin sağ tarafı 'any' türünde, bir nesne türü veya tür parametresi olmalıdır.]]></Val>
<Val><![CDATA['for...in' deyiminin sağ tarafı 'any' türünde, bir nesne türü veya tür parametresi olmalıdır ancak burada '{0}' türüne sahip.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -7796,6 +7919,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' türü bir dizi türü değil. Yineleyicilerin yinelenmesine izin vermek için '--downlevelIteration' derleyici seçeneğini kullanın.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_2495" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type.]]></Val>
@@ -7805,6 +7937,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' türü bir dizi türü veya bir dize türü değil. Yineleyicilerin yinelenmesine izin vermek için '--downlevelIteration' derleyici seçeneğini kullanın.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
@@ -7859,6 +8000,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.asyncIterator]5D;()' method that returns an async iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' türünün, zaman uyumsuz bir yineleyici döndüren bir '[Symbol.asyncIterator]5D;()' metoduna sahip olması gerekir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' türünün, bir yineleyici döndüren '[Symbol.iterator]5D;()' metoduna sahip olması gerekir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_provides_no_match_for_the_signature_1_2658" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' provides no match for the signature '{1}'.]]></Val>
@@ -7937,6 +8096,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_arguments_cannot_be_used_here_1342" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type arguments cannot be used here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tür bağımsız değişkenleri burada kullanılamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_declaration_files_to_be_included_in_compilation_6124" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type declaration files to be included in compilation.]]></Val>
@@ -7964,24 +8132,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type must have a '[Symbol.asyncIterator]5D;()' method that returns an async iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Türün, zaman uyumsuz bir yineleyici döndüren bir '[Symbol.asyncIterator]5D;()' metoduna sahip olması gerekir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type must have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tür, bir yineleyici döndüren '[Symbol.iterator]5D;()' metoduna sahip olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
+2 -3
View File
@@ -1,5 +1,3 @@
/// <reference path="session.ts" />
namespace ts.server {
export interface SessionClientHost extends LanguageServiceHost {
writeMessage(message: string): void;
@@ -558,7 +556,8 @@ namespace ts.server {
const request = this.processRequest<protocol.CodeFixRequest>(CommandNames.GetCodeFixes, args);
const response = this.processResponse<protocol.CodeFixResponse>(request);
return response.body.map(({ description, changes, fixId, fixAllDescription }) => ({ description, changes: this.convertChanges(changes, file), fixId, fixAllDescription }));
return response.body.map<CodeFixAction>(({ fixName, description, changes, commands, fixId, fixAllDescription }) =>
({ fixName, description, changes: this.convertChanges(changes, file), commands: commands as CodeActionCommand[], fixId, fixAllDescription }));
}
getCombinedCodeFix = notImplemented;
+13 -15
View File
@@ -1,11 +1,3 @@
/// <reference path="..\compiler\commandLineParser.ts" />
/// <reference path="..\services\services.ts" />
/// <reference path="utilities.ts" />
/// <reference path="session.ts" />
/// <reference path="scriptVersionCache.ts"/>
/// <reference path="project.ts"/>
/// <reference path="typingsCache.ts"/>
namespace ts.server {
export const maxProgramSizeForNonTsFiles = 20 * 1024 * 1024;
@@ -392,6 +384,7 @@ namespace ts.server {
public readonly useSingleInferredProject: boolean;
public readonly useInferredProjectPerProjectRoot: boolean;
public readonly typingsInstaller: ITypingsInstaller;
private readonly globalCacheLocationDirectoryPath: Path;
public readonly throttleWaitMilliseconds?: number;
private readonly eventHandler?: ProjectServiceEventHandler;
private readonly suppressDiagnosticEvents?: boolean;
@@ -431,6 +424,8 @@ namespace ts.server {
}
this.currentDirectory = this.host.getCurrentDirectory();
this.toCanonicalFileName = createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation &&
ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation));
this.throttledOperations = new ThrottledOperations(this.host, this.logger);
if (this.typesMapLocation) {
@@ -548,10 +543,11 @@ namespace ts.server {
else {
if (this.pendingEnsureProjectForOpenFiles) {
this.ensureProjectForOpenFiles();
// Send the event to notify that there were background project updates
// send current list of open files
this.sendProjectsUpdatedInBackgroundEvent();
}
// Send the event to notify that there were background project updates
// send current list of open files
this.sendProjectsUpdatedInBackgroundEvent();
}
});
}
@@ -642,7 +638,6 @@ namespace ts.server {
return undefined;
}
if (isInferredProjectName(projectName)) {
this.ensureProjectStructuresUptoDate();
return findProjectByName(projectName, this.inferredProjects);
}
return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(toNormalizedPath(projectName));
@@ -1738,7 +1733,10 @@ namespace ts.server {
private watchClosedScriptInfo(info: ScriptInfo) {
Debug.assert(!info.fileWatcher);
// do not watch files with mixed content - server doesn't know how to interpret it
if (!info.isDynamicOrHasMixedContent()) {
// do not watch files in the global cache location
if (!info.isDynamicOrHasMixedContent() &&
(!this.globalCacheLocationDirectoryPath ||
!startsWith(info.path, this.globalCacheLocationDirectoryPath))) {
const { fileName } = info;
info.fileWatcher = this.watchFactory.watchFilePath(
this.host,
@@ -1836,11 +1834,11 @@ namespace ts.server {
this.logger.info(`Host information ${args.hostInfo}`);
}
if (args.formatOptions) {
mergeMapLikes(this.hostConfiguration.formatCodeOptions, convertFormatOptions(args.formatOptions));
this.hostConfiguration.formatCodeOptions = { ...this.hostConfiguration.formatCodeOptions, ...convertFormatOptions(args.formatOptions) };
this.logger.info("Format host information updated");
}
if (args.preferences) {
mergeMapLikes(this.hostConfiguration.preferences, args.preferences);
this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
}
if (args.extraFileExtensions) {
this.hostConfiguration.extraFileExtensions = args.extraFileExtensions;
-7
View File
@@ -1,10 +1,3 @@
/// <reference path="..\services\services.ts" />
/// <reference path="utilities.ts"/>
/// <reference path="scriptInfo.ts"/>
/// <reference path="..\compiler\resolutionCache.ts"/>
/// <reference path="typingsCache.ts"/>
/// <reference path="..\compiler\builderState.ts"/>
namespace ts.server {
export enum ProjectKind {
+5
View File
@@ -1698,6 +1698,8 @@ namespace ts.server.protocol {
}
export interface CodeFixAction extends CodeAction {
/** Short name to identify the fix, for use by telemetry. */
fixName: string;
/**
* If present, one may call 'getCombinedCodeFix' with this fixId.
* This may be omitted to indicate that the code fix can't be applied in a group.
@@ -2172,6 +2174,8 @@ namespace ts.server.protocol {
*/
category: string;
reportsUnnecessary?: {};
/**
* The error code of the diagnostic message.
*/
@@ -2638,6 +2642,7 @@ namespace ts.server.protocol {
}
export interface UserPreferences {
readonly disableSuggestions?: boolean;
readonly quotePreference?: "double" | "single";
/**
* If enabled, TypeScript will search through all external modules' exports and add them to the completions list.
+6 -5
View File
@@ -1,5 +1,3 @@
/// <reference path="scriptVersionCache.ts"/>
namespace ts.server {
/* @internal */
@@ -397,15 +395,18 @@ namespace ts.server {
if (formatSettings) {
if (!this.formatSettings) {
this.formatSettings = getDefaultFormatCodeSettings(this.host);
assign(this.formatSettings, formatSettings);
}
else {
this.formatSettings = { ...this.formatSettings, ...formatSettings };
}
mergeMapLikes(this.formatSettings, formatSettings);
}
if (preferences) {
if (!this.preferences) {
this.preferences = clone(defaultPreferences);
this.preferences = defaultPreferences;
}
mergeMapLikes(this.preferences, preferences);
this.preferences = { ...this.preferences, ...preferences };
}
}
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="..\compiler\commandLineParser.ts" />
/// <reference path="..\services\services.ts" />
/// <reference path="session.ts" />
/*@internal*/
namespace ts.server {
const lineCollectionCapacity = 4;
-9
View File
@@ -1,6 +1,3 @@
/// <reference path="shared.ts" />
/// <reference path="session.ts" />
namespace ts.server {
const childProcess: {
fork(modulePath: string, args: string[], options?: { execArgv: string[], env?: MapLike<string> }): NodeChildProcess;
@@ -211,12 +208,6 @@ namespace ts.server {
}
}
// E.g. "12:34:56.789"
function nowString() {
const d = new Date();
return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`;
}
interface QueuedOperation {
operationId: string;
operation: () => void;
+23 -24
View File
@@ -1,8 +1,3 @@
/// <reference path="..\compiler\commandLineParser.ts" />
/// <reference path="..\services\services.ts" />
/// <reference path="protocol.ts" />
/// <reference path="editorServices.ts" />
namespace ts.server {
interface StackTraceError extends Error {
stack?: string;
@@ -80,6 +75,7 @@ namespace ts.server {
text: flattenDiagnosticMessageText(diag.messageText, "\n"),
code: diag.code,
category: diagnosticCategoryName(diag),
reportsUnnecessary: diag.reportsUnnecessary,
source: diag.source
};
}
@@ -96,8 +92,8 @@ namespace ts.server {
const text = flattenDiagnosticMessageText(diag.messageText, "\n");
const { code, source } = diag;
const category = diagnosticCategoryName(diag);
return includeFileName ? { start, end, text, code, category, source, fileName: diag.file && diag.file.fileName } :
{ start, end, text, code, category, source };
return includeFileName ? { start, end, text, code, category, source, reportsUnnecessary: diag.reportsUnnecessary, fileName: diag.file && diag.file.fileName } :
{ start, end, text, code, category, reportsUnnecessary: diag.reportsUnnecessary, source };
}
export interface PendingErrorCheck {
@@ -484,7 +480,7 @@ namespace ts.server {
this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag");
}
private infoCheck(file: NormalizedPath, project: Project) {
private suggestionCheck(file: NormalizedPath, project: Project) {
this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag");
}
@@ -527,12 +523,20 @@ namespace ts.server {
return;
}
next.immediate(() => {
this.infoCheck(fileName, project);
const goNext = () => {
if (checkList.length > index) {
next.delay(followMs, checkOne);
}
});
};
if (this.getPreferences(fileName).disableSuggestions) {
goNext();
}
else {
next.immediate(() => {
this.suggestionCheck(fileName, project);
goNext();
});
}
});
};
@@ -1659,7 +1663,7 @@ namespace ts.server {
}
}
private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.CodeAction> | ReadonlyArray<CodeAction> {
private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.CodeFixAction> | ReadonlyArray<CodeFixAction> {
if (args.errorCodes.length === 0) {
return undefined;
}
@@ -1669,15 +1673,7 @@ namespace ts.server {
const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo);
const codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
if (!codeActions) {
return undefined;
}
if (simplifiedResult) {
return codeActions.map(codeAction => this.mapCodeAction(project, codeAction));
}
else {
return codeActions;
}
return simplifiedResult ? codeActions.map(codeAction => this.mapCodeFixAction(project, codeAction)) : codeActions;
}
private getCombinedCodeFix({ scope, fixId }: protocol.GetCombinedCodeFixRequestArgs, simplifiedResult: boolean): protocol.CombinedCodeActions | CombinedCodeActions {
@@ -1725,9 +1721,12 @@ namespace ts.server {
return { startPosition, endPosition };
}
private mapCodeAction(project: Project, { description, changes: unmappedChanges, commands, fixId, fixAllDescription }: CodeFixAction): protocol.CodeFixAction {
const changes = unmappedChanges.map(change => this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(toNormalizedPath(change.fileName))));
return { description, changes, commands, fixId, fixAllDescription };
private mapCodeAction(project: Project, { description, changes, commands }: CodeAction): protocol.CodeAction {
return { description, changes: this.mapTextChangesToCodeEdits(project, changes), commands };
}
private mapCodeFixAction(project: Project, { fixName, description, changes, commands, fixId, fixAllDescription }: CodeFixAction): protocol.CodeFixAction {
return { fixName, description, changes: this.mapTextChangesToCodeEdits(project, changes), commands, fixId, fixAllDescription };
}
private mapTextChangesToCodeEdits(project: Project, textChanges: ReadonlyArray<FileTextChanges>): protocol.FileCodeEdits[] {
+8 -3
View File
@@ -1,5 +1,3 @@
/// <reference path="types.ts" />
namespace ts.server {
// tslint:disable variable-name
export const ActionSet: ActionSet = "action::set";
@@ -33,4 +31,11 @@ namespace ts.server {
? sys.args[index + 1]
: undefined;
}
}
/*@internal*/
export function nowString() {
// E.g. "12:34:56.789"
const d = new Date();
return `${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`;
}
}
+111 -3
View File
@@ -9,17 +9,125 @@
]
},
"files": [
"../services/shims.ts",
"../compiler/types.ts",
"../compiler/performance.ts",
"../compiler/core.ts",
"../compiler/sys.ts",
"../compiler/diagnosticInformationMap.generated.ts",
"../compiler/scanner.ts",
"../compiler/utilities.ts",
"../compiler/parser.ts",
"../compiler/binder.ts",
"../compiler/symbolWalker.ts",
"../compiler/moduleNameResolver.ts",
"../compiler/checker.ts",
"../compiler/factory.ts",
"../compiler/visitor.ts",
"../compiler/transformers/utilities.ts",
"../compiler/transformers/destructuring.ts",
"../compiler/transformers/ts.ts",
"../compiler/transformers/es2017.ts",
"../compiler/transformers/esnext.ts",
"../compiler/transformers/jsx.ts",
"../compiler/transformers/es2016.ts",
"../compiler/transformers/es2015.ts",
"../compiler/transformers/es5.ts",
"../compiler/transformers/generators.ts",
"../compiler/transformers/module/module.ts",
"../compiler/transformers/module/system.ts",
"../compiler/transformers/module/es2015.ts",
"../compiler/transformers/declarations/diagnostics.ts",
"../compiler/transformers/declarations.ts",
"../compiler/transformer.ts",
"../compiler/sourcemap.ts",
"../compiler/comments.ts",
"../compiler/emitter.ts",
"../compiler/watchUtilities.ts",
"../compiler/program.ts",
"../compiler/builderState.ts",
"../compiler/builder.ts",
"../compiler/resolutionCache.ts",
"../compiler/watch.ts",
"../compiler/commandLineParser.ts",
"../services/types.ts",
"../services/utilities.ts",
"../services/classifier.ts",
"../services/pathCompletions.ts",
"../services/completions.ts",
"../services/documentHighlights.ts",
"../services/documentRegistry.ts",
"../services/importTracker.ts",
"../services/findAllReferences.ts",
"../services/goToDefinition.ts",
"../services/jsDoc.ts",
"../services/semver.ts",
"../services/jsTyping.ts",
"../services/navigateTo.ts",
"../services/navigationBar.ts",
"../services/organizeImports.ts",
"../services/outliningElementsCollector.ts",
"../services/patternMatcher.ts",
"../services/preProcess.ts",
"../services/rename.ts",
"../services/signatureHelp.ts",
"../services/suggestionDiagnostics.ts",
"../services/symbolDisplay.ts",
"../services/transpile.ts",
"../services/formatting/formattingContext.ts",
"../services/formatting/formattingScanner.ts",
"../services/formatting/rule.ts",
"../services/formatting/rules.ts",
"../services/formatting/rulesMap.ts",
"../services/formatting/formatting.ts",
"../services/formatting/smartIndenter.ts",
"../services/textChanges.ts",
"../services/codeFixProvider.ts",
"../services/refactorProvider.ts",
"../services/codefixes/addMissingInvocationForDecorator.ts",
"../services/codefixes/annotateWithTypeFromJSDoc.ts",
"../services/codefixes/convertFunctionToEs6Class.ts",
"../services/codefixes/convertToEs6Module.ts",
"../services/codefixes/correctQualifiedNameToIndexedAccessType.ts",
"../services/codefixes/fixClassIncorrectlyImplementsInterface.ts",
"../services/codefixes/importFixes.ts",
"../services/codefixes/fixSpelling.ts",
"../services/codefixes/fixAddMissingMember.ts",
"../services/codefixes/fixCannotFindModule.ts",
"../services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts",
"../services/codefixes/fixClassSuperMustPrecedeThisAccess.ts",
"../services/codefixes/fixConstructorForDerivedNeedSuperCall.ts",
"../services/codefixes/fixExtendsInterfaceBecomesImplements.ts",
"../services/codefixes/fixForgottenThisPropertyAccess.ts",
"../services/codefixes/fixUnusedIdentifier.ts",
"../services/codefixes/fixJSDocTypes.ts",
"../services/codefixes/fixAwaitInSyncFunction.ts",
"../services/codefixes/disableJsDiagnostics.ts",
"../services/codefixes/helpers.ts",
"../services/codefixes/inferFromUsage.ts",
"../services/codefixes/fixInvalidImportSyntax.ts",
"../services/codefixes/fixStrictClassInitialization.ts",
"../services/codefixes/useDefaultImport.ts",
"../services/codefixes/fixes.ts",
"../services/refactors/extractSymbol.ts",
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
"../services/refactors/refactors.ts",
"../services/sourcemaps.ts",
"../services/services.ts",
"../services/breakpoints.ts",
"../services/transform.ts",
"../services/shims.ts",
"types.ts",
"shared.ts",
"utilities.ts",
"scriptVersionCache.ts",
"protocol.ts",
"scriptInfo.ts",
"typingsCache.ts",
"project.ts",
"editorServices.ts",
"protocol.ts",
"session.ts",
"scriptVersionCache.ts",
"server.ts"
]
}
+116 -9
View File
@@ -15,17 +15,124 @@
"types": []
},
"files": [
"editorServices.ts",
"project.ts",
"../compiler/types.ts",
"../compiler/performance.ts",
"../compiler/core.ts",
"../compiler/sys.ts",
"../compiler/diagnosticInformationMap.generated.ts",
"../compiler/scanner.ts",
"../compiler/utilities.ts",
"../compiler/parser.ts",
"../compiler/binder.ts",
"../compiler/symbolWalker.ts",
"../compiler/moduleNameResolver.ts",
"../compiler/checker.ts",
"../compiler/factory.ts",
"../compiler/visitor.ts",
"../compiler/transformers/utilities.ts",
"../compiler/transformers/destructuring.ts",
"../compiler/transformers/ts.ts",
"../compiler/transformers/es2017.ts",
"../compiler/transformers/esnext.ts",
"../compiler/transformers/jsx.ts",
"../compiler/transformers/es2016.ts",
"../compiler/transformers/es2015.ts",
"../compiler/transformers/es5.ts",
"../compiler/transformers/generators.ts",
"../compiler/transformers/module/module.ts",
"../compiler/transformers/module/system.ts",
"../compiler/transformers/module/es2015.ts",
"../compiler/transformers/declarations/diagnostics.ts",
"../compiler/transformers/declarations.ts",
"../compiler/transformer.ts",
"../compiler/sourcemap.ts",
"../compiler/comments.ts",
"../compiler/emitter.ts",
"../compiler/watchUtilities.ts",
"../compiler/program.ts",
"../compiler/builderState.ts",
"../compiler/builder.ts",
"../compiler/resolutionCache.ts",
"../compiler/watch.ts",
"../compiler/commandLineParser.ts",
"../services/types.ts",
"../services/utilities.ts",
"../services/classifier.ts",
"../services/pathCompletions.ts",
"../services/completions.ts",
"../services/documentHighlights.ts",
"../services/documentRegistry.ts",
"../services/importTracker.ts",
"../services/findAllReferences.ts",
"../services/goToDefinition.ts",
"../services/jsDoc.ts",
"../services/semver.ts",
"../services/jsTyping.ts",
"../services/navigateTo.ts",
"../services/navigationBar.ts",
"../services/organizeImports.ts",
"../services/outliningElementsCollector.ts",
"../services/patternMatcher.ts",
"../services/preProcess.ts",
"../services/rename.ts",
"../services/signatureHelp.ts",
"../services/suggestionDiagnostics.ts",
"../services/symbolDisplay.ts",
"../services/transpile.ts",
"../services/formatting/formattingContext.ts",
"../services/formatting/formattingScanner.ts",
"../services/formatting/rule.ts",
"../services/formatting/rules.ts",
"../services/formatting/rulesMap.ts",
"../services/formatting/formatting.ts",
"../services/formatting/smartIndenter.ts",
"../services/textChanges.ts",
"../services/codeFixProvider.ts",
"../services/refactorProvider.ts",
"../services/codefixes/addMissingInvocationForDecorator.ts",
"../services/codefixes/annotateWithTypeFromJSDoc.ts",
"../services/codefixes/convertFunctionToEs6Class.ts",
"../services/codefixes/convertToEs6Module.ts",
"../services/codefixes/correctQualifiedNameToIndexedAccessType.ts",
"../services/codefixes/fixClassIncorrectlyImplementsInterface.ts",
"../services/codefixes/importFixes.ts",
"../services/codefixes/fixSpelling.ts",
"../services/codefixes/fixAddMissingMember.ts",
"../services/codefixes/fixCannotFindModule.ts",
"../services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts",
"../services/codefixes/fixClassSuperMustPrecedeThisAccess.ts",
"../services/codefixes/fixConstructorForDerivedNeedSuperCall.ts",
"../services/codefixes/fixExtendsInterfaceBecomesImplements.ts",
"../services/codefixes/fixForgottenThisPropertyAccess.ts",
"../services/codefixes/fixUnusedIdentifier.ts",
"../services/codefixes/fixJSDocTypes.ts",
"../services/codefixes/fixAwaitInSyncFunction.ts",
"../services/codefixes/disableJsDiagnostics.ts",
"../services/codefixes/helpers.ts",
"../services/codefixes/inferFromUsage.ts",
"../services/codefixes/fixInvalidImportSyntax.ts",
"../services/codefixes/fixStrictClassInitialization.ts",
"../services/codefixes/useDefaultImport.ts",
"../services/codefixes/fixes.ts",
"../services/refactors/extractSymbol.ts",
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
"../services/refactors/refactors.ts",
"../services/sourcemaps.ts",
"../services/services.ts",
"../services/breakpoints.ts",
"../services/transform.ts",
"../services/shims.ts",
"types.ts",
"shared.ts",
"utilities.ts",
"protocol.ts",
"scriptInfo.ts",
"scriptVersionCache.ts",
"session.ts",
"shared.ts",
"types.ts",
"typingsCache.ts",
"utilities.ts",
"../services/shims.ts",
"../services/utilities.ts"
"project.ts",
"editorServices.ts",
"session.ts",
"scriptVersionCache.ts"
]
}
-4
View File
@@ -1,7 +1,3 @@
/// <reference path="../compiler/types.ts"/>
/// <reference path="../compiler/sys.ts"/>
/// <reference path="../services/jsTyping.ts"/>
declare namespace ts.server {
export interface CompressedData {
length: number;
-2
View File
@@ -1,5 +1,3 @@
/// <reference path="project.ts"/>
namespace ts.server {
export interface InstallPackageOptionsWithProject extends InstallPackageOptions {
projectName: string;
@@ -21,7 +21,7 @@ namespace ts.server.typingsInstaller {
}
writeLine = (text: string) => {
try {
fs.appendFileSync(this.logFile, text + sys.newLine);
fs.appendFileSync(this.logFile, `[${nowString()}] ${text}${sys.newLine}`);
}
catch (e) {
this.logEnabled = false;
@@ -184,9 +184,8 @@ namespace ts.server.typingsInstaller {
if (this.log.isEnabled()) {
this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(packageNames)}'.`);
}
const command = `${this.npmPath} install --ignore-scripts ${packageNames.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`;
const start = Date.now();
const hasError = this.execSyncAndLog(command, { cwd });
const hasError = installNpmPackages(this.npmPath, version, packageNames, command => this.execSyncAndLog(command, { cwd }));
if (this.log.isEnabled()) {
this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms`);
}
@@ -30,6 +30,31 @@ namespace ts.server.typingsInstaller {
}
}
/*@internal*/
export function installNpmPackages(npmPath: string, tsVersion: string, packageNames: string[], install: (command: string) => boolean) {
let hasError = false;
for (let remaining = packageNames.length; remaining > 0;) {
const result = getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining);
remaining = result.remaining;
hasError = install(result.command) || hasError;
}
return hasError;
}
/*@internal*/
export function getNpmCommandForInstallation(npmPath: string, tsVersion: string, packageNames: string[], remaining: number) {
const sliceStart = packageNames.length - remaining;
let command: string, toSlice = remaining;
while (true) {
command = `${npmPath} install --ignore-scripts ${(toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" ")} --save-dev --user-agent="typesInstaller/${tsVersion}"`;
if (command.length < 8000) {
break;
}
toSlice = toSlice - Math.floor(toSlice / 2);
}
return { command, remaining: remaining - toSlice };
}
export type RequestCompletedAction = (success: boolean) => void;
interface PendingRequest {
-11
View File
@@ -1,6 +1,3 @@
/// <reference path="types.ts" />
/// <reference path="shared.ts" />
namespace ts.server {
export enum LogLevel {
terse,
@@ -83,14 +80,6 @@ namespace ts.server {
};
}
export function mergeMapLikes<T extends object>(target: T, source: Partial<T>): void {
for (const key in source) {
if (hasProperty(source, key)) {
target[key] = source[key];
}
}
}
export type NormalizedPath = string & { __normalizedPathTag: any };
export function toNormalizedPath(fileName: string): NormalizedPath {
-5
View File
@@ -1,8 +1,3 @@
// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0.
// See LICENSE.txt in the project root for complete license information.
/// <reference path='services.ts' />
/* @internal */
namespace ts.BreakpointResolver {
/**
+11 -33
View File
@@ -24,7 +24,7 @@ namespace ts {
}
export namespace codefix {
const codeFixRegistrations: CodeFixRegistration[][] = [];
const errorCodeToFixes = createMultiMap<CodeFixRegistration>();
const fixIdToRegistration = createMap<CodeFixRegistration>();
type DiagnosticAndArguments = DiagnosticMessage | [DiagnosticMessage, string] | [DiagnosticMessage, string, string];
@@ -34,26 +34,21 @@ namespace ts {
: getLocaleSpecificMessage(diag);
}
export function createCodeFixActionNoFixId(changes: FileTextChanges[], description: DiagnosticAndArguments) {
return createCodeFixActionWorker(diagnosticToString(description), changes, /*fixId*/ undefined, /*fixAllDescription*/ undefined);
export function createCodeFixActionNoFixId(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments) {
return createCodeFixActionWorker(fixName, diagnosticToString(description), changes, /*fixId*/ undefined, /*fixAllDescription*/ undefined);
}
export function createCodeFixAction(changes: FileTextChanges[], description: DiagnosticAndArguments, fixId: {}, fixAllDescription: DiagnosticAndArguments, command?: CodeActionCommand): CodeFixAction {
return createCodeFixActionWorker(diagnosticToString(description), changes, fixId, diagnosticToString(fixAllDescription), command);
export function createCodeFixAction(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments, fixId: {}, fixAllDescription: DiagnosticAndArguments, command?: CodeActionCommand): CodeFixAction {
return createCodeFixActionWorker(fixName, diagnosticToString(description), changes, fixId, diagnosticToString(fixAllDescription), command);
}
function createCodeFixActionWorker(description: string, changes: FileTextChanges[], fixId?: {}, fixAllDescription?: string, command?: CodeActionCommand): CodeFixAction {
return { description, changes, fixId, fixAllDescription, commands: command ? [command] : undefined };
function createCodeFixActionWorker(fixName: string, description: string, changes: FileTextChanges[], fixId?: {}, fixAllDescription?: string, command?: CodeActionCommand): CodeFixAction {
return { fixName, description, changes, fixId, fixAllDescription, commands: command ? [command] : undefined };
}
export function registerCodeFix(reg: CodeFixRegistration) {
for (const error of reg.errorCodes) {
let registrations = codeFixRegistrations[error];
if (!registrations) {
registrations = [];
codeFixRegistrations[error] = registrations;
}
registrations.push(reg);
errorCodeToFixes.add(String(error), reg);
}
if (reg.fixIds) {
for (const fixId of reg.fixIds) {
@@ -63,29 +58,12 @@ namespace ts {
}
}
export function getSupportedErrorCodes() {
return Object.keys(codeFixRegistrations);
export function getSupportedErrorCodes(): string[] {
return arrayFrom(errorCodeToFixes.keys());
}
export function getFixes(context: CodeFixContext): CodeFixAction[] {
const fixes = codeFixRegistrations[context.errorCode];
const allActions: CodeFixAction[] = [];
forEach(fixes, f => {
const actions = f.getCodeActions(context);
if (actions && actions.length > 0) {
for (const action of actions) {
if (action === undefined) {
context.host.log(`Action for error code ${context.errorCode} added an invalid action entry; please log a bug`);
}
else {
allActions.push(action);
}
}
}
});
return allActions;
return flatMap(errorCodeToFixes.get(String(context.errorCode)) || emptyArray, f => f.getCodeActions(context));
}
export function getAllFixes(context: CodeFixAllContext): CombinedCodeActions {
@@ -6,7 +6,7 @@ namespace ts.codefix {
errorCodes,
getCodeActions: (context) => {
const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start));
return [createCodeFixAction(changes, Diagnostics.Call_decorator_expression, fixId, Diagnostics.Add_to_all_uncalled_decorators)];
return [createCodeFixAction(fixId, changes, Diagnostics.Call_decorator_expression, fixId, Diagnostics.Add_to_all_uncalled_decorators)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file!, diag.start!)),
@@ -8,7 +8,7 @@ namespace ts.codefix {
const decl = getDeclaration(context.sourceFile, context.span.start);
if (!decl) return;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, decl));
return [createCodeFixAction(changes, Diagnostics.Annotate_with_type_from_JSDoc, fixId, Diagnostics.Annotate_everything_with_types_from_JSDoc)];
return [createCodeFixAction(fixId, changes, Diagnostics.Annotate_with_type_from_JSDoc, fixId, Diagnostics.Annotate_everything_with_types_from_JSDoc)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
@@ -6,7 +6,7 @@ namespace ts.codefix {
errorCodes,
getCodeActions(context: CodeFixContext) {
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, context.span.start, context.program.getTypeChecker()));
return [createCodeFixAction(changes, Diagnostics.Convert_function_to_an_ES2015_class, fixId, Diagnostics.Convert_all_constructor_functions_to_classes)];
return [createCodeFixAction(fixId, changes, Diagnostics.Convert_function_to_an_ES2015_class, fixId, Diagnostics.Convert_all_constructor_functions_to_classes)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, err) => doChange(changes, err.file!, err.start, context.program.getTypeChecker())),
+1 -1
View File
@@ -13,7 +13,7 @@ namespace ts.codefix {
}
});
// No support for fix-all since this applies to the whole file at once anyway.
return [createCodeFixActionNoFixId(changes, Diagnostics.Convert_to_ES6_module)];
return [createCodeFixActionNoFixId("convertToEs6Module", changes, Diagnostics.Convert_to_ES6_module)];
},
});
@@ -9,7 +9,7 @@ namespace ts.codefix {
if (!qualifiedName) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, qualifiedName));
const newText = `${qualifiedName.left.text}["${qualifiedName.right.text}"]`;
return [createCodeFixAction(changes, [Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, Diagnostics.Rewrite_all_as_indexed_access_types)];
return [createCodeFixAction(fixId, changes, [Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, Diagnostics.Rewrite_all_as_indexed_access_types)];
},
fixIds: [fixId],
getAllCodeActions: (context) => codeFixAll(context, errorCodes, (changes, diag) => {
@@ -1,5 +1,6 @@
/* @internal */
namespace ts.codefix {
const fixName = "disableJsDiagnostics";
const fixId = "disableJsDiagnostics";
const errorCodes = mapDefined(Object.keys(Diagnostics) as ReadonlyArray<keyof typeof Diagnostics>, key => {
const diag = Diagnostics[key];
@@ -18,6 +19,7 @@ namespace ts.codefix {
const fixes: CodeFixAction[] = [
// fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file.
createCodeFixActionNoFixId(
fixName,
[createFileTextChanges(sourceFile.fileName, [
createTextChange(sourceFile.checkJsDirective
? createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
@@ -27,7 +29,7 @@ namespace ts.codefix {
];
if (textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
fixes.unshift(createCodeFixAction(textChanges.ChangeTracker.with(context, t => makeChange(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId, Diagnostics.Add_ts_ignore_to_all_error_messages));
fixes.unshift(createCodeFixAction(fixName, textChanges.ChangeTracker.with(context, t => makeChange(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId, Diagnostics.Add_ts_ignore_to_all_error_messages));
}
return fixes;
@@ -1,5 +1,6 @@
/* @internal */
namespace ts.codefix {
const fixName = "addMissingMember";
const errorCodes = [
Diagnostics.Property_0_does_not_exist_on_type_1.code,
Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,
@@ -75,7 +76,7 @@ namespace ts.codefix {
function getActionsForAddMissingMemberInJavaScriptFile(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, makeStatic: boolean): CodeFixAction | undefined {
const changes = textChanges.ChangeTracker.with(context, t => addMissingMemberInJs(t, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic));
return changes.length === 0 ? undefined
: createCodeFixAction(changes, [makeStatic ? Diagnostics.Initialize_static_property_0 : Diagnostics.Initialize_property_0_in_the_constructor, tokenName], fixId, Diagnostics.Add_all_missing_members);
: createCodeFixAction(fixName, changes, [makeStatic ? Diagnostics.Initialize_static_property_0 : Diagnostics.Initialize_property_0_in_the_constructor, tokenName], fixId, Diagnostics.Add_all_missing_members);
}
function addMissingMemberInJs(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, makeStatic: boolean): void {
@@ -120,7 +121,7 @@ namespace ts.codefix {
function createAddPropertyDeclarationAction(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, makeStatic: boolean, tokenName: string, typeNode: TypeNode): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic));
return createCodeFixAction(changes, [makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, tokenName], fixId, Diagnostics.Add_all_missing_members);
return createCodeFixAction(fixName, changes, [makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, tokenName], fixId, Diagnostics.Add_all_missing_members);
}
function addPropertyDeclaration(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, typeNode: TypeNode, makeStatic: boolean): void {
@@ -153,7 +154,7 @@ namespace ts.codefix {
const changes = textChanges.ChangeTracker.with(context, t => t.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, indexSignature));
// No fixId here because code-fix-all currently only works on adding individual named properties.
return createCodeFixActionNoFixId(changes, [Diagnostics.Add_index_signature_for_property_0, tokenName]);
return createCodeFixActionNoFixId(fixName, changes, [Diagnostics.Add_index_signature_for_property_0, tokenName]);
}
function getActionForMethodDeclaration(
@@ -167,7 +168,7 @@ namespace ts.codefix {
preferences: UserPreferences,
): CodeFixAction | undefined {
const changes = textChanges.ChangeTracker.with(context, t => addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs, preferences));
return createCodeFixAction(changes, [makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, token.text], fixId, Diagnostics.Add_all_missing_members);
return createCodeFixAction(fixName, changes, [makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, token.text], fixId, Diagnostics.Add_all_missing_members);
}
function addMethodDeclaration(
@@ -12,7 +12,7 @@ namespace ts.codefix {
const nodes = getNodes(sourceFile, span.start);
if (!nodes) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, nodes));
return [createCodeFixAction(changes, Diagnostics.Add_async_modifier_to_containing_function, fixId, Diagnostics.Add_all_missing_async_modifiers)];
return [createCodeFixAction(fixId, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId, Diagnostics.Add_all_missing_async_modifiers)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
@@ -8,7 +8,7 @@ namespace ts.codefix {
const { host, sourceFile, span: { start } } = context;
const packageName = getTypesPackageNameToInstall(host, sourceFile, start);
return packageName === undefined ? []
: [createCodeFixAction(/*changes*/ [], [Diagnostics.Install_0, packageName], fixId, Diagnostics.Install_all_missing_types_packages, getCommand(sourceFile.fileName, packageName))];
: [createCodeFixAction(fixId, /*changes*/ [], [Diagnostics.Install_0, packageName], fixId, Diagnostics.Install_all_missing_types_packages, getCommand(sourceFile.fileName, packageName))];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (_, diag, commands) => {
@@ -11,7 +11,7 @@ namespace ts.codefix {
const { program, sourceFile, span } = context;
const changes = textChanges.ChangeTracker.with(context, t =>
addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t, context.preferences));
return changes.length === 0 ? undefined : [createCodeFixAction(changes, Diagnostics.Implement_inherited_abstract_class, fixId, Diagnostics.Implement_all_inherited_abstract_classes)];
return changes.length === 0 ? undefined : [createCodeFixAction(fixId, changes, Diagnostics.Implement_inherited_abstract_class, fixId, Diagnostics.Implement_all_inherited_abstract_classes)];
},
fixIds: [fixId],
getAllCodeActions: context => {
@@ -11,7 +11,7 @@ namespace ts.codefix {
const checker = program.getTypeChecker();
return mapDefined<ExpressionWithTypeArguments, CodeFixAction>(getClassImplementsHeritageClauseElements(classDeclaration), implementedTypeNode => {
const changes = textChanges.ChangeTracker.with(context, t => addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences));
return changes.length === 0 ? undefined : createCodeFixAction(changes, [Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, Diagnostics.Implement_all_unimplemented_interfaces);
return changes.length === 0 ? undefined : createCodeFixAction(fixId, changes, [Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, Diagnostics.Implement_all_unimplemented_interfaces);
});
},
fixIds: [fixId],
@@ -10,7 +10,7 @@ namespace ts.codefix {
if (!nodes) return undefined;
const { constructor, superCall } = nodes;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, constructor, superCall));
return [createCodeFixAction(changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)];
return [createCodeFixAction(fixId, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)];
},
fixIds: [fixId],
getAllCodeActions(context) {
@@ -8,7 +8,7 @@ namespace ts.codefix {
const { sourceFile, span } = context;
const ctr = getNode(sourceFile, span.start);
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, ctr));
return [createCodeFixAction(changes, Diagnostics.Add_missing_super_call, fixId, Diagnostics.Add_all_missing_super_calls)];
return [createCodeFixAction(fixId, changes, Diagnostics.Add_missing_super_call, fixId, Diagnostics.Add_all_missing_super_calls)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) =>
@@ -10,7 +10,7 @@ namespace ts.codefix {
if (!nodes) return undefined;
const { extendsToken, heritageClauses } = nodes;
const changes = textChanges.ChangeTracker.with(context, t => doChanges(t, sourceFile, extendsToken, heritageClauses));
return [createCodeFixAction(changes, Diagnostics.Change_extends_to_implements, fixId, Diagnostics.Change_all_extended_interfaces_to_implements)];
return [createCodeFixAction(fixId, changes, Diagnostics.Change_extends_to_implements, fixId, Diagnostics.Change_all_extended_interfaces_to_implements)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
@@ -11,7 +11,7 @@ namespace ts.codefix {
return undefined;
}
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, token));
return [createCodeFixAction(changes, Diagnostics.Add_this_to_unresolved_variable, fixId, Diagnostics.Add_this_to_all_unresolved_variables_matching_a_member_name)];
return [createCodeFixAction(fixId, changes, Diagnostics.Add_this_to_unresolved_variable, fixId, Diagnostics.Add_this_to_all_unresolved_variables_matching_a_member_name)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
@@ -1,5 +1,7 @@
/* @internal */
namespace ts.codefix {
const fixName = "invalidImportSyntax";
registerCodeFix({
errorCodes: [Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime.code],
getCodeActions: getActionsForInvalidImport
@@ -43,7 +45,7 @@ namespace ts.codefix {
function createAction(context: CodeFixContext, sourceFile: SourceFile, node: Node, replacement: Node): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => t.replaceNode(sourceFile, node, replacement));
return createCodeFixActionNoFixId(changes, [Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]);
return createCodeFixActionNoFixId("invalidImportSyntax", changes, [Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]);
}
registerCodeFix({
@@ -72,7 +74,7 @@ namespace ts.codefix {
addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport));
}
const changes = textChanges.ChangeTracker.with(context, t => t.replaceNode(sourceFile, expr, createPropertyAccess(expr, "default"), {}));
fixes.push(createCodeFixActionNoFixId(changes, Diagnostics.Use_synthetic_default_member));
fixes.push(createCodeFixActionNoFixId(fixName, changes, Diagnostics.Use_synthetic_default_member));
return fixes;
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ namespace ts.codefix {
function fix(type: Type, fixId: string, fixAllDescription: DiagnosticMessage): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, typeNode, type, checker));
return createCodeFixAction(changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type)], fixId, fixAllDescription);
return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type)], fixId, fixAllDescription);
}
},
fixIds: [fixIdPlain, fixIdNullable],

Some files were not shown because too many files have changed in this diff Show More