Merge branch 'master' into limit-recursive-structured-type-resolution

This commit is contained in:
Nathan Shively-Sanders
2017-12-22 14:41:58 -08:00
722 changed files with 180766 additions and 84904 deletions
+6
View File
@@ -749,6 +749,10 @@ namespace ts {
return expr1.kind === SyntaxKind.TypeOfExpression && isNarrowableOperand((<TypeOfExpression>expr1).expression) && expr2.kind === SyntaxKind.StringLiteral;
}
function isNarrowableInOperands(left: Expression, right: Expression) {
return left.kind === SyntaxKind.StringLiteral && isNarrowingExpression(right);
}
function isNarrowingBinaryExpression(expr: BinaryExpression) {
switch (expr.operatorToken.kind) {
case SyntaxKind.EqualsToken:
@@ -761,6 +765,8 @@ namespace ts {
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
case SyntaxKind.InstanceOfKeyword:
return isNarrowableOperand(expr.left);
case SyntaxKind.InKeyword:
return isNarrowableInOperands(expr.left, expr.right);
case SyntaxKind.CommaToken:
return isNarrowingExpression(expr.right);
}
+3 -3
View File
@@ -468,9 +468,9 @@ namespace ts {
}
function getReferencedByPaths(referencedFilePath: Path) {
return mapDefinedIter(references.entries(), ([filePath, referencesInFile]) =>
return arrayFrom(mapDefinedIterator(references.entries(), ([filePath, referencesInFile]) =>
referencesInFile.has(referencedFilePath) ? filePath as Path : undefined
);
));
}
function getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile): ReadonlyArray<SourceFile> {
@@ -504,7 +504,7 @@ namespace ts {
}
// Return array of values that needs emit
return flatMapIter(seenFileNamesMap.values(), value => value);
return arrayFrom(mapDefinedIterator(seenFileNamesMap.values(), value => value));
}
}
}
+491 -288
View File
File diff suppressed because it is too large Load Diff
+6 -24
View File
@@ -82,12 +82,13 @@ namespace ts {
es2015: ScriptTarget.ES2015,
es2016: ScriptTarget.ES2016,
es2017: ScriptTarget.ES2017,
es2018: ScriptTarget.ES2018,
esnext: ScriptTarget.ESNext,
}),
paramType: Diagnostics.VERSION,
showInSimplifiedHelpView: true,
category: Diagnostics.Basic_Options,
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT,
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT,
},
{
name: "module",
@@ -120,6 +121,7 @@ namespace ts {
"es7": "lib.es2016.d.ts",
"es2016": "lib.es2016.d.ts",
"es2017": "lib.es2017.d.ts",
"es2018": "lib.es2018.d.ts",
"esnext": "lib.esnext.d.ts",
// Host only
"dom": "lib.dom.d.ts",
@@ -709,12 +711,11 @@ namespace ts {
export function convertEnableAutoDiscoveryToEnable(typeAcquisition: TypeAcquisition): TypeAcquisition {
// Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable
if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) {
const result: TypeAcquisition = {
return {
enable: typeAcquisition.enableAutoDiscovery,
include: typeAcquisition.include || [],
exclude: typeAcquisition.exclude || []
};
return result;
}
return typeAcquisition;
}
@@ -1797,9 +1798,8 @@ namespace ts {
return options;
}
function getDefaultTypeAcquisition(configFileName?: string) {
const options: TypeAcquisition = { enable: getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] };
return options;
function getDefaultTypeAcquisition(configFileName?: string): TypeAcquisition {
return { enable: getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] };
}
function convertTypeAcquisitionFromJsonWorker(jsonOptions: any,
@@ -1906,21 +1906,6 @@ namespace ts {
*/
const invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/;
/**
* Tests for a path with multiple recursive directory wildcards.
* Matches **\** and **\a\**, but not **\a**b.
*
* NOTE: used \ in place of / above to avoid issues with multiline comments.
*
* Breakdown:
* (^|\/) # matches either the beginning of the string or a directory separator.
* \*\*\/ # matches a recursive directory wildcard "**" followed by a directory separator.
* (.*\/)? # optionally matches any number of characters followed by a directory separator.
* \*\* # matches a recursive directory wildcard "**"
* ($|\/) # matches either the end of the string or a directory separator.
*/
const invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/;
/**
* Tests for a path where .. appears after a recursive directory wildcard.
* Matches **\..\*, **\a\..\*, and **\.., but not ..\**\*
@@ -2115,9 +2100,6 @@ namespace ts {
if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
return Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0;
}
else if (invalidMultipleRecursionPatterns.test(spec)) {
return Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0;
}
else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) {
return Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0;
}
+83 -39
View File
@@ -191,6 +191,19 @@ namespace ts {
return undefined;
}
export function firstDefinedIterator<T, U>(iter: Iterator<T>, callback: (element: T) => U | undefined): U | undefined {
while (true) {
const { value, done } = iter.next();
if (done) {
return undefined;
}
const result = callback(value);
if (result !== undefined) {
return result;
}
}
}
/**
* Iterates through the parent chain of a node and performs the callback on each parent until the callback
* returns a truthy value, then returns that value.
@@ -215,13 +228,27 @@ namespace ts {
export function zipWith<T, U, V>(arrayA: ReadonlyArray<T>, arrayB: ReadonlyArray<U>, callback: (a: T, b: U, index: number) => V): V[] {
const result: V[] = [];
Debug.assert(arrayA.length === arrayB.length);
Debug.assertEqual(arrayA.length, arrayB.length);
for (let i = 0; i < arrayA.length; i++) {
result.push(callback(arrayA[i], arrayB[i], i));
}
return result;
}
export function zipToIterator<T, U>(arrayA: ReadonlyArray<T>, arrayB: ReadonlyArray<U>): Iterator<[T, U]> {
Debug.assertEqual(arrayA.length, arrayB.length);
let i = 0;
return {
next() {
if (i === arrayA.length) {
return { value: undefined as never, done: true };
}
i++;
return { value: [arrayA[i - 1], arrayB[i - 1]], done: false };
}
};
}
export function zipToMap<T>(keys: ReadonlyArray<string>, values: ReadonlyArray<T>): Map<T> {
Debug.assert(keys.length === values.length);
const map = createMap<T>();
@@ -261,6 +288,8 @@ namespace ts {
return undefined;
}
export function findLast<T, U extends T>(array: ReadonlyArray<T>, predicate: (element: T, index: number) => element is U): U | undefined;
export function findLast<T>(array: ReadonlyArray<T>, predicate: (element: T, index: number) => boolean): T | undefined;
export function findLast<T>(array: ReadonlyArray<T>, predicate: (element: T, index: number) => boolean): T | undefined {
for (let i = array.length - 1; i >= 0; i--) {
const value = array[i];
@@ -474,22 +503,32 @@ namespace ts {
return result;
}
export function flatMapIter<T, U>(iter: Iterator<T>, mapfn: (x: T) => U | U[] | undefined): U[] {
const result: U[] = [];
while (true) {
const { value, done } = iter.next();
if (done) break;
const res = mapfn(value);
if (res) {
if (isArray(res)) {
result.push(...res);
}
else {
result.push(res);
}
}
export function flatMapIterator<T, U>(iter: Iterator<T>, mapfn: (x: T) => U[] | Iterator<U> | undefined): Iterator<U> {
const first = iter.next();
if (first.done) {
return emptyIterator;
}
let currentIter = getIterator(first.value);
return {
next() {
while (true) {
const currentRes = currentIter.next();
if (!currentRes.done) {
return currentRes;
}
const iterRes = iter.next();
if (iterRes.done) {
return iterRes;
}
currentIter = getIterator(iterRes.value);
}
},
};
function getIterator(x: T): Iterator<U> {
const res = mapfn(x);
return res === undefined ? emptyIterator : isArray(res) ? arrayIterator(res) : res;
}
return result;
}
/**
@@ -537,17 +576,34 @@ namespace ts {
return result;
}
export function mapDefinedIter<T, U>(iter: Iterator<T>, mapFn: (x: T) => U | undefined): U[] {
const result: U[] = [];
while (true) {
const { value, done } = iter.next();
if (done) break;
const res = mapFn(value);
if (res !== undefined) {
result.push(res);
export function mapDefinedIterator<T, U>(iter: Iterator<T>, mapFn: (x: T) => U | undefined): Iterator<U> {
return {
next() {
while (true) {
const res = iter.next();
if (res.done) {
return res;
}
const value = mapFn(res.value);
if (value !== undefined) {
return { value, done: false };
}
}
}
}
return result;
};
}
export const emptyIterator: Iterator<never> = { next: () => ({ value: undefined as never, done: true }) };
export function singleIterator<T>(value: T): Iterator<T> {
let done = false;
return {
next() {
const wasDone = done;
done = true;
return wasDone ? { value: undefined as never, done: true } : { value, done: false };
}
};
}
/**
@@ -1345,7 +1401,6 @@ namespace ts {
this.set(key, values = [value]);
}
return values;
}
function multiMapRemove<T>(this: MultiMap<T>, key: string, value: T) {
const values = this.get(key);
@@ -1360,7 +1415,7 @@ namespace ts {
/**
* Tests whether a value is an array.
*/
export function isArray(value: any): value is ReadonlyArray<any> {
export function isArray(value: any): value is ReadonlyArray<{}> {
return Array.isArray ? Array.isArray(value) : value instanceof Array;
}
@@ -1939,11 +1994,6 @@ namespace ts {
return /^\.\.?($|[\\/])/.test(path);
}
/** @deprecated Use `!isExternalModuleNameRelative(moduleName)` instead. */
export function moduleHasNonRelativeName(moduleName: string): boolean {
return !isExternalModuleNameRelative(moduleName);
}
export function getEmitScriptTarget(compilerOptions: CompilerOptions) {
return compilerOptions.target || ScriptTarget.ES3;
}
@@ -2326,7 +2376,6 @@ namespace ts {
function getSubPatternFromSpec(spec: string, basePath: string, usage: "files" | "directories" | "exclude", { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter }: WildcardMatcher): string | undefined {
let subpattern = "";
let hasRecursiveDirectoryWildcard = false;
let hasWrittenComponent = false;
const components = getNormalizedPathComponents(spec, basePath);
const lastComponent = lastOrUndefined(components);
@@ -2345,12 +2394,7 @@ namespace ts {
let optionalCount = 0;
for (let component of components) {
if (component === "**") {
if (hasRecursiveDirectoryWildcard) {
return undefined;
}
subpattern += doubleAsteriskRegexFragment;
hasRecursiveDirectoryWildcard = true;
}
else {
if (usage === "directories") {
+2 -2
View File
@@ -64,7 +64,7 @@ namespace ts {
let currentIdentifiers: Map<string>;
let isCurrentFileExternalModule: boolean;
let reportedDeclarationError = false;
let errorNameNode: DeclarationName;
let errorNameNode: DeclarationName | QualifiedName;
const emitJsDocComments = compilerOptions.removeComments ? noop : writeJsDocComments;
const emit = compilerOptions.stripInternal ? stripInternal : emitNode;
let needsDeclare = true;
@@ -1372,7 +1372,7 @@ namespace ts {
// if this is property of type literal,
// or is parameter of method/call/construct/index signature of type literal
// emit only if type is specified
if (node.type) {
if (hasType(node)) {
write(": ");
emitType(node.type);
}
+52 -40
View File
@@ -2272,6 +2272,14 @@
"category": "Error",
"code": 2718
},
"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.": {
"category": "Error",
"code": 2719
},
"Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?": {
"category": "Error",
"code": 2720
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
@@ -2619,10 +2627,6 @@
"category": "Error",
"code": 5010
},
"File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.": {
"category": "Error",
"code": 5011
},
"Cannot read file '{0}': {1}.": {
"category": "Error",
"code": 5012
@@ -2719,6 +2723,11 @@
"category": "Error",
"code": 5067
},
"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.": {
"category": "Error",
"code": 5068
},
"Concatenate and emit output to single file.": {
"category": "Message",
"code": 6001
@@ -2771,7 +2780,7 @@
"category": "Message",
"code": 6013
},
"Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.": {
"Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.": {
"category": "Message",
"code": 6015
},
@@ -2819,6 +2828,10 @@
"category": "Message",
"code": 6030
},
"Starting compilation in watch mode...": {
"category": "Message",
"code": 6031
},
"File change detected. Starting incremental compilation...": {
"category": "Message",
"code": 6032
@@ -3407,6 +3420,14 @@
"category": "Message",
"code": 6187
},
"Numeric separators are not allowed here.": {
"category": "Error",
"code": 6188
},
"Multiple consecutive numeric separators are not permitted.": {
"category": "Error",
"code": 6189
},
"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
"code": 7005
@@ -3710,7 +3731,7 @@
},
"JSX fragment is not supported when using --jsxFactory": {
"category": "Error",
"code":17016
"code": 17016
},
"Circularity detected while resolving configuration: {0}": {
@@ -3730,104 +3751,95 @@
"code": 18003
},
"Add missing 'super()' call.": {
"Add missing 'super()' call": {
"category": "Message",
"code": 90001
},
"Make 'super()' call the first statement in the constructor.": {
"Make 'super()' call the first statement in the constructor": {
"category": "Message",
"code": 90002
},
"Change 'extends' to 'implements'.": {
"Change 'extends' to 'implements'": {
"category": "Message",
"code": 90003
},
"Remove declaration for: '{0}'.": {
"Remove declaration for: '{0}'": {
"category": "Message",
"code": 90004
},
"Implement interface '{0}'.": {
"Implement interface '{0}'": {
"category": "Message",
"code": 90006
},
"Implement inherited abstract class.": {
"Implement inherited abstract class": {
"category": "Message",
"code": 90007
},
"Add 'this.' to unresolved variable.": {
"Add 'this.' to unresolved variable": {
"category": "Message",
"code": 90008
},
"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.": {
"category": "Error",
"code": 90009
},
"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.": {
"category": "Error",
"code": 90010
},
"Import '{0}' from module \"{1}\".": {
"Import '{0}' from module \"{1}\"": {
"category": "Message",
"code": 90013
},
"Change '{0}' to '{1}'.": {
"Change '{0}' to '{1}'": {
"category": "Message",
"code": 90014
},
"Add '{0}' to existing import declaration from \"{1}\".": {
"Add '{0}' to existing import declaration from \"{1}\"": {
"category": "Message",
"code": 90015
},
"Declare property '{0}'.": {
"Declare property '{0}'": {
"category": "Message",
"code": 90016
},
"Add index signature for property '{0}'.": {
"Add index signature for property '{0}'": {
"category": "Message",
"code": 90017
},
"Disable checking for this file.": {
"Disable checking for this file": {
"category": "Message",
"code": 90018
},
"Ignore this error message.": {
"Ignore this error message": {
"category": "Message",
"code": 90019
},
"Initialize property '{0}' in the constructor.": {
"Initialize property '{0}' in the constructor": {
"category": "Message",
"code": 90020
},
"Initialize static property '{0}'.": {
"Initialize static property '{0}'": {
"category": "Message",
"code": 90021
},
"Change spelling to '{0}'.": {
"Change spelling to '{0}'": {
"category": "Message",
"code": 90022
},
"Declare method '{0}'.": {
"Declare method '{0}'": {
"category": "Message",
"code": 90023
},
"Declare static method '{0}'.": {
"Declare static method '{0}'": {
"category": "Message",
"code": 90024
},
"Prefix '{0}' with an underscore.": {
"Prefix '{0}' with an underscore": {
"category": "Message",
"code": 90025
},
"Rewrite as the indexed access type '{0}'.": {
"Rewrite as the indexed access type '{0}'": {
"category": "Message",
"code": 90026
},
"Declare static property '{0}'.": {
"Declare static property '{0}'": {
"category": "Message",
"code": 90027
},
"Call decorator expression.": {
"Call decorator expression": {
"category": "Message",
"code": 90028
},
@@ -3871,11 +3883,11 @@
"category": "Message",
"code": 95010
},
"Infer type of '{0}' from usage.": {
"Infer type of '{0}' from usage": {
"category": "Message",
"code": 95011
},
"Infer parameter types from usage.": {
"Infer parameter types from usage": {
"category": "Message",
"code": 95012
},
+17 -10
View File
@@ -64,9 +64,9 @@ namespace ts {
return { fileName: resolved.path, packageId: resolved.packageId };
}
function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean, failedLookupLocations: string[]): ResolvedModuleWithFailedLookupLocations {
function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, originalPath: string | undefined, isExternalLibraryImport: boolean, failedLookupLocations: string[]): ResolvedModuleWithFailedLookupLocations {
return {
resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId },
resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId },
failedLookupLocations
};
}
@@ -732,12 +732,12 @@ namespace ts {
const result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript));
if (result && result.value) {
const { resolved, isExternalLibraryImport } = result.value;
return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations);
const { resolved, originalPath, isExternalLibraryImport } = result.value;
return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations);
}
return { resolvedModule: undefined, failedLookupLocations };
function tryResolve(extensions: Extensions): SearchResult<{ resolved: Resolved, isExternalLibraryImport: boolean }> {
function tryResolve(extensions: Extensions): SearchResult<{ resolved: Resolved, originalPath?: string, isExternalLibraryImport: boolean }> {
const loader: ResolutionKindSpecificLoader = (extensions, candidate, failedLookupLocations, onlyRecordFailures, state) => nodeLoadModuleByRelativeName(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, /*considerPackageJson*/ true);
const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, failedLookupLocations, state);
if (resolved) {
@@ -752,11 +752,17 @@ namespace ts {
if (!resolved) return undefined;
let resolvedValue = resolved.value;
if (!compilerOptions.preserveSymlinks) {
resolvedValue = resolvedValue && { ...resolved.value, path: realPath(resolved.value.path, host, traceEnabled), extension: resolved.value.extension };
let originalPath: string | undefined;
if (!compilerOptions.preserveSymlinks && resolvedValue) {
originalPath = resolvedValue.path;
const path = realPath(resolved.value.path, host, traceEnabled);
if (path === originalPath) {
originalPath = undefined;
}
resolvedValue = { ...resolvedValue, path };
}
// For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files.
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
return { value: resolvedValue && { resolved: resolvedValue, originalPath, isExternalLibraryImport: true } };
}
else {
const { path: candidate, parts } = normalizePathAndParts(combinePaths(containingDirectory, moduleName));
@@ -1115,7 +1121,8 @@ namespace ts {
const containingDirectory = getDirectoryPath(containingFile);
const resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript);
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations);
// No originalPath because classic resolution doesn't resolve realPath
return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*originalPath*/ undefined, /*isExternalLibraryImport*/ false, failedLookupLocations);
function tryResolve(extensions: Extensions): SearchResult<Resolved> {
const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state);
@@ -1162,7 +1169,7 @@ namespace ts {
const state: ModuleResolutionState = { compilerOptions, host, traceEnabled };
const failedLookupLocations: string[] = [];
const resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state);
return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations);
return createResolvedModuleWithFailedLookupLocations(resolved, /*originalPath*/ undefined, /*isExternalLibraryImport*/ true, failedLookupLocations);
}
/**
+36 -7
View File
@@ -88,20 +88,48 @@ namespace ts {
case SyntaxKind.SpreadAssignment:
return visitNode(cbNode, (<SpreadAssignment>node).expression);
case SyntaxKind.Parameter:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, (<ParameterDeclaration>node).dotDotDotToken) ||
visitNode(cbNode, (<ParameterDeclaration>node).name) ||
visitNode(cbNode, (<ParameterDeclaration>node).questionToken) ||
visitNode(cbNode, (<ParameterDeclaration>node).type) ||
visitNode(cbNode, (<ParameterDeclaration>node).initializer);
case SyntaxKind.PropertyDeclaration:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, (<PropertyDeclaration>node).name) ||
visitNode(cbNode, (<PropertyDeclaration>node).questionToken) ||
visitNode(cbNode, (<PropertyDeclaration>node).exclamationToken) ||
visitNode(cbNode, (<PropertyDeclaration>node).type) ||
visitNode(cbNode, (<PropertyDeclaration>node).initializer);
case SyntaxKind.PropertySignature:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, (<PropertySignature>node).name) ||
visitNode(cbNode, (<PropertySignature>node).questionToken) ||
visitNode(cbNode, (<PropertySignature>node).type) ||
visitNode(cbNode, (<PropertySignature>node).initializer);
case SyntaxKind.PropertyAssignment:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, (<PropertyAssignment>node).name) ||
visitNode(cbNode, (<PropertyAssignment>node).questionToken) ||
visitNode(cbNode, (<PropertyAssignment>node).initializer);
case SyntaxKind.VariableDeclaration:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, (<VariableDeclaration>node).name) ||
visitNode(cbNode, (<VariableDeclaration>node).exclamationToken) ||
visitNode(cbNode, (<VariableDeclaration>node).type) ||
visitNode(cbNode, (<VariableDeclaration>node).initializer);
case SyntaxKind.BindingElement:
return visitNodes(cbNode, cbNodes, node.decorators) ||
visitNodes(cbNode, cbNodes, node.modifiers) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).propertyName) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).dotDotDotToken) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).name) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).questionToken) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).exclamationToken) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).type) ||
visitNode(cbNode, (<VariableLikeDeclaration>node).initializer);
visitNode(cbNode, (<BindingElement>node).propertyName) ||
visitNode(cbNode, (<BindingElement>node).dotDotDotToken) ||
visitNode(cbNode, (<BindingElement>node).name) ||
visitNode(cbNode, (<BindingElement>node).initializer);
case SyntaxKind.FunctionType:
case SyntaxKind.ConstructorType:
case SyntaxKind.CallSignature:
@@ -5462,6 +5490,7 @@ namespace ts {
switch (token()) {
case SyntaxKind.OpenParenToken: // Method declaration
case SyntaxKind.LessThanToken: // Generic Method declaration
case SyntaxKind.ExclamationToken: // Non-null assertion on property name
case SyntaxKind.ColonToken: // Type Annotation for declaration
case SyntaxKind.EqualsToken: // Initializer for declaration
case SyntaxKind.QuestionToken: // Not valid, but permitted so that it gets caught later on.
+37 -22
View File
@@ -241,22 +241,28 @@ namespace ts {
return errorMessage;
}
const redForegroundEscapeSequence = "\u001b[91m";
const yellowForegroundEscapeSequence = "\u001b[93m";
const blueForegroundEscapeSequence = "\u001b[93m";
/** @internal */
export enum ForegroundColorEscapeSequences {
Grey = "\u001b[90m",
Red = "\u001b[91m",
Yellow = "\u001b[93m",
Blue = "\u001b[94m",
Cyan = "\u001b[96m"
}
const gutterStyleSequence = "\u001b[30;47m";
const gutterSeparator = " ";
const resetEscapeSequence = "\u001b[0m";
const ellipsis = "...";
function getCategoryFormat(category: DiagnosticCategory): string {
switch (category) {
case DiagnosticCategory.Warning: return yellowForegroundEscapeSequence;
case DiagnosticCategory.Error: return redForegroundEscapeSequence;
case DiagnosticCategory.Message: return blueForegroundEscapeSequence;
case DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow;
case DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
case DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue;
}
}
function formatAndReset(text: string, formatStyle: string) {
/** @internal */
export function formatColorAndReset(text: string, formatStyle: string) {
return formatStyle + text + resetEscapeSequence;
}
@@ -289,7 +295,7 @@ namespace ts {
// If the error spans over 5 lines, we'll only show the first 2 and last 2 lines,
// so we'll skip ahead to the second-to-last line.
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
context += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
i = lastLine - 1;
}
@@ -300,12 +306,12 @@ namespace ts {
lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces
// Output the gutter and the actual contents of the line.
context += formatAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += lineContent + host.getNewLine();
// Output the gutter and the error span for the line using tildes.
context += formatAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += redForegroundEscapeSequence;
context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
context += ForegroundColorEscapeSequences.Red;
if (i === firstLine) {
// If we're on the last line, then limit it to the last character of the last line.
// Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position.
@@ -324,13 +330,19 @@ namespace ts {
context += resetEscapeSequence;
}
output += host.getNewLine();
output += `${ relativeFileName }(${ firstLine + 1 },${ firstLineChar + 1 }): `;
output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += "(";
output += formatColorAndReset(`${ firstLine + 1 }`, ForegroundColorEscapeSequences.Yellow);
output += ",";
output += formatColorAndReset(`${ firstLineChar + 1 }`, ForegroundColorEscapeSequences.Yellow);
output += "): ";
}
const categoryColor = getCategoryFormat(diagnostic.category);
const category = DiagnosticCategory[diagnostic.category].toLowerCase();
output += `${ formatAndReset(category, categoryColor) } TS${ diagnostic.code }: ${ flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) }`;
output += formatColorAndReset(category, categoryColor);
output += formatColorAndReset(` TS${ diagnostic.code }: `, ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -339,7 +351,7 @@ namespace ts {
output += host.getNewLine();
}
return output;
return output + host.getNewLine();
}
export function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string {
@@ -704,7 +716,7 @@ namespace ts {
interface OldProgramState {
program: Program | undefined;
file: SourceFile;
oldSourceFile: SourceFile | undefined;
/** The collection of paths modified *since* the old program. */
modifiedFilePaths: Path[];
}
@@ -754,7 +766,6 @@ namespace ts {
/** A transient placeholder used to mark predicted resolution in the result list. */
const predictedToResolveToAmbientModuleMarker: ResolvedModuleFull = <any>{};
for (let i = 0; i < moduleNames.length; i++) {
const moduleName = moduleNames[i];
// If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
@@ -825,9 +836,13 @@ namespace ts {
// If we change our policy of rechecking failed lookups on each program create,
// we should adjust the value returned here.
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName: string, oldProgramState: OldProgramState): boolean {
const resolutionToFile = getResolvedModule(oldProgramState.file, moduleName);
if (resolutionToFile) {
// module used to be resolved to file - ignore it
const resolutionToFile = getResolvedModule(oldProgramState.oldSourceFile, moduleName);
const resolvedFile = resolutionToFile && oldProgramState.program && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName);
if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) {
// In the old program, we resolved to an ambient module that was in the same
// place as we expected to find an actual module file.
// We actually need to return 'false' here even though this seems like a 'true' case
// because the normal module resolution algorithm will find this anyway.
return false;
}
const ambientModule = oldProgramState.program && oldProgramState.program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName);
@@ -1001,7 +1016,7 @@ namespace ts {
const newSourceFilePath = getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory);
if (resolveModuleNamesWorker) {
const moduleNames = getModuleNames(newSourceFile);
const oldProgramState = { program: oldProgram, file: oldSourceFile, modifiedFilePaths };
const oldProgramState: OldProgramState = { program: oldProgram, oldSourceFile, modifiedFilePaths };
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState);
// ensure that module resolution results are still correct
const resolutionsChanged = hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo);
@@ -1945,7 +1960,7 @@ namespace ts {
if (file.imports.length || file.moduleAugmentations.length) {
// Because global augmentation doesn't have string literal name, we can check for global augmentation as such.
const moduleNames = getModuleNames(file);
const oldProgramState = { program: oldProgram, file, modifiedFilePaths };
const oldProgramState: OldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths };
const resolutions = resolveModuleNamesReusingOldState(moduleNames, getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState);
Debug.assert(resolutions.length === moduleNames.length);
for (let i = 0; i < moduleNames.length; i++) {
+126 -21
View File
@@ -561,9 +561,9 @@ namespace ts {
return false;
}
function scanConflictMarkerTrivia(text: string, pos: number, error?: ErrorCallback) {
function scanConflictMarkerTrivia(text: string, pos: number, error?: (diag: DiagnosticMessage, pos?: number, len?: number) => void) {
if (error) {
error(Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength);
error(Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength);
}
const ch = text.charCodeAt(pos);
@@ -852,34 +852,92 @@ namespace ts {
scanRange,
};
function error(message: DiagnosticMessage, length?: number): void {
function error(message: DiagnosticMessage): void;
function error(message: DiagnosticMessage, errPos: number, length: number): void;
function error(message: DiagnosticMessage, errPos: number = pos, length?: number): void {
if (onError) {
const oldPos = pos;
pos = errPos;
onError(message, length || 0);
pos = oldPos;
}
}
function scanNumberFragment(): string {
let start = pos;
let allowSeparator = false;
let isPreviousTokenSeparator = false;
let result = "";
while (true) {
const ch = text.charCodeAt(pos);
if (ch === CharacterCodes._) {
tokenFlags |= TokenFlags.ContainsSeparator;
if (allowSeparator) {
allowSeparator = false;
isPreviousTokenSeparator = true;
result += text.substring(start, pos);
}
else if (isPreviousTokenSeparator) {
error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);
}
else {
error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);
}
pos++;
start = pos;
continue;
}
if (isDigit(ch)) {
allowSeparator = true;
isPreviousTokenSeparator = false;
pos++;
continue;
}
break;
}
if (text.charCodeAt(pos - 1) === CharacterCodes._) {
error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
}
return result + text.substring(start, pos);
}
function scanNumber(): string {
const start = pos;
while (isDigit(text.charCodeAt(pos))) pos++;
const mainFragment = scanNumberFragment();
let decimalFragment: string;
let scientificFragment: string;
if (text.charCodeAt(pos) === CharacterCodes.dot) {
pos++;
while (isDigit(text.charCodeAt(pos))) pos++;
decimalFragment = scanNumberFragment();
}
let end = pos;
if (text.charCodeAt(pos) === CharacterCodes.E || text.charCodeAt(pos) === CharacterCodes.e) {
pos++;
tokenFlags |= TokenFlags.Scientific;
if (text.charCodeAt(pos) === CharacterCodes.plus || text.charCodeAt(pos) === CharacterCodes.minus) pos++;
if (isDigit(text.charCodeAt(pos))) {
pos++;
while (isDigit(text.charCodeAt(pos))) pos++;
end = pos;
}
else {
const preNumericPart = pos;
const finalFragment = scanNumberFragment();
if (!finalFragment) {
error(Diagnostics.Digit_expected);
}
else {
scientificFragment = text.substring(end, preNumericPart) + finalFragment;
end = pos;
}
}
if (tokenFlags & TokenFlags.ContainsSeparator) {
let result = mainFragment;
if (decimalFragment) {
result += "." + decimalFragment;
}
if (scientificFragment) {
result += scientificFragment;
}
return "" + +result;
}
else {
return "" + +(text.substring(start, end)); // No need to use all the fragments; no _ removal needed
}
return "" + +(text.substring(start, end));
}
function scanOctalDigits(): number {
@@ -894,23 +952,41 @@ namespace ts {
* Scans the given number of hexadecimal digits in the text,
* returning -1 if the given number is unavailable.
*/
function scanExactNumberOfHexDigits(count: number): number {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false);
function scanExactNumberOfHexDigits(count: number, canHaveSeparators: boolean): number {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators);
}
/**
* Scans as many hexadecimal digits as are available in the text,
* returning -1 if the given number of digits was unavailable.
*/
function scanMinimumNumberOfHexDigits(count: number): number {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true);
function scanMinimumNumberOfHexDigits(count: number, canHaveSeparators: boolean): number {
return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true, canHaveSeparators);
}
function scanHexDigits(minCount: number, scanAsManyAsPossible: boolean): number {
function scanHexDigits(minCount: number, scanAsManyAsPossible: boolean, canHaveSeparators: boolean): number {
let digits = 0;
let value = 0;
let allowSeparator = false;
let isPreviousTokenSeparator = false;
while (digits < minCount || scanAsManyAsPossible) {
const ch = text.charCodeAt(pos);
if (canHaveSeparators && ch === CharacterCodes._) {
tokenFlags |= TokenFlags.ContainsSeparator;
if (allowSeparator) {
allowSeparator = false;
isPreviousTokenSeparator = true;
}
else if (isPreviousTokenSeparator) {
error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);
}
else {
error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);
}
pos++;
continue;
}
allowSeparator = canHaveSeparators;
if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) {
value = value * 16 + ch - CharacterCodes._0;
}
@@ -925,10 +1001,14 @@ namespace ts {
}
pos++;
digits++;
isPreviousTokenSeparator = false;
}
if (digits < minCount) {
value = -1;
}
if (text.charCodeAt(pos - 1) === CharacterCodes._) {
error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
}
return value;
}
@@ -1097,7 +1177,7 @@ namespace ts {
}
function scanHexadecimalEscape(numDigits: number): string {
const escapedValue = scanExactNumberOfHexDigits(numDigits);
const escapedValue = scanExactNumberOfHexDigits(numDigits, /*canHaveSeparators*/ false);
if (escapedValue >= 0) {
return String.fromCharCode(escapedValue);
@@ -1109,7 +1189,7 @@ namespace ts {
}
function scanExtendedUnicodeEscape(): string {
const escapedValue = scanMinimumNumberOfHexDigits(1);
const escapedValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false);
let isInvalidExtendedEscape = false;
// Validate the value of the digit
@@ -1162,7 +1242,7 @@ namespace ts {
if (pos + 5 < end && text.charCodeAt(pos + 1) === CharacterCodes.u) {
const start = pos;
pos += 2;
const value = scanExactNumberOfHexDigits(4);
const value = scanExactNumberOfHexDigits(4, /*canHaveSeparators*/ false);
pos = start;
return value;
}
@@ -1218,8 +1298,27 @@ namespace ts {
// For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b.
// Similarly valid octalIntegerLiteral must have at least one octal digit following o or O.
let numberOfDigits = 0;
let separatorAllowed = false;
let isPreviousTokenSeparator = false;
while (true) {
const ch = text.charCodeAt(pos);
// Numeric seperators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator
if (ch === CharacterCodes._) {
tokenFlags |= TokenFlags.ContainsSeparator;
if (separatorAllowed) {
separatorAllowed = false;
isPreviousTokenSeparator = true;
}
else if (isPreviousTokenSeparator) {
error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1);
}
else {
error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1);
}
pos++;
continue;
}
separatorAllowed = true;
const valueOfCh = ch - CharacterCodes._0;
if (!isDigit(ch) || valueOfCh >= base) {
break;
@@ -1227,11 +1326,17 @@ namespace ts {
value = value * base + valueOfCh;
pos++;
numberOfDigits++;
isPreviousTokenSeparator = false;
}
// Invalid binaryIntegerLiteral or octalIntegerLiteral
if (numberOfDigits === 0) {
return -1;
}
if (text.charCodeAt(pos - 1) === CharacterCodes._) {
// Literal ends with underscore - not allowed
error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1);
return value;
}
return value;
}
@@ -1435,7 +1540,7 @@ namespace ts {
case CharacterCodes._0:
if (pos + 2 < end && (text.charCodeAt(pos + 1) === CharacterCodes.X || text.charCodeAt(pos + 1) === CharacterCodes.x)) {
pos += 2;
let value = scanMinimumNumberOfHexDigits(1);
let value = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true);
if (value < 0) {
error(Diagnostics.Hexadecimal_digit_expected);
value = 0;
+4 -2
View File
@@ -2,6 +2,7 @@
namespace ts {
export function createGetSymbolWalker(
getRestTypeOfSignature: (sig: Signature) => Type,
getTypePredicateOfSignature: (sig: Signature) => TypePredicate | undefined,
getReturnTypeOfSignature: (sig: Signature) => Type,
getBaseTypes: (type: Type) => Type[],
resolveStructuredTypeMembers: (type: ObjectType) => ResolvedType,
@@ -117,8 +118,9 @@ namespace ts {
}
function visitSignature(signature: Signature): void {
if (signature.typePredicate) {
visitType(signature.typePredicate.type);
const typePredicate = getTypePredicateOfSignature(signature);
if (typePredicate) {
visitType(typePredicate.type);
}
forEach(signature.typeParameters, visitType);
+4
View File
@@ -72,6 +72,7 @@ namespace ts {
/*@internal*/ debugMode?: boolean;
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
clearTimeout?(timeoutId: any): void;
clearScreen?(): void;
}
export interface FileWatcher {
@@ -436,6 +437,9 @@ namespace ts {
}
const nodeSystem: System = {
clearScreen: () => {
process.stdout.write("\x1Bc");
},
args: process.argv.slice(2),
newLine: _os.EOL,
useCaseSensitiveFileNames,
+1 -1
View File
@@ -2553,7 +2553,7 @@ namespace ts {
}
/**
* Visits an ObjectLiteralExpression with computed propety names.
* Visits an ObjectLiteralExpression with computed property names.
*
* @param node An ObjectLiteralExpression node.
*/
+92 -33
View File
@@ -584,6 +584,40 @@ namespace ts {
| JSDocFunctionType
| EndOfFileToken;
export type HasType =
| SignatureDeclaration
| VariableDeclaration
| ParameterDeclaration
| PropertySignature
| PropertyDeclaration
| TypePredicateNode
| ParenthesizedTypeNode
| TypeOperatorNode
| MappedTypeNode
| AssertionExpression
| TypeAliasDeclaration
| JSDocTypeExpression
| JSDocNonNullableType
| JSDocNullableType
| JSDocOptionalType
| JSDocVariadicType;
export type HasInitializer =
| HasExpressionInitializer
| ForStatement
| ForInStatement
| ForOfStatement
| JsxAttribute;
export type HasExpressionInitializer =
| VariableDeclaration
| ParameterDeclaration
| BindingElement
| PropertySignature
| PropertyDeclaration
| PropertyAssignment
| EnumMember;
/* @internal */
export type MutableNodeArray<T extends Node> = NodeArray<T> & T[];
@@ -793,6 +827,9 @@ namespace ts {
initializer?: Expression; // Optional initializer
}
/*@internal*/
export type BindingElementGrandparent = BindingElement["parent"]["parent"];
export interface PropertySignature extends TypeElement, JSDocContainer {
kind: SyntaxKind.PropertySignature;
name: PropertyName; // Declared property name
@@ -848,25 +885,18 @@ namespace ts {
expression: Expression;
}
// SyntaxKind.VariableDeclaration
// SyntaxKind.Parameter
// SyntaxKind.BindingElement
// SyntaxKind.Property
// SyntaxKind.PropertyAssignment
// SyntaxKind.JsxAttribute
// SyntaxKind.ShorthandPropertyAssignment
// SyntaxKind.EnumMember
// SyntaxKind.JSDocPropertyTag
// SyntaxKind.JSDocParameterTag
export interface VariableLikeDeclaration extends NamedDeclaration {
propertyName?: PropertyName;
dotDotDotToken?: DotDotDotToken;
name: DeclarationName;
questionToken?: QuestionToken;
exclamationToken?: ExclamationToken;
type?: TypeNode;
initializer?: Expression;
}
export type VariableLikeDeclaration =
| VariableDeclaration
| ParameterDeclaration
| BindingElement
| PropertyDeclaration
| PropertyAssignment
| PropertySignature
| JsxAttribute
| ShorthandPropertyAssignment
| EnumMember
| JSDocPropertyTag
| JSDocParameterTag;
export interface PropertyLikeDeclaration extends NamedDeclaration {
name: PropertyName;
@@ -949,7 +979,7 @@ namespace ts {
export interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer {
kind: SyntaxKind.Constructor;
parent?: ClassDeclaration | ClassExpression;
parent?: ClassLikeDeclaration;
body?: FunctionBody;
/* @internal */ returnFlowNode?: FlowNode;
}
@@ -957,14 +987,14 @@ namespace ts {
/** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */
export interface SemicolonClassElement extends ClassElement {
kind: SyntaxKind.SemicolonClassElement;
parent?: ClassDeclaration | ClassExpression;
parent?: ClassLikeDeclaration;
}
// See the comment on MethodDeclaration for the intuition behind GetAccessorDeclaration being a
// ClassElement and an ObjectLiteralElement.
export interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.GetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
parent?: ClassLikeDeclaration | ObjectLiteralExpression;
name: PropertyName;
body?: FunctionBody;
}
@@ -973,7 +1003,7 @@ namespace ts {
// ClassElement and an ObjectLiteralElement.
export interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer {
kind: SyntaxKind.SetAccessor;
parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression;
parent?: ClassLikeDeclaration | ObjectLiteralExpression;
name: PropertyName;
body?: FunctionBody;
}
@@ -982,7 +1012,7 @@ namespace ts {
export interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement {
kind: SyntaxKind.IndexSignature;
parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode;
parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode;
}
export interface TypeNode extends Node {
@@ -1490,8 +1520,9 @@ namespace ts {
HexSpecifier = 1 << 6, // e.g. `0x00000000`
BinarySpecifier = 1 << 7, // e.g. `0b0110010000000000`
OctalSpecifier = 1 << 8, // e.g. `0o777`
ContainsSeparator = 1 << 9, // e.g. `0b1100_0101`
BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier,
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinarySpecifier | OctalSpecifier
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinarySpecifier | OctalSpecifier | ContainsSeparator
}
export interface NumericLiteral extends LiteralExpression {
@@ -1986,7 +2017,7 @@ namespace ts {
export interface HeritageClause extends Node {
kind: SyntaxKind.HeritageClause;
parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression;
parent?: InterfaceDeclaration | ClassLikeDeclaration;
token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword;
types: NodeArray<ExpressionWithTypeArguments>;
}
@@ -2478,7 +2509,7 @@ namespace ts {
// Stores a mapping 'external module reference text' -> 'resolved file name' | undefined
// It is used to resolve module names in the checker.
// Content of this field should never be used directly - use getResolvedModuleFileName/setResolvedModuleFileName functions instead
/* @internal */ resolvedModules: Map<ResolvedModuleFull>;
/* @internal */ resolvedModules: Map<ResolvedModuleFull | undefined>;
/* @internal */ resolvedTypeReferenceDirectiveNames: Map<ResolvedTypeReferenceDirective>;
/* @internal */ imports: ReadonlyArray<StringLiteral>;
// Identifier only if `declare global`
@@ -2738,6 +2769,8 @@ namespace ts {
getAugmentedPropertiesOfType(type: Type): Symbol[];
getRootSymbols(symbol: Symbol): Symbol[];
getContextualType(node: Expression): Type | undefined;
/* @internal */ isContextSensitive(node: Expression | MethodDeclaration | ObjectLiteralElementLike | JsxAttributeLike): boolean;
/**
* returns unknownSignature in the case of an error.
* @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`.
@@ -2752,6 +2785,8 @@ namespace ts {
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined;
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
/** Exclude accesses to private properties or methods with a `this` parameter that `type` doesn't satisfy. */
/* @internal */ isValidPropertyAccessForCompletions(node: PropertyAccessExpression, type: Type, property: Symbol): boolean;
/** Follow all aliases to get the original symbol. */
getAliasedSymbol(symbol: Symbol): Symbol;
/** Follow a *single* alias to get the immediately aliased symbol. */
@@ -2786,12 +2821,22 @@ namespace ts {
/* @internal */ getNullType(): Type;
/* @internal */ getESSymbolType(): Type;
/* @internal */ getNeverType(): Type;
/* @internal */ getUnionType(types: Type[], subtypeReduction?: boolean): Type;
/* @internal */ getUnionType(types: Type[], subtypeReduction?: UnionReduction): Type;
/* @internal */ createArrayType(elementType: Type): Type;
/* @internal */ createPromiseType(type: Type): Type;
/* @internal */ createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo, numberIndexInfo: IndexInfo): Type;
/* @internal */ createSignature(declaration: SignatureDeclaration, typeParameters: TypeParameter[], thisParameter: Symbol | undefined, parameters: Symbol[], resolvedReturnType: Type, typePredicate: TypePredicate, minArgumentCount: number, hasRestParameter: boolean, hasLiteralTypes: boolean): Signature;
/* @internal */ createSignature(
declaration: SignatureDeclaration,
typeParameters: TypeParameter[],
thisParameter: Symbol | undefined,
parameters: Symbol[],
resolvedReturnType: Type,
typePredicate: TypePredicate | undefined,
minArgumentCount: number,
hasRestParameter: boolean,
hasLiteralTypes: boolean,
): Signature;
/* @internal */ createSymbol(flags: SymbolFlags, name: __String): TransientSymbol;
/* @internal */ createIndexInfo(type: Type, isReadonly: boolean, declaration?: SignatureDeclaration): IndexInfo;
/* @internal */ isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult;
@@ -2831,6 +2876,13 @@ namespace ts {
/* @internal */ getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] | undefined;
}
/* @internal */
export const enum UnionReduction {
None = 0,
Literal,
Subtype
}
export enum NodeBuilderFlags {
None = 0,
// Options
@@ -3638,7 +3690,13 @@ namespace ts {
/* @internal */
thisParameter?: Symbol; // symbol of this-type parameter
/* @internal */
resolvedReturnType: Type; // Resolved return type
// See comment in `instantiateSignature` for why these are set lazily.
resolvedReturnType: Type | undefined; // Lazily set by `getReturnTypeOfSignature`.
/* @internal */
// Lazily set by `getTypePredicateOfSignature`.
// `undefined` indicates a type predicate that has not yet been computed.
// Uses a special `noTypePredicate` sentinel value to indicate that there is no type predicate. This looks like a TypePredicate at runtime to avoid polymorphism.
resolvedTypePredicate: TypePredicate | undefined;
/* @internal */
minArgumentCount: number; // Number of non-optional parameters
/* @internal */
@@ -3658,8 +3716,6 @@ namespace ts {
/* @internal */
isolatedSignatureType?: ObjectType; // A manufactured type that just contains the signature for purposes of signature comparison
/* @internal */
typePredicate?: TypePredicate;
/* @internal */
instantiations?: Map<Signature>; // Generic signature instantiation cache
}
@@ -3961,7 +4017,8 @@ namespace ts {
ES2015 = 2,
ES2016 = 3,
ES2017 = 4,
ESNext = 5,
ES2018 = 5,
ESNext = 6,
Latest = ESNext,
}
@@ -4228,6 +4285,8 @@ namespace ts {
* If changing this, remember to change `moduleResolutionIsEqualTo`.
*/
export interface ResolvedModuleFull extends ResolvedModule {
/* @internal */
readonly originalPath?: string;
/**
* Extension of resolvedFileName. This must match what's at the end of resolvedFileName.
* This is optional for backwards-compatibility, but will be added if not provided.
+43 -7
View File
@@ -3,6 +3,7 @@
/* @internal */
namespace ts {
export const emptyArray: never[] = [] as never[];
export const resolvingEmptyArray: never[] = [] as never[];
export const emptyMap: ReadonlyMap<never> = createMap<never>();
export const externalHelpersModuleNameText = "tslib";
@@ -101,6 +102,7 @@ namespace ts {
return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport &&
oldResolution.extension === newResolution.extension &&
oldResolution.resolvedFileName === newResolution.resolvedFileName &&
oldResolution.originalPath === newResolution.originalPath &&
packageIdIsEqual(oldResolution.packageId, newResolution.packageId);
}
@@ -345,7 +347,7 @@ namespace ts {
export function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile) {
// If we don't need to downlevel and we can reach the original source text using
// the node's parent reference, then simply get the text as it was originally written.
if (!nodeIsSynthesized(node) && node.parent) {
if (!nodeIsSynthesized(node) && node.parent && !(isNumericLiteral(node) && node.numericLiteralFlags & TokenFlags.ContainsSeparator)) {
return getSourceTextOfNodeFromSourceFile(sourceFile, node);
}
@@ -547,7 +549,7 @@ namespace ts {
// Return display name of an identifier
// Computed property names will just be emitted as "[<expr>]", where <expr> is the source
// text of the expression in the computed property.
export function declarationNameToString(name: DeclarationName) {
export function declarationNameToString(name: DeclarationName | QualifiedName) {
return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name);
}
@@ -783,7 +785,7 @@ namespace ts {
case SyntaxKind.PropertySignature:
case SyntaxKind.Parameter:
case SyntaxKind.VariableDeclaration:
return node === (<VariableLikeDeclaration>parent).type;
return node === (parent as HasType).type;
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction:
@@ -1339,7 +1341,7 @@ namespace ts {
case SyntaxKind.EnumMember:
case SyntaxKind.PropertyAssignment:
case SyntaxKind.BindingElement:
return (<VariableLikeDeclaration>parent).initializer === node;
return (parent as HasInitializer).initializer === node;
case SyntaxKind.ExpressionStatement:
case SyntaxKind.IfStatement:
case SyntaxKind.DoStatement:
@@ -1649,7 +1651,7 @@ namespace ts {
result = addRange(result, getJSDocParameterTags(node as ParameterDeclaration));
}
if (isVariableLike(node) && node.initializer && hasJSDocNodes(node.initializer)) {
if (isVariableLike(node) && hasInitializer(node) && hasJSDocNodes(node.initializer)) {
result = addRange(result, node.initializer.jsDoc);
}
@@ -2815,8 +2817,8 @@ namespace ts {
* Gets the effective type annotation of a variable, parameter, or property. If the node was
* parsed in a JavaScript file, gets the type annotation from JSDoc.
*/
export function getEffectiveTypeAnnotationNode(node: VariableLikeDeclaration, checkJSDoc?: boolean): TypeNode | undefined {
if (node.type) {
export function getEffectiveTypeAnnotationNode(node: Node, checkJSDoc?: boolean): TypeNode | undefined {
if (hasType(node)) {
return node.type;
}
if (checkJSDoc || isInJavaScriptFile(node)) {
@@ -3696,6 +3698,10 @@ namespace ts {
export function typeHasCallOrConstructSignatures(type: Type, checker: TypeChecker) {
return checker.getSignaturesOfType(type, SignatureKind.Call).length !== 0 || checker.getSignaturesOfType(type, SignatureKind.Construct).length !== 0;
}
export function forSomeAncestorDirectory(directory: string, callback: (directory: string) => boolean): boolean {
return !!forEachAncestorDirectory(directory, d => callback(d) ? true : undefined);
}
}
namespace ts {
@@ -5228,6 +5234,18 @@ namespace ts {
return node && (node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor);
}
/* @internal */
export function isMethodOrAccessor(node: Node): node is MethodDeclaration | AccessorDeclaration {
switch (node.kind) {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
return true;
default:
return false;
}
}
// Type members
export function isTypeElement(node: Node): node is TypeElement {
@@ -5807,4 +5825,22 @@ namespace ts {
export function hasJSDocNodes(node: Node): node is HasJSDoc {
return !!(node as JSDocContainer).jsDoc && (node as JSDocContainer).jsDoc.length > 0;
}
/** True if has type node attached to it. */
/* @internal */
export function hasType(node: Node): node is HasType {
return !!(node as HasType).type;
}
/** True if has initializer node attached to it. */
/* @internal */
export function hasInitializer(node: Node): node is HasInitializer {
return !!(node as HasInitializer).initializer;
}
/** True if has initializer node attached to it. */
/* @internal */
export function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer {
return hasInitializer(node) && !isForStatement(node) && !isForInStatement(node) && !isForOfStatement(node) && !isJsxAttribute(node);
}
}
+20 -1
View File
@@ -48,6 +48,15 @@ namespace ts {
};
}
/** @internal */
export function createWatchDiagnosticReporterWithColor(system = sys): DiagnosticReporter {
return diagnostic => {
let output = `[${ formatColorAndReset(new Date().toLocaleTimeString(), ForegroundColorEscapeSequences.Grey) }] `;
output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${system.newLine + system.newLine + system.newLine}`;
system.write(output);
};
}
export function reportDiagnostics(diagnostics: Diagnostic[], reportDiagnostic: DiagnosticReporter): void {
for (const diagnostic of diagnostics) {
reportDiagnostic(diagnostic);
@@ -131,7 +140,7 @@ namespace ts {
reportWatchDiagnostic?: DiagnosticReporter
): WatchingSystemHost {
reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system, pretty ? reportDiagnosticWithColorAndContext : reportDiagnosticSimply);
reportWatchDiagnostic = reportWatchDiagnostic || createWatchDiagnosticReporter(system);
reportWatchDiagnostic = reportWatchDiagnostic || pretty ? createWatchDiagnosticReporterWithColor(system) : createWatchDiagnosticReporter(system);
parseConfigFile = parseConfigFile || ts.parseConfigFile;
return {
system,
@@ -302,6 +311,8 @@ namespace ts {
// There is no extra check needed since we can just rely on the program to decide emit
const builder = createBuilder({ getCanonicalFileName, computeHash });
clearHostScreen();
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.Starting_compilation_in_watch_mode));
synchronizeProgram();
// Update the wild card directory watch
@@ -492,7 +503,15 @@ namespace ts {
scheduleProgramUpdate();
}
function clearHostScreen() {
if (watchingHost.system.clearScreen) {
watchingHost.system.clearScreen();
}
}
function updateProgram() {
clearHostScreen();
timerToUpdateProgram = undefined;
reportWatchDiagnostic(createCompilerDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation));
+12 -4
View File
@@ -42,21 +42,29 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
const stdio = isWorker ? "pipe" : "inherit";
let types: string[];
if (fs.existsSync(path.join(cwd, "test.json"))) {
const update = cp.spawnSync("git", ["submodule", "update", "--remote"], { cwd, timeout, shell: true, stdio });
if (update.status !== 0) throw new Error(`git submodule update for ${directoryName} failed!`);
const submoduleDir = path.join(cwd, directoryName);
const reset = cp.spawnSync("git", ["reset", "HEAD", "--hard"], { cwd: submoduleDir, timeout, shell: true, stdio });
if (reset.status !== 0) throw new Error(`git reset for ${directoryName} failed: ${reset.stderr.toString()}`);
const clean = cp.spawnSync("git", ["clean", "-f"], { cwd: submoduleDir, timeout, shell: true, stdio });
if (clean.status !== 0) throw new Error(`git clean for ${directoryName} failed: ${clean.stderr.toString()}`);
const update = cp.spawnSync("git", ["submodule", "update", "--remote", "."], { cwd: submoduleDir, timeout, shell: true, stdio });
if (update.status !== 0) throw new Error(`git submodule update for ${directoryName} failed: ${update.stderr.toString()}`);
const config = JSON.parse(fs.readFileSync(path.join(cwd, "test.json"), { encoding: "utf8" })) as UserConfig;
ts.Debug.assert(!!config.types, "Bad format from test.json: Types field must be present.");
types = config.types;
cwd = path.join(cwd, directoryName);
cwd = submoduleDir;
}
if (fs.existsSync(path.join(cwd, "package.json"))) {
if (fs.existsSync(path.join(cwd, "package-lock.json"))) {
fs.unlinkSync(path.join(cwd, "package-lock.json"));
}
if (fs.existsSync(path.join(cwd, "node_modules"))) {
require("del").sync(path.join(cwd, "node_modules"));
}
const install = cp.spawnSync(`npm`, ["i"], { cwd, timeout, shell: true, stdio });
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed!`);
if (install.status !== 0) throw new Error(`NPM Install for ${directoryName} failed: ${install.stderr.toString()}`);
}
const args = [path.join(__dirname, "tsc.js")];
if (types) {
+84 -55
View File
@@ -27,6 +27,7 @@ namespace FourSlash {
// The contents of the file (with markers, etc stripped out)
content: string;
fileName: string;
symlinks?: string[];
version: number;
// File-specific options (name/value pairs)
fileOptions: Harness.TestCaseParser.CompilerSettings;
@@ -106,15 +107,16 @@ namespace FourSlash {
// Name of testcase metadata including ts.CompilerOptions properties that will be used by globalOptions
// To add additional option, add property into the testOptMetadataNames, refer the property in either globalMetadataNames or fileMetadataNames
// Add cases into convertGlobalOptionsToCompilationsSettings function for the compiler to acknowledge such option from meta data
const metadataOptionNames = {
baselineFile: "BaselineFile",
emitThisFile: "emitThisFile", // This flag is used for testing getEmitOutput feature. It allows test-cases to indicate what file to be output in multiple files project
fileName: "Filename",
resolveReference: "ResolveReference", // This flag is used to specify entry file for resolve file references. The flag is only allow once per test file
};
const enum MetadataOptionNames {
baselineFile = "BaselineFile",
emitThisFile = "emitThisFile", // This flag is used for testing getEmitOutput feature. It allows test-cases to indicate what file to be output in multiple files project
fileName = "Filename",
resolveReference = "ResolveReference", // This flag is used to specify entry file for resolve file references. The flag is only allow once per test file
symlink = "Symlink",
}
// List of allowed metadata names
const fileMetadataNames = [metadataOptionNames.fileName, metadataOptionNames.emitThisFile, metadataOptionNames.resolveReference];
const fileMetadataNames = [MetadataOptionNames.fileName, MetadataOptionNames.emitThisFile, MetadataOptionNames.resolveReference, MetadataOptionNames.symlink];
function convertGlobalOptionsToCompilerOptions(globalOptions: Harness.TestCaseParser.CompilerSettings): ts.CompilerOptions {
const settings: ts.CompilerOptions = { target: ts.ScriptTarget.ES5 };
@@ -281,7 +283,7 @@ namespace FourSlash {
configFileName = file.fileName;
}
if (!startResolveFileRef && file.fileOptions[metadataOptionNames.resolveReference] === "true") {
if (!startResolveFileRef && file.fileOptions[MetadataOptionNames.resolveReference] === "true") {
startResolveFileRef = file;
}
else if (startResolveFileRef) {
@@ -354,6 +356,10 @@ namespace FourSlash {
Harness.Compiler.getDefaultLibrarySourceFile().text, /*isRootFile*/ false);
}
for (const file of testData.files) {
ts.forEach(file.symlinks, link => this.languageServiceAdapterHost.addSymlink(link, file.fileName));
}
this.formatCodeSettings = {
baseIndentSize: 0,
indentSize: 4,
@@ -653,7 +659,7 @@ namespace FourSlash {
this.verifyGoToXPlain(arg0, endMarkerNames, getDefs);
}
else if (ts.isArray(arg0)) {
const pairs: ReadonlyArray<[string | string[], string | string[]]> = arg0;
const pairs = arg0 as ReadonlyArray<[string | string[], string | string[]]>;
for (const [start, end] of pairs) {
this.verifyGoToXPlain(start, end, getDefs);
}
@@ -1563,7 +1569,7 @@ Actual: ${stringify(fullActual)}`);
}
public baselineCurrentFileBreakpointLocations() {
let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile];
let baselineFile = this.testData.globalOptions[MetadataOptionNames.baselineFile];
if (!baselineFile) {
baselineFile = this.activeFile.fileName.replace(this.basePath + "/breakpointValidation", "bpSpan");
baselineFile = baselineFile.replace(ts.Extension.Ts, ".baseline");
@@ -1582,7 +1588,7 @@ Actual: ${stringify(fullActual)}`);
const allFourSlashFiles = this.testData.files;
for (const file of allFourSlashFiles) {
if (file.fileOptions[metadataOptionNames.emitThisFile] === "true") {
if (file.fileOptions[MetadataOptionNames.emitThisFile] === "true") {
// Find a file with the flag emitThisFile turned on
emitFiles.push(file);
}
@@ -1594,7 +1600,7 @@ Actual: ${stringify(fullActual)}`);
}
Harness.Baseline.runBaseline(
this.testData.globalOptions[metadataOptionNames.baselineFile],
this.testData.globalOptions[MetadataOptionNames.baselineFile],
() => {
let resultString = "";
// Loop through all the emittedFiles and emit them one by one
@@ -1634,7 +1640,7 @@ Actual: ${stringify(fullActual)}`);
}
public baselineQuickInfo() {
let baselineFile = this.testData.globalOptions[metadataOptionNames.baselineFile];
let baselineFile = this.testData.globalOptions[MetadataOptionNames.baselineFile];
if (!baselineFile) {
baselineFile = ts.getBaseFileName(this.activeFile.fileName).replace(ts.Extension.Ts, ".baseline");
}
@@ -2244,7 +2250,7 @@ Actual: ${stringify(fullActual)}`);
public baselineCurrentFileNameOrDottedNameSpans() {
Harness.Baseline.runBaseline(
this.testData.globalOptions[metadataOptionNames.baselineFile],
this.testData.globalOptions[MetadataOptionNames.baselineFile],
() => {
return this.baselineCurrentFileLocations(pos =>
this.getNameOrDottedNameSpan(pos));
@@ -2371,7 +2377,7 @@ Actual: ${stringify(fullActual)}`);
*/
public getAndApplyCodeActions(errorCode?: number, index?: number) {
const fileName = this.activeFile.fileName;
this.applyCodeActions(this.getCodeFixActions(fileName, errorCode), index);
this.applyCodeActions(this.getCodeFixes(fileName, errorCode), index);
}
public applyCodeActionFromCompletion(markerName: string, options: FourSlashInterface.VerifyCompletionActionOptions) {
@@ -2424,6 +2430,17 @@ Actual: ${stringify(fullActual)}`);
this.verifyRangeIs(expectedText, includeWhiteSpace);
}
public verifyCodeFixAll(options: FourSlashInterface.VerifyCodeFixAllOptions): void {
const { fixId, newFileContent } = options;
const fixIds = ts.mapDefined(this.getCodeFixes(this.activeFile.fileName), a => a.fixId);
ts.Debug.assert(ts.contains(fixIds, fixId), "No available code fix has that group id.", () => `Expected '${fixId}'. Available action ids: ${fixIds}`);
const { changes, commands } = this.languageService.getCombinedCodeFix({ type: "file", fileName: this.activeFile.fileName }, fixId, this.formatCodeSettings);
assert.deepEqual(commands, options.commands);
assert(changes.every(c => c.fileName === this.activeFile.fileName), "TODO: support testing codefixes that touch multiple files");
this.applyChanges(changes);
this.verifyCurrentFileContent(newFileContent);
}
/**
* Applies fixes for the errors in fileName and compares the results to
* expectedContents after all fixes have been applied.
@@ -2436,7 +2453,7 @@ Actual: ${stringify(fullActual)}`);
public verifyFileAfterCodeFix(expectedContents: string, fileName?: string) {
fileName = fileName ? fileName : this.activeFile.fileName;
this.applyCodeActions(this.getCodeFixActions(fileName));
this.applyCodeActions(this.getCodeFixes(fileName));
const actualContents: string = this.getFileContent(fileName);
if (this.removeWhitespace(actualContents) !== this.removeWhitespace(expectedContents)) {
@@ -2446,7 +2463,7 @@ Actual: ${stringify(fullActual)}`);
public verifyCodeFix(options: FourSlashInterface.VerifyCodeFixOptions) {
const fileName = this.activeFile.fileName;
const actions = this.getCodeFixActions(fileName, options.errorCode);
const actions = this.getCodeFixes(fileName, options.errorCode);
let index = options.index;
if (index === undefined) {
if (!(actions && actions.length === 1)) {
@@ -2472,7 +2489,7 @@ Actual: ${stringify(fullActual)}`);
}
private verifyNewContent(options: FourSlashInterface.NewContentOptions) {
if (options.newFileContent) {
if (options.newFileContent !== undefined) {
assert(!options.newRangeContent);
this.verifyCurrentFileContent(options.newFileContent);
}
@@ -2485,7 +2502,7 @@ Actual: ${stringify(fullActual)}`);
* Rerieves a codefix satisfying the parameters, or undefined if no such codefix is found.
* @param fileName Path to file where error should be retrieved from.
*/
private getCodeFixActions(fileName: string, errorCode?: number): ts.CodeAction[] {
private getCodeFixes(fileName: string, errorCode?: number): ts.CodeFixAction[] {
const diagnosticsForCodeFix = this.getDiagnostics(fileName).map(diagnostic => ({
start: diagnostic.start,
length: diagnostic.length,
@@ -2501,7 +2518,7 @@ Actual: ${stringify(fullActual)}`);
});
}
private applyCodeActions(actions: ts.CodeAction[], index?: number): void {
private applyCodeActions(actions: ReadonlyArray<ts.CodeAction>, index?: number): void {
if (index === undefined) {
if (!(actions && actions.length === 1)) {
this.raiseError(`Should find exactly one codefix, but ${actions ? actions.length : "none"} found. ${actions ? actions.map(a => `${Harness.IO.newLine()} "${a.description}"`) : ""}`);
@@ -2514,20 +2531,22 @@ Actual: ${stringify(fullActual)}`);
}
}
const changes = actions[index].changes;
this.applyChanges(actions[index].changes);
}
private applyChanges(changes: ReadonlyArray<ts.FileTextChanges>): void {
for (const change of changes) {
this.applyEdits(change.fileName, change.textChanges, /*isFormattingEdit*/ false);
}
}
public verifyImportFixAtPosition(expectedTextArray: string[], errorCode?: number) {
const ranges = this.getRanges();
if (ranges.length === 0) {
this.raiseError("At least one range should be specified in the testfile.");
const ranges = this.getRanges().filter(r => r.fileName === this.activeFile.fileName);
if (ranges.length !== 1) {
this.raiseError("Exactly one range should be specified in the testfile.");
}
const codeFixes = this.getCodeFixActions(this.activeFile.fileName, errorCode);
const codeFixes = this.getCodeFixes(this.activeFile.fileName, errorCode);
if (codeFixes.length === 0) {
if (expectedTextArray.length !== 0) {
@@ -2866,7 +2885,7 @@ Actual: ${stringify(fullActual)}`);
}
public verifyCodeFixAvailable(negative: boolean, info: FourSlashInterface.VerifyCodeFixAvailableOptions[] | undefined) {
const codeFixes = this.getCodeFixActions(this.activeFile.fileName);
const codeFixes = this.getCodeFixes(this.activeFile.fileName);
if (negative) {
if (codeFixes.length) {
@@ -3033,7 +3052,7 @@ Actual: ${stringify(fullActual)}`);
}
public printAvailableCodeFixes() {
const codeFixes = this.getCodeFixActions(this.activeFile.fileName);
const codeFixes = this.getCodeFixes(this.activeFile.fileName);
Harness.IO.log(stringify(codeFixes));
}
@@ -3270,12 +3289,21 @@ ${code}
// Stuff related to the subfile we're parsing
let currentFileContent: string = undefined;
let currentFileName = fileName;
let currentFileSymlinks: string[] | undefined;
let currentFileOptions: { [s: string]: string } = {};
function resetLocalData() {
function nextFile() {
const file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges);
file.fileOptions = currentFileOptions;
file.symlinks = currentFileSymlinks;
// Store result file
files.push(file);
currentFileContent = undefined;
currentFileOptions = {};
currentFileName = fileName;
currentFileSymlinks = undefined;
}
for (let line of lines) {
@@ -3304,8 +3332,7 @@ ${code}
const match = optionRegex.exec(line.substr(2));
if (match) {
const [key, value] = match.slice(1);
const fileMetadataNamesIndex = fileMetadataNames.indexOf(key);
if (fileMetadataNamesIndex === -1) {
if (!ts.contains(fileMetadataNames, key)) {
// Check if the match is already existed in the global options
if (globalOptions[key] !== undefined) {
throw new Error(`Global option '${key}' already exists`);
@@ -3313,24 +3340,22 @@ ${code}
globalOptions[key] = value;
}
else {
if (fileMetadataNamesIndex === fileMetadataNames.indexOf(metadataOptionNames.fileName)) {
// Found an @FileName directive, if this is not the first then create a new subfile
if (currentFileContent) {
const file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges);
file.fileOptions = currentFileOptions;
switch (key) {
case MetadataOptionNames.fileName:
// Found an @FileName directive, if this is not the first then create a new subfile
if (currentFileContent) {
nextFile();
}
// Store result file
files.push(file);
resetLocalData();
}
currentFileName = ts.isRootedDiskPath(value) ? value : basePath + "/" + value;
currentFileOptions[key] = value;
}
else {
// Add other fileMetadata flag
currentFileOptions[key] = value;
currentFileName = ts.isRootedDiskPath(value) ? value : basePath + "/" + value;
currentFileOptions[key] = value;
break;
case MetadataOptionNames.symlink:
currentFileSymlinks = ts.append(currentFileSymlinks, value);
break;
default:
// Add other fileMetadata flag
currentFileOptions[key] = value;
}
}
}
@@ -3342,13 +3367,7 @@ ${code}
else {
// Empty line or code line, terminate current subfile if there is one
if (currentFileContent) {
const file = parseFileContent(currentFileContent, currentFileName, markerPositions, markers, ranges);
file.fileOptions = currentFileOptions;
// Store result file
files.push(file);
resetLocalData();
nextFile();
}
}
}
@@ -3383,7 +3402,7 @@ ${code}
function getNonFileNameOptionInObject(optionObject: { [s: string]: string }): string {
for (const option in optionObject) {
if (option !== metadataOptionNames.fileName) {
if (option !== MetadataOptionNames.fileName) {
return option;
}
}
@@ -4144,6 +4163,10 @@ namespace FourSlashInterface {
this.state.verifyRangeAfterCodeFix(expectedText, includeWhiteSpace, errorCode, index);
}
public codeFixAll(options: VerifyCodeFixAllOptions): void {
this.state.verifyCodeFixAll(options);
}
public fileAfterApplyingRefactorAtMarker(markerName: string, expectedContent: string, refactorNameToApply: string, actionName: string, formattingOptions?: ts.FormatCodeSettings): void {
this.state.verifyFileAfterApplyingRefactorAtMarker(markerName, expectedContent, refactorNameToApply, actionName, formattingOptions);
}
@@ -4579,6 +4602,12 @@ namespace FourSlashInterface {
commands?: ts.CodeActionCommand[];
}
export interface VerifyCodeFixAllOptions {
fixId: string;
newFileContent: string;
commands: ReadonlyArray<{}>;
}
export interface VerifyRefactorOptions {
name: string;
actionName: string;
+24 -3
View File
@@ -32,9 +32,30 @@
// this will work in the browser via browserify
var _chai: typeof chai = require("chai");
var assert: typeof _chai.assert = _chai.assert;
// chai's builtin `assert.isFalse` is featureful but slow - we don't use those features,
// so we'll just overwrite it as an alterative to migrating a bunch of code off of chai
assert.isFalse = (expr, msg) => { if (expr as any as boolean !== false) throw new Error(msg); };
{
// chai's builtin `assert.isFalse` is featureful but slow - we don't use those features,
// so we'll just overwrite it as an alterative to migrating a bunch of code off of chai
assert.isFalse = (expr, msg) => { if (expr as any as boolean !== false) throw new Error(msg); };
const assertDeepImpl = assert.deepEqual;
assert.deepEqual = (a, b, msg) => {
if (ts.isArray(a) && ts.isArray(b)) {
assertDeepImpl(arrayExtraKeysObject(a), arrayExtraKeysObject(b), "Array extra keys differ");
}
assertDeepImpl(a, b, msg);
function arrayExtraKeysObject(a: ReadonlyArray<{} | null | undefined>): object {
const obj: { [key: string]: {} | null | undefined } = {};
for (const key in a) {
if (Number.isNaN(Number(key))) {
obj[key] = a[key];
}
}
return obj;
}
};
}
declare var __dirname: string; // Node-specific
var global: NodeJS.Global = <any>Function("return this").call(undefined);
+26 -6
View File
@@ -122,7 +122,7 @@ namespace Harness.LanguageService {
getPreProcessedFileInfo(fileName: string, fileContents: string): ts.PreProcessedFileInfo;
}
export class LanguageServiceAdapterHost {
export abstract class LanguageServiceAdapterHost {
public typesRegistry: ts.Map<void> | undefined;
protected virtualFileSystem: Utils.VirtualFileSystem = new Utils.VirtualFileSystem(virtualFileSystemRoot, /*useCaseSensitiveFilenames*/false);
@@ -166,6 +166,8 @@ namespace Harness.LanguageService {
throw new Error("No script with name '" + fileName + "'");
}
public abstract addSymlink(from: string, target: string): void;
public openFile(_fileName: string, _content?: string, _scriptKindName?: string): void { /*overridden*/ }
/**
@@ -181,7 +183,9 @@ namespace Harness.LanguageService {
}
/// Native adapter
class NativeLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceHost {
class NativeLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceHost, LanguageServiceAdapterHost {
symlinks = ts.createMap<string>();
isKnownTypesPackageName(name: string): boolean {
return this.typesRegistry && this.typesRegistry.has(name);
}
@@ -212,13 +216,16 @@ namespace Harness.LanguageService {
}
directoryExists(dirName: string): boolean {
if (ts.forEachEntry(this.symlinks, (_, key) => ts.forSomeAncestorDirectory(key, ancestor => ancestor === dirName))) {
return true;
}
const fileEntry = this.virtualFileSystem.traversePath(dirName);
return fileEntry && fileEntry.isDirectory();
}
fileExists(fileName: string): boolean {
const script = this.getScriptSnapshot(fileName);
return script !== undefined;
return this.symlinks.has(fileName) || this.getScriptSnapshot(fileName) !== undefined;
}
readDirectory(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[] {
return ts.matchFiles(path, extensions, exclude, include,
@@ -228,9 +235,19 @@ namespace Harness.LanguageService {
(p) => this.virtualFileSystem.getAccessibleFileSystemEntries(p));
}
readFile(path: string): string | undefined {
const target = this.symlinks.get(path);
if (target !== undefined) {
return this.readFile(target);
}
const snapshot = this.getScriptSnapshot(path);
return snapshot.getText(0, snapshot.getLength());
}
addSymlink(from: string, target: string) { this.symlinks.set(from, target); }
realpath(path: string): string {
const target = this.symlinks.get(path);
return target === undefined ? path : target;
}
getTypeRootsVersion() {
return 0;
}
@@ -246,7 +263,7 @@ namespace Harness.LanguageService {
constructor(cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
this.host = new NativeLanguageServiceHost(cancellationToken, options);
}
getHost() { return this.host; }
getHost(): LanguageServiceAdapterHost { return this.host; }
getLanguageService(): ts.LanguageService { return ts.createLanguageService(this.host); }
getClassifier(): ts.Classifier { return ts.createClassifier(); }
getPreProcessedFileInfo(fileName: string, fileContents: string): ts.PreProcessedFileInfo { return ts.preProcessFile(fileContents, /* readImportFiles */ true, ts.hasJavaScriptFileExtension(fileName)); }
@@ -259,6 +276,8 @@ namespace Harness.LanguageService {
public getModuleResolutionsForFile: (fileName: string) => string;
public getTypeReferenceDirectiveResolutionsForFile: (fileName: string) => string;
addSymlink() { return ts.notImplemented(); }
constructor(preprocessToResolve: boolean, cancellationToken?: ts.HostCancellationToken, options?: ts.CompilerOptions) {
super(cancellationToken, options);
this.nativeHost = new NativeLanguageServiceHost(cancellationToken, options);
@@ -503,9 +522,10 @@ namespace Harness.LanguageService {
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): ts.TextSpan {
return unwrapJSONCallResult(this.shim.getSpanOfEnclosingComment(fileName, position, onlyMultiLine));
}
getCodeFixesAtPosition(): ts.CodeAction[] {
getCodeFixesAtPosition(): never {
throw new Error("Not supported on the shim.");
}
getCombinedCodeFix = ts.notImplemented;
applyCodeActionCommand = ts.notImplemented;
getCodeFixDiagnostics(): ts.Diagnostic[] {
throw new Error("Not supported on the shim.");
+1
View File
@@ -108,6 +108,7 @@
"./unittests/reuseProgramStructure.ts",
"./unittests/moduleResolution.ts",
"./unittests/tsconfigParsing.ts",
"./unittests/asserts.ts",
"./unittests/builder.ts",
"./unittests/commandLineParsing.ts",
"./unittests/configurationExtension.ts",
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="..\harness.ts" />
namespace ts {
describe("assert", () => {
it("deepEqual", () => {
assert.throws(() => assert.deepEqual(createNodeArray([createIdentifier("A")]), createNodeArray([createIdentifier("B")])));
assert.throws(() => assert.deepEqual(createNodeArray([], /*hasTrailingComma*/ true), createNodeArray([], /*hasTrailingComma*/ false)));
assert.deepEqual(createNodeArray([createIdentifier("A")], /*hasTrailingComma*/ true), createNodeArray([createIdentifier("A")], /*hasTrailingComma*/ true));
});
});
}
+4 -4
View File
@@ -60,7 +60,7 @@ namespace ts {
assertParseResult(["--lib", "es5,invalidOption", "0.ts"],
{
errors: [{
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
@@ -165,7 +165,7 @@ namespace ts {
start: undefined,
length: undefined,
}, {
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'esnext'.",
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.",
category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
@@ -263,7 +263,7 @@ namespace ts {
assertParseResult(["--lib", "es5,", "es7", "0.ts"],
{
errors: [{
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
@@ -283,7 +283,7 @@ namespace ts {
assertParseResult(["--lib", "es5, ", "es7", "0.ts"],
{
errors: [{
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
@@ -209,7 +209,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'esnext'.",
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]
@@ -266,7 +266,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]
@@ -297,7 +297,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]
@@ -328,7 +328,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]
@@ -359,7 +359,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.asynciterable'.",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]
+12
View File
@@ -262,6 +262,18 @@ namespace N { // Force this test to be TS-only
y = [#|this.x|];
}
}`);
// TODO (https://github.com/Microsoft/TypeScript/issues/20727): the extracted constant should have a type annotation.
testExtractConstant("extractConstant_ContextualType", `
interface I { a: 1 | 2 | 3 }
let i: I = [#|{ a: 1 }|];
`);
testExtractConstant("extractConstant_ContextualType_Lambda", `
const myObj: { member(x: number, y: string): void } = {
member: [#|(x, y) => x + y|],
}
`);
});
function testExtractConstant(caption: string, text: string) {
-3
View File
@@ -40,9 +40,6 @@ export function Component(x: Config): any;`
getDefaultLibFileName(options) {
return ts.getDefaultLibFilePath(options);
},
fileExists: noop as any,
readFile: noop as any,
readDirectory: noop as any,
});
const definitions = languageService.getDefinitionAtPosition("foo.ts", 160); // 160 is the latter `vueTemplateHtml` position
expect(definitions).to.exist; // tslint:disable-line no-unused-expression
+67 -11
View File
@@ -50,6 +50,7 @@ namespace ts {
"/dev/x/b.ts",
"/dev/x/y/a.ts",
"/dev/x/y/b.ts",
"/dev/q/a/c/b/d.ts",
"/dev/js/a.js",
"/dev/js/b.js",
]);
@@ -1171,13 +1172,17 @@ namespace ts {
};
const expected: ts.ParsedCommandLine = {
options: {},
errors: [
createDiagnosticForConfigFile(json, 12, 11, ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, "**/x/**/*"),
ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,
caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]")
errors: [],
fileNames: [
"c:/dev/x/a.ts",
"c:/dev/x/aa.ts",
"c:/dev/x/b.ts",
"c:/dev/x/y/a.ts",
"c:/dev/x/y/b.ts",
],
fileNames: [],
wildcardDirectories: {}
wildcardDirectories: {
"c:/dev": ts.WatchDirectoryFlags.Recursive
}
};
validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath);
});
@@ -1192,13 +1197,9 @@ namespace ts {
};
const expected: ts.ParsedCommandLine = {
options: {},
errors: [
createDiagnosticForConfigFile(json, 34, 9, ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0, "**/x/**")
],
errors: [],
fileNames: [
"c:/dev/a.ts",
"c:/dev/x/a.ts",
"c:/dev/x/y/a.ts",
"c:/dev/z/a.ts"
],
wildcardDirectories: {
@@ -1426,5 +1427,60 @@ namespace ts {
});
});
});
describe("exclude or include patterns which start with **", () => {
it("can exclude dirs whose pattern starts with **", () => {
const json = {
exclude: [
"**/x"
]
};
const expected: ts.ParsedCommandLine = {
options: {},
errors: [],
fileNames: [
"/dev/A.ts",
"/dev/B.ts",
"/dev/a.ts",
"/dev/b.ts",
"/dev/c.d.ts",
"/dev/q/a/c/b/d.ts",
"/dev/z/a.ts",
"/dev/z/aba.ts",
"/dev/z/abz.ts",
"/dev/z/b.ts",
"/dev/z/bba.ts",
"/dev/z/bbz.ts",
],
wildcardDirectories: {
"/dev": ts.WatchDirectoryFlags.Recursive
}
};
validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath);
});
it("can include dirs whose pattern starts with **", () => {
const json = {
include: [
"**/x",
"**/a/**/b"
]
};
const expected: ts.ParsedCommandLine = {
options: {},
errors: [],
fileNames: [
"/dev/x/a.ts",
"/dev/x/b.ts",
"/dev/x/y/a.ts",
"/dev/x/y/b.ts",
"/dev/q/a/c/b/d.ts",
],
wildcardDirectories: {
"/dev": ts.WatchDirectoryFlags.Recursive
}
};
validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath);
});
});
});
}
+4 -4
View File
@@ -313,7 +313,7 @@ namespace ts {
const host = createModuleResolutionHost(/*hasDirectoryExists*/ true, { name: realFileName, symlinks: [symlinkFileName] });
const resolution = nodeModuleNameResolver("linked", "/app/app.ts", { preserveSymlinks }, host);
const resolvedFileName = preserveSymlinks ? symlinkFileName : realFileName;
checkResolvedModule(resolution.resolvedModule, { resolvedFileName, isExternalLibraryImport: true, extension: Extension.Dts });
checkResolvedModule(resolution.resolvedModule, createResolvedModule(resolvedFileName, /*isExternalLibraryImport*/ true));
});
}
});
@@ -338,7 +338,7 @@ namespace ts {
const path = normalizePath(combinePaths(currentDirectory, fileName));
return files.has(path);
},
readFile: notImplemented
readFile: notImplemented,
};
const program = createProgram(rootFiles, options, host);
@@ -426,7 +426,7 @@ export = C;
const path = getCanonicalFileName(normalizePath(combinePaths(currentDirectory, fileName)));
return files.has(path);
},
readFile: notImplemented
readFile: notImplemented,
};
const program = createProgram(rootFiles, options, host);
const diagnostics = sortAndDeduplicateDiagnostics([...program.getSemanticDiagnostics(), ...program.getOptionsDiagnostics()]);
@@ -1067,7 +1067,7 @@ import b = require("./moduleB");
readFile: fileName => {
const file = sourceFiles.get(fileName);
return file && file.text;
}
},
};
const program1 = createProgram(names, {}, compilerHost);
const diagnostics1 = program1.getFileProcessingDiagnostics().getDiagnostics();
+1 -1
View File
@@ -9,7 +9,7 @@ namespace ts {
assert.isTrue(value, `${missing} to be ${value === undefined ? "not present" : "present only once"}, in actual: ${missingPaths} expected: ${expected}`);
map.set(missing, false);
}
const notFound = mapDefinedIter(map.keys(), k => map.get(k) === true ? k : undefined);
const notFound = arrayFrom(mapDefinedIterator(map.keys(), k => map.get(k) === true ? k : undefined));
assert.equal(notFound.length, 0, `Not found ${notFound} in actual: ${missingPaths} expected: ${expected}`);
}
+16 -3
View File
@@ -345,7 +345,7 @@ namespace ts {
const newTexts: NamedSourceText[] = files.concat([{ name: "non-existing-file.ts", text: SourceText.New("", "", `var x = 1`) }]);
const program2 = updateProgram(program1, ["a.ts"], options, noop, newTexts);
assert.deepEqual(emptyArray, program2.getMissingFilePaths());
assert.lengthOf(program2.getMissingFilePaths(), 0);
assert.equal(StructureIsReused.Not, program1.structureIsReused);
});
@@ -389,6 +389,19 @@ namespace ts {
checkResolvedModulesCache(program4, "a.ts", createMapFromTemplate({ b: createResolvedModule("b.ts"), c: undefined }));
});
it("set the resolvedImports after re-using an ambient external module declaration", () => {
const files = [
{ name: "/a.ts", text: SourceText.New("", "", 'import * as a from "a";') },
{ name: "/types/zzz/index.d.ts", text: SourceText.New("", "", 'declare module "a" { }') },
];
const options: CompilerOptions = { target, typeRoots: ["/types"] };
const program1 = newProgram(files, ["/a.ts"], options);
const program2 = updateProgram(program1, ["/a.ts"], options, files => {
files[0].text = files[0].text.updateProgram('import * as aa from "a";');
});
assert.isDefined(program2.getSourceFile("/a.ts").resolvedModules.get("a"), "'a' is not an unresolved module after re-use");
});
it("resolved type directives cache follows type directives", () => {
const files = [
{ name: "/a.ts", text: SourceText.New("/// <reference types='typedefs'/>", "", "var x = $") },
@@ -826,12 +839,12 @@ namespace ts {
updateProgramText(files, root, "const x = 1;");
});
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
assert.deepEqual(program2.getSemanticDiagnostics(), emptyArray);
assert.lengthOf(program2.getSemanticDiagnostics(), 0);
});
it("Target changes -> redirect broken", () => {
const program1 = createRedirectProgram();
assert.deepEqual(program1.getSemanticDiagnostics(), emptyArray);
assert.lengthOf(program1.getSemanticDiagnostics(), 0);
const program2 = updateRedirectProgram(program1, files => {
updateProgramText(files, axIndex, "export default class X { private x: number; private y: number; }");
+14
View File
@@ -170,6 +170,19 @@ namespace ts.server {
allowNonTsExtensions: true // injected by tsserver
});
});
it("Status request gives ts.version", () => {
const req: protocol.StatusRequest = {
command: CommandNames.Status,
seq: 0,
type: "request"
};
const expected: protocol.StatusResponseBody = {
version: ts.version
};
assert.deepEqual(session.executeCommand(req).response, expected);
});
});
describe("onMessage", () => {
@@ -221,6 +234,7 @@ namespace ts.server {
CommandNames.Saveto,
CommandNames.SignatureHelp,
CommandNames.SignatureHelpFull,
CommandNames.Status,
CommandNames.TypeDefinition,
CommandNames.ProjectInfo,
CommandNames.ReloadProjects,
+29 -31
View File
@@ -103,7 +103,7 @@ namespace M
/*body */ createBlock(statements)
);
changeTracker.insertNodeBefore(sourceFile, /*before*/findChild("M2", sourceFile), newFunction, { suffix: newLineCharacter });
changeTracker.insertNodeBefore(sourceFile, /*before*/findChild("M2", sourceFile), newFunction);
// replace statements with return statement
const newStatement = createReturn(
@@ -129,12 +129,11 @@ function bar() {
changeTracker.deleteRange(sourceFile, { pos: text.indexOf("function foo"), end: text.indexOf("function bar") });
});
}
function findVariableStatementContaining(name: string, sourceFile: SourceFile) {
const varDecl = findChild(name, sourceFile);
assert.equal(varDecl.kind, SyntaxKind.VariableDeclaration);
const varStatement = varDecl.parent.parent;
assert.equal(varStatement.kind, SyntaxKind.VariableStatement);
return varStatement;
function findVariableStatementContaining(name: string, sourceFile: SourceFile): VariableStatement {
return cast(findVariableDeclarationContaining(name, sourceFile).parent.parent, isVariableStatement);
}
function findVariableDeclarationContaining(name: string, sourceFile: SourceFile): VariableDeclaration {
return cast(findChild(name, sourceFile), isVariableDeclaration);
}
{
const text = `
@@ -306,11 +305,11 @@ var y; // comment 4
var z = 3; // comment 5
// comment 6
var a = 4; // comment 7`;
runSingleFileTest("insertNodeAt1", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => {
changeTracker.insertNodeAt(sourceFile, text.indexOf("var y"), createTestClass(), { suffix: newLineCharacter });
runSingleFileTest("insertNodeBefore3", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => {
changeTracker.insertNodeBefore(sourceFile, findVariableStatementContaining("y", sourceFile), createTestClass());
});
runSingleFileTest("insertNodeAt2", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAt(sourceFile, text.indexOf("; // comment 4"), createTestVariableDeclaration("z1"));
runSingleFileTest("insertNodeAfterVariableDeclaration", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findVariableDeclarationContaining("y", sourceFile), createTestVariableDeclaration("z1"));
});
}
{
@@ -325,23 +324,22 @@ namespace M {
var a = 4; // comment 7
}`;
runSingleFileTest("insertNodeBefore1", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => {
changeTracker.insertNodeBefore(sourceFile, findVariableStatementContaining("y", sourceFile), createTestClass(), { suffix: newLineCharacter });
changeTracker.insertNodeBefore(sourceFile, findVariableStatementContaining("y", sourceFile), createTestClass());
});
runSingleFileTest("insertNodeBefore2", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => {
changeTracker.insertNodeBefore(sourceFile, findChild("M", sourceFile), createTestClass(), { suffix: newLineCharacter });
changeTracker.insertNodeBefore(sourceFile, findChild("M", sourceFile), createTestClass());
});
runSingleFileTest("insertNodeAfter1", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("y", sourceFile), createTestClass(), { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("y", sourceFile), createTestClass());
});
runSingleFileTest("insertNodeAfter2", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findChild("M", sourceFile), createTestClass(), { prefix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("M", sourceFile), createTestClass());
});
}
function findOpenBraceForConstructor(sourceFile: SourceFile) {
function findConstructor(sourceFile: SourceFile): ConstructorDeclaration {
const classDecl = <ClassDeclaration>sourceFile.statements[0];
const constructorDecl = forEach(classDecl.members, m => m.kind === SyntaxKind.Constructor && (<ConstructorDeclaration>m).body && <ConstructorDeclaration>m);
return constructorDecl.body.getFirstToken();
return find<ClassElement, ConstructorDeclaration>(classDecl.members, (m): m is ConstructorDeclaration => isConstructorDeclaration(m) && !!m.body)!;
}
function createTestSuperCall() {
const superCall = createCall(
@@ -359,8 +357,8 @@ class A {
}
}
`;
runSingleFileTest("insertNodeAfter3", /*placeOpenBraceOnNewLineForFunctions*/ false, text1, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findOpenBraceForConstructor(sourceFile), createTestSuperCall(), { suffix: newLineCharacter });
runSingleFileTest("insertNodeAtConstructorStart", /*placeOpenBraceOnNewLineForFunctions*/ false, text1, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAtConstructorStart(sourceFile, findConstructor(sourceFile), createTestSuperCall());
});
const text2 = `
class A {
@@ -370,7 +368,7 @@ class A {
}
`;
runSingleFileTest("insertNodeAfter4", /*placeOpenBraceOnNewLineForFunctions*/ false, text2, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("x", sourceFile), createTestSuperCall(), { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("x", sourceFile), createTestSuperCall());
});
const text3 = `
class A {
@@ -379,8 +377,8 @@ class A {
}
}
`;
runSingleFileTest("insertNodeAfter3-block with newline", /*placeOpenBraceOnNewLineForFunctions*/ false, text3, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findOpenBraceForConstructor(sourceFile), createTestSuperCall(), { suffix: newLineCharacter });
runSingleFileTest("insertNodeAtConstructorStart-block with newline", /*placeOpenBraceOnNewLineForFunctions*/ false, text3, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAtConstructorStart(sourceFile, findConstructor(sourceFile), createTestSuperCall());
});
}
{
@@ -638,7 +636,7 @@ class A {
}
const insertAfter = findChild("x", sourceFile);
for (const newNode of newNodes) {
changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode);
}
});
}
@@ -649,7 +647,7 @@ class A {
}
`;
runSingleFileTest("insertNodeAfterInClass1", /*placeOpenBraceOnNewLineForFunctions*/ false, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), createProperty(undefined, undefined, "a", undefined, createKeywordTypeNode(SyntaxKind.BooleanKeyword), undefined), { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), createProperty(undefined, undefined, "a", undefined, createKeywordTypeNode(SyntaxKind.BooleanKeyword), undefined));
});
}
{
@@ -659,7 +657,7 @@ class A {
}
`;
runSingleFileTest("insertNodeAfterInClass2", /*placeOpenBraceOnNewLineForFunctions*/ false, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), createProperty(undefined, undefined, "a", undefined, createKeywordTypeNode(SyntaxKind.BooleanKeyword), undefined), { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), createProperty(undefined, undefined, "a", undefined, createKeywordTypeNode(SyntaxKind.BooleanKeyword), undefined));
});
}
{
@@ -698,7 +696,7 @@ class A {
/*questionToken*/ undefined,
createKeywordTypeNode(SyntaxKind.AnyKeyword),
/*initializer*/ undefined);
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode);
});
}
{
@@ -716,7 +714,7 @@ class A {
/*questionToken*/ undefined,
createKeywordTypeNode(SyntaxKind.AnyKeyword),
/*initializer*/ undefined);
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode);
});
}
{
@@ -733,7 +731,7 @@ interface A {
/*questionToken*/ undefined,
createKeywordTypeNode(SyntaxKind.AnyKeyword),
/*initializer*/ undefined);
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode);
});
}
{
@@ -750,7 +748,7 @@ interface A {
/*questionToken*/ undefined,
createKeywordTypeNode(SyntaxKind.AnyKeyword),
/*initializer*/ undefined);
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), newNode);
});
}
{
@@ -759,7 +757,7 @@ let x = foo
`;
runSingleFileTest("insertNodeInStatementListAfterNodeWithoutSeparator1", /*placeOpenBraceOnNewLineForFunctions*/ false, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
const newNode = createStatement(createParen(createLiteral(1)));
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("x", sourceFile), newNode, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, findVariableStatementContaining("x", sourceFile), newNode);
});
}
});
+100 -40
View File
@@ -80,20 +80,47 @@ namespace ts.tscWatch {
checkOutputDoesNotContain(host, expectedNonAffectedFiles);
}
function checkOutputErrors(host: WatchedSystem, errors: ReadonlyArray<Diagnostic>, isInitial?: true, skipWaiting?: true) {
enum ExpectedOutputErrorsPosition {
BeforeCompilationStarts,
AfterCompilationStarting,
AfterFileChangeDetected
}
function checkOutputErrors(
host: WatchedSystem,
errors: ReadonlyArray<Diagnostic>,
errorsPosition: ExpectedOutputErrorsPosition,
skipWaiting?: true
) {
const outputs = host.getOutput();
const expectedOutputCount = (isInitial ? 0 : 1) + errors.length + (skipWaiting ? 0 : 1);
const expectedOutputCount = errors.length + (skipWaiting ? 0 : 1) + 1;
assert.equal(outputs.length, expectedOutputCount, "Outputs = " + outputs.toString());
let index = 0;
if (!isInitial) {
assertWatchDiagnosticAt(host, index, Diagnostics.File_change_detected_Starting_incremental_compilation);
index++;
let index: number;
switch (errorsPosition) {
case ExpectedOutputErrorsPosition.AfterCompilationStarting:
assertWatchDiagnosticAt(host, 0, Diagnostics.Starting_compilation_in_watch_mode);
index = 1;
break;
case ExpectedOutputErrorsPosition.AfterFileChangeDetected:
assertWatchDiagnosticAt(host, 0, Diagnostics.File_change_detected_Starting_incremental_compilation);
index = 1;
break;
case ExpectedOutputErrorsPosition.BeforeCompilationStarts:
assertWatchDiagnosticAt(host, errors.length, Diagnostics.Starting_compilation_in_watch_mode);
index = 0;
break;
}
forEach(errors, error => {
assertDiagnosticAt(host, index, error);
index++;
});
if (!skipWaiting) {
if (errorsPosition === ExpectedOutputErrorsPosition.BeforeCompilationStarts) {
assertWatchDiagnosticAt(host, index, ts.Diagnostics.Starting_compilation_in_watch_mode);
index += 1;
}
assertWatchDiagnosticAt(host, index, Diagnostics.Compilation_complete_Watching_for_file_changes);
}
host.clearOutput();
@@ -333,13 +360,13 @@ namespace ts.tscWatch {
checkOutputErrors(host, [
getDiagnosticOfFileFromProgram(watch(), file1.path, file1.content.indexOf(commonFile2Name), commonFile2Name.length, Diagnostics.File_0_not_found, commonFile2.path),
getDiagnosticOfFileFromProgram(watch(), file1.path, file1.content.indexOf("y"), 1, Diagnostics.Cannot_find_name_0, "y")
], /*isInitial*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
host.reloadFS([file1, commonFile2, libFile]);
host.runQueuedTimeoutCallbacks();
checkProgramRootFiles(watch(), [file1.path]);
checkProgramActualFiles(watch(), [file1.path, libFile.path, commonFile2.path]);
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("should reflect change in config file", () => {
@@ -667,7 +694,7 @@ namespace ts.tscWatch {
const watch = createWatchModeWithConfigFile(config.path, host);
checkProgramActualFiles(watch(), [file1.path, file2.path, libFile.path]);
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
host.reloadFS([file1, file2, libFile]);
host.checkTimeoutQueueLengthAndRun(1);
@@ -675,7 +702,7 @@ namespace ts.tscWatch {
assert.equal(host.exitCode, ExitStatus.DiagnosticsPresent_OutputsSkipped);
checkOutputErrors(host, [
getDiagnosticWithoutFile(Diagnostics.File_0_not_found, config.path)
], /*isInitial*/ undefined, /*skipWaiting*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected, /*skipWaiting*/ true);
});
it("Proper errors: document is not contained in project", () => {
@@ -778,7 +805,7 @@ namespace ts.tscWatch {
};
const host = createWatchedSystem([moduleFile, file1, libFile]);
const watch = createWatchModeWithoutConfigFile([file1.path], host);
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
const moduleFileOldPath = moduleFile.path;
const moduleFileNewPath = "/a/b/moduleFile1.ts";
@@ -787,12 +814,12 @@ namespace ts.tscWatch {
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile")
]);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
moduleFile.path = moduleFileOldPath;
host.reloadFS([moduleFile, file1, libFile]);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("rename a module file and rename back should restore the states for configured projects", () => {
@@ -810,7 +837,7 @@ namespace ts.tscWatch {
};
const host = createWatchedSystem([moduleFile, file1, configFile, libFile]);
const watch = createWatchModeWithConfigFile(configFile.path, host);
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
const moduleFileOldPath = moduleFile.path;
const moduleFileNewPath = "/a/b/moduleFile1.ts";
@@ -819,12 +846,12 @@ namespace ts.tscWatch {
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile")
]);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
moduleFile.path = moduleFileOldPath;
host.reloadFS([moduleFile, file1, configFile, libFile]);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("types should load from config file path if config exists", () => {
@@ -863,11 +890,11 @@ namespace ts.tscWatch {
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile")
], /*isInitial*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
host.reloadFS([file1, moduleFile, libFile]);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("Configure file diagnostics events are generated when the config file has errors", () => {
@@ -890,7 +917,7 @@ namespace ts.tscWatch {
checkOutputErrors(host, [
getUnknownCompilerOption(watch(), configFile, "foo"),
getUnknownCompilerOption(watch(), configFile, "allowJS")
], /*isInitial*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.BeforeCompilationStarts);
});
it("If config file doesnt have errors, they are not reported", () => {
@@ -907,7 +934,7 @@ namespace ts.tscWatch {
const host = createWatchedSystem([file, configFile, libFile]);
createWatchModeWithConfigFile(configFile.path, host);
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
});
it("Reports errors when the config file changes", () => {
@@ -924,7 +951,7 @@ namespace ts.tscWatch {
const host = createWatchedSystem([file, configFile, libFile]);
const watch = createWatchModeWithConfigFile(configFile.path, host);
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
configFile.content = `{
"compilerOptions": {
@@ -935,14 +962,14 @@ namespace ts.tscWatch {
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, [
getUnknownCompilerOption(watch(), configFile, "haha")
]);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
configFile.content = `{
"compilerOptions": {}
}`;
host.reloadFS([file, configFile, libFile]);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("non-existing directories listed in config file input array should be tolerated without crashing the server", () => {
@@ -1030,13 +1057,13 @@ namespace ts.tscWatch {
getDiagnosticOfFile(watch().getCompilerOptions().configFile, configFile.content.indexOf('"declaration"'), '"declaration"'.length, Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration")
];
const intialErrors = errors();
checkOutputErrors(host, intialErrors, /*isInitial*/ true);
checkOutputErrors(host, intialErrors, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
configFile.content = configFileContentWithoutCommentLine;
host.reloadFS(files);
host.runQueuedTimeoutCallbacks();
const nowErrors = errors();
checkOutputErrors(host, nowErrors);
checkOutputErrors(host, nowErrors, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
assert.equal(nowErrors[0].start, intialErrors[0].start - configFileContentComment.length);
assert.equal(nowErrors[1].start, intialErrors[1].start - configFileContentComment.length);
});
@@ -1667,7 +1694,7 @@ namespace ts.tscWatch {
const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo");
// ensure that imported file was found
checkOutputErrors(host, [f1IsNotModule, cannotFindFoo], /*isInitial*/ true);
checkOutputErrors(host, [f1IsNotModule, cannotFindFoo], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
const originalFileExists = host.fileExists;
{
@@ -1687,7 +1714,7 @@ namespace ts.tscWatch {
f1IsNotModule,
getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"),
cannotFindFoo
]);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
}
{
let fileExistsIsCalled = false;
@@ -1709,7 +1736,7 @@ namespace ts.tscWatch {
// ensure file has correct number of errors after edit
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), root, "f2")
]);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
assert.isTrue(fileExistsIsCalled);
}
@@ -1730,7 +1757,7 @@ namespace ts.tscWatch {
host.reloadFS(files);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, [f1IsNotModule, cannotFindFoo]);
checkOutputErrors(host, [f1IsNotModule, cannotFindFoo], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
assert.isTrue(fileExistsCalled);
}
});
@@ -1767,15 +1794,15 @@ namespace ts.tscWatch {
assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called");
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), root, "bar")
], /*isInitial*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
fileExistsCalledForBar = false;
root.content = `import {y} from "bar"`;
host.reloadFS(files.concat(imported));
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called.");
checkOutputErrors(host, emptyArray);
});
it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => {
@@ -1807,7 +1834,7 @@ namespace ts.tscWatch {
const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD });
assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called");
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
fileExistsCalledForBar = false;
host.reloadFS(files);
@@ -1815,13 +1842,13 @@ namespace ts.tscWatch {
assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called.");
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), root, "bar")
]);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
fileExistsCalledForBar = false;
host.reloadFS(filesWithImported);
host.checkTimeoutQueueLengthAndRun(1);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called.");
checkOutputErrors(host, emptyArray);
});
it("works when module resolution changes to ambient module", () => {
@@ -1857,11 +1884,11 @@ declare module "fs" {
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), root, "fs")
], /*isInitial*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
host.reloadFS(filesWithNodeType);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("works when included file with ambient module changes", () => {
@@ -1899,12 +1926,12 @@ declare module "fs" {
checkOutputErrors(host, [
getDiagnosticModuleNotFoundOfFile(watch(), root, "fs")
], /*isInitial*/ true);
], /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
file.content += fileContentWithFS;
host.reloadFS(files);
host.runQueuedTimeoutCallbacks();
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
});
it("works when reusing program with files from external library", () => {
@@ -1939,7 +1966,7 @@ declare module "fs" {
const host = createWatchedSystem(programFiles.concat(configFile), { currentDirectory: "/a/b/projects/myProject/" });
const watch = createWatchModeWithConfigFile(configFile.path, host);
checkProgramActualFiles(watch(), programFiles.map(f => f.path));
checkOutputErrors(host, emptyArray, /*isInitial*/ true);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterCompilationStarting);
const expectedFiles: ExpectedFile[] = [
createExpectedEmittedFile(file1),
createExpectedEmittedFile(file2),
@@ -1958,7 +1985,7 @@ declare module "fs" {
host.reloadFS(programFiles.concat(configFile));
host.runQueuedTimeoutCallbacks();
checkProgramActualFiles(watch(), programFiles.map(f => f.path));
checkOutputErrors(host, emptyArray);
checkOutputErrors(host, emptyArray, /*errorsPosition*/ ExpectedOutputErrorsPosition.AfterFileChangeDetected);
verifyExpectedFiles(expectedFiles);
@@ -2027,4 +2054,37 @@ declare module "fs" {
assert.equal(host.readFile(outputFile1), file1.content + host.newLine);
});
});
describe("tsc-watch console clearing", () => {
it("clears the console when it starts", () => {
const file = {
path: "f.ts",
content: ""
};
const host = createWatchedSystem([file]);
createWatchModeWithoutConfigFile([file.path], host);
host.runQueuedTimeoutCallbacks();
host.checkScreenClears(1);
});
it("clears the console on recompile", () => {
const file = {
path: "f.ts",
content: ""
};
const host = createWatchedSystem([file]);
createWatchModeWithoutConfigFile([file.path], host);
const modifiedFile = {
...file,
content: "//"
};
host.reloadFS([modifiedFile]);
host.runQueuedTimeoutCallbacks();
host.checkScreenClears(2);
});
});
}
+30 -30
View File
@@ -473,7 +473,7 @@ namespace ts.projectSystem {
}
}
describe("tsserverProjectSystem", () => {
describe("tsserverProjectSystem general functionality", () => {
const commonFile1: FileOrFolder = {
path: "/a/b/commonFile1.ts",
content: "let x = 1"
@@ -2806,7 +2806,7 @@ namespace ts.projectSystem {
});
describe("Proper errors", () => {
describe("tsserverProjectSystem Proper errors", () => {
it("document is not contained in project", () => {
const file1 = {
path: "/a/b/app.ts",
@@ -2960,7 +2960,7 @@ namespace ts.projectSystem {
});
});
describe("autoDiscovery", () => {
describe("tsserverProjectSystem autoDiscovery", () => {
it("does not depend on extension", () => {
const file1 = {
path: "/a/b/app.html",
@@ -2983,7 +2983,7 @@ namespace ts.projectSystem {
});
});
describe("extra resolution pass in lshost", () => {
describe("tsserverProjectSystem extra resolution pass in lshost", () => {
it("can load typings that are proper modules", () => {
const file1 = {
path: "/a/b/app.js",
@@ -3025,7 +3025,7 @@ namespace ts.projectSystem {
});
});
describe("navigate-to for javascript project", () => {
describe("tsserverProjectSystem navigate-to for javascript project", () => {
function containsNavToItem(items: protocol.NavtoItem[], itemName: string, itemKind: string) {
return find(items, item => item.name === itemName && item.kind === itemKind) !== undefined;
}
@@ -3054,7 +3054,7 @@ namespace ts.projectSystem {
});
});
describe("external projects", () => {
describe("tsserverProjectSystem external projects", () => {
it("correctly handling add/remove tsconfig - 1", () => {
const f1 = {
path: "/a/b/app.ts",
@@ -3280,7 +3280,7 @@ namespace ts.projectSystem {
});
});
describe("prefer typings to js", () => {
describe("tsserverProjectSystem prefer typings to js", () => {
it("during second resolution pass", () => {
const typingsCacheLocation = "/a/typings";
const f1 = {
@@ -3308,7 +3308,7 @@ namespace ts.projectSystem {
});
});
describe("format settings", () => {
describe("tsserverProjectSystem format settings", () => {
it("can be set globally", () => {
const f1 = {
path: "/a/b/app.ts",
@@ -3349,7 +3349,7 @@ namespace ts.projectSystem {
});
});
describe("watching @types", () => {
describe("tsserverProjectSystem watching @types", () => {
it("works correctly when typings are added or removed", () => {
const f1 = {
path: "/a/b/app.ts",
@@ -3395,7 +3395,7 @@ namespace ts.projectSystem {
});
});
describe("Open-file", () => {
describe("tsserverProjectSystem Open-file", () => {
it("can be reloaded with empty content", () => {
const f = {
path: "/a/b/app.ts",
@@ -3470,7 +3470,7 @@ namespace ts.projectSystem {
});
});
describe("Language service", () => {
describe("tsserverProjectSystem Language service", () => {
it("should work correctly on case-sensitive file systems", () => {
const lib = {
path: "/a/Lib/lib.d.ts",
@@ -3488,7 +3488,7 @@ namespace ts.projectSystem {
});
});
describe("rename a module file and rename back", () => {
describe("tsserverProjectSystem rename a module file and rename back", () => {
it("should restore the states for inferred projects", () => {
const moduleFile = {
path: "/a/b/moduleFile.ts",
@@ -3623,7 +3623,7 @@ namespace ts.projectSystem {
});
});
describe("add the missing module file for inferred project", () => {
describe("tsserverProjectSystem add the missing module file for inferred project", () => {
it("should remove the `module not found` error", () => {
const moduleFile = {
path: "/a/b/moduleFile.ts",
@@ -3729,7 +3729,7 @@ namespace ts.projectSystem {
});
});
describe("Configure file diagnostics events", () => {
describe("tsserverProjectSystem Configure file diagnostics events", () => {
it("are generated when the config file has errors", () => {
const file = {
@@ -3845,7 +3845,7 @@ namespace ts.projectSystem {
});
});
describe("skipLibCheck", () => {
describe("tsserverProjectSystem skipLibCheck", () => {
it("should be turned on for js-only inferred projects", () => {
const file1 = {
path: "/a/b/file1.js",
@@ -4073,7 +4073,7 @@ namespace ts.projectSystem {
});
});
describe("non-existing directories listed in config file input array", () => {
describe("tsserverProjectSystem non-existing directories listed in config file input array", () => {
it("should be tolerated without crashing the server", () => {
const configFile = {
path: "/a/b/tsconfig.json",
@@ -4128,7 +4128,7 @@ namespace ts.projectSystem {
});
});
describe("reload", () => {
describe("tsserverProjectSystem reload", () => {
it("should work with temp file", () => {
const f1 = {
path: "/a/b/app.ts",
@@ -4267,7 +4267,7 @@ namespace ts.projectSystem {
});
});
describe("Inferred projects", () => {
describe("tsserverProjectSystem Inferred projects", () => {
it("should support files without extensions", () => {
const f = {
path: "/a/compile",
@@ -4495,7 +4495,7 @@ namespace ts.projectSystem {
});
});
describe("No overwrite emit error", () => {
describe("tsserverProjectSystem No overwrite emit error", () => {
it("for inferred project", () => {
const f1 = {
path: "/a/b/f1.js",
@@ -4578,7 +4578,7 @@ namespace ts.projectSystem {
});
});
describe("emit with outFile or out setting", () => {
describe("tsserverProjectSystem emit with outFile or out setting", () => {
function test(opts: CompilerOptions, expectedUsesOutFile: boolean) {
const f1 = {
path: "/a/a.ts",
@@ -4626,7 +4626,7 @@ namespace ts.projectSystem {
});
});
describe("import helpers", () => {
describe("tsserverProjectSystem import helpers", () => {
it("should not crash in tsserver", () => {
const f1 = {
path: "/a/app.ts",
@@ -4643,7 +4643,7 @@ namespace ts.projectSystem {
});
});
describe("searching for config file", () => {
describe("tsserverProjectSystem searching for config file", () => {
it("should stop at projectRootPath if given", () => {
const f1 = {
path: "/a/file1.ts",
@@ -4735,7 +4735,7 @@ namespace ts.projectSystem {
});
});
describe("cancellationToken", () => {
describe("tsserverProjectSystem cancellationToken", () => {
// Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test
let oldPrepare: ts.AnyFunction;
before(() => {
@@ -4998,7 +4998,7 @@ namespace ts.projectSystem {
});
});
describe("occurence highlight on string", () => {
describe("tsserverProjectSystem occurence highlight on string", () => {
it("should be marked if only on string values", () => {
const file1: FileOrFolder = {
path: "/a/b/file1.ts",
@@ -5044,7 +5044,7 @@ namespace ts.projectSystem {
});
});
describe("maxNodeModuleJsDepth for inferred projects", () => {
describe("tsserverProjectSystem maxNodeModuleJsDepth for inferred projects", () => {
it("should be set to 2 if the project has js root files", () => {
const file1: FileOrFolder = {
path: "/a/b/file1.js",
@@ -5098,7 +5098,7 @@ namespace ts.projectSystem {
});
});
describe("Options Diagnostic locations reported correctly with changes in configFile contents", () => {
describe("tsserverProjectSystem Options Diagnostic locations reported correctly with changes in configFile contents", () => {
it("when options change", () => {
const file = {
path: "/a/b/app.ts",
@@ -5162,7 +5162,7 @@ namespace ts.projectSystem {
});
});
describe("refactors", () => {
describe("tsserverProjectSystem refactors", () => {
it("use formatting options", () => {
const file = {
path: "/a.ts",
@@ -5218,7 +5218,7 @@ namespace ts.projectSystem {
});
});
describe("CachingFileSystemInformation", () => {
describe("tsserverProjectSystem CachingFileSystemInformation", () => {
enum CalledMapsWithSingleArg {
fileExists = "fileExists",
directoryExists = "directoryExists",
@@ -5835,7 +5835,7 @@ namespace ts.projectSystem {
});
});
describe("ProjectsChangedInBackground", () => {
describe("tsserverProjectSystem ProjectsChangedInBackground", () => {
function verifyFiles(caption: string, actual: ReadonlyArray<string>, expected: ReadonlyArray<string>) {
assert.equal(actual.length, expected.length, `Incorrect number of ${caption}. Actual: ${actual} Expected: ${expected}`);
const seen = createMap<true>();
@@ -6431,7 +6431,7 @@ namespace ts.projectSystem {
});
});
describe("Watched recursive directories with windows style file system", () => {
describe("tsserverProjectSystem Watched recursive directories with windows style file system", () => {
function verifyWatchedDirectories(useProjectAtRoot: boolean) {
const root = useProjectAtRoot ? "c:/" : "c:/myfolder/allproject/";
const configFile: FileOrFolder = {
+33 -2
View File
@@ -228,6 +228,37 @@ namespace ts.projectSystem {
projectService.checkNumberOfProjects({ externalProjects: 1 });
});
it("external project - deduplicate from local @types packages", () => {
const appJs = {
path: "/a/b/app.js",
content: ""
};
const nodeDts = {
path: "/node_modules/@types/node/index.d.ts",
content: "declare var node;"
};
const host = createServerHost([appJs, nodeDts]);
const installer = new (class extends Installer {
constructor() {
super(host, { typesRegistry: createTypesRegistry("node") });
}
installWorker() {
assert(false, "nothing should get installed");
}
})();
const projectFileName = "/a/app/test.csproj";
const projectService = createProjectService(host, { typingsInstaller: installer });
projectService.openExternalProject({
projectFileName,
options: {},
rootFiles: [toExternalFile(appJs.path)],
typeAcquisition: { enable: true, include: ["node"] }
});
installer.checkPendingCommands(/*expectedCount*/ 0);
projectService.checkNumberOfProjects({ externalProjects: 1 });
});
it("external project - no auto in typing acquisition, no .d.ts/js files", () => {
const file1 = {
path: "/a/b/app.ts",
@@ -978,7 +1009,7 @@ namespace ts.projectSystem {
installer.installAll(/*expectedCount*/ 1);
});
it("cached unresolved typings are not recomputed if program structure did not change", () => {
it("should recompute resolutions after typings are installed", () => {
const host = createServerHost([]);
const session = createSession(host);
const f = {
@@ -1020,7 +1051,7 @@ namespace ts.projectSystem {
session.executeCommand(changeRequest);
host.checkTimeoutQueueLengthAndRun(2); // This enqueues the updategraph and refresh inferred projects
const version2 = proj.getCachedUnresolvedImportsPerFile_TestOnly().getVersion();
assert.equal(version1, version2, "set of unresolved imports should not change");
assert.notEqual(version1, version2, "set of unresolved imports should change");
});
});
+11 -2
View File
@@ -168,7 +168,7 @@ interface Array<T> {}`
mapSeen.set(f, true);
}
}
assert.equal(mapExpected.size, 0, `Output has missing ${JSON.stringify(flatMapIter(mapExpected.keys(), key => key))} in ${JSON.stringify(host.getOutput())}`);
assert.equal(mapExpected.size, 0, `Output has missing ${JSON.stringify(arrayFrom(mapExpected.keys()))} in ${JSON.stringify(host.getOutput())}`);
}
export function checkOutputDoesNotContain(host: TestServerHost, expectedToBeAbsent: string[] | ReadonlyArray<string>) {
@@ -241,7 +241,7 @@ interface Array<T> {}`
ignoreWatchInvokedWithTriggerAsFileCreate: boolean;
}
export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost {
export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost, ModuleResolutionHost {
args: string[] = [];
private readonly output: string[] = [];
@@ -251,6 +251,7 @@ interface Array<T> {}`
private toPath: (f: string) => Path;
private timeoutCallbacks = new Callbacks();
private immediateCallbacks = new Callbacks();
private screenClears = 0;
readonly watchedDirectories = createMultiMap<TestDirectoryWatcher>();
readonly watchedDirectoriesRecursive = createMultiMap<TestDirectoryWatcher>();
@@ -604,6 +605,10 @@ interface Array<T> {}`
this.timeoutCallbacks.unregister(timeoutId);
}
clearScreen(): void {
this.screenClears += 1;
}
checkTimeoutQueueLengthAndRun(expected: number) {
this.checkTimeoutQueueLength(expected);
this.runQueuedTimeoutCallbacks();
@@ -638,6 +643,10 @@ interface Array<T> {}`
this.immediateCallbacks.unregister(timeoutId);
}
checkScreenClears(expected: number): void {
assert.equal(this.screenClears, expected);
}
createDirectory(directoryName: string): void {
const folder = this.toFolder(directoryName);
+2 -2
View File
@@ -52,7 +52,7 @@ interface ArrayConstructor {
* Creates an array from an iterable object.
* @param iterable An iterable object to convert to an array.
*/
from<T>(iterable: Iterable<T>): T[];
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
/**
* Creates an array from an iterable object.
@@ -60,7 +60,7 @@ interface ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T, U>(iterable: Iterable<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
}
interface ReadonlyArray<T> {
+1
View File
@@ -0,0 +1 @@
/// <reference path="lib.es2017.d.ts" />
+6 -6
View File
@@ -550,7 +550,7 @@ interface Math {
*/
atan2(y: number, x: number): number;
/**
* Returns the smallest number greater than or equal to its numeric argument.
* Returns the smallest integer greater than or equal to its numeric argument.
* @param x A numeric expression.
*/
ceil(x: number): number;
@@ -565,7 +565,7 @@ interface Math {
*/
exp(x: number): number;
/**
* Returns the greatest number less than or equal to its numeric argument.
* Returns the greatest integer less than or equal to its numeric argument.
* @param x A numeric expression.
*/
floor(x: number): number;
@@ -992,12 +992,12 @@ interface ReadonlyArray<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: ReadonlyArray<T>[]): T[];
concat(...items: (T[] | ReadonlyArray<T>)[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | ReadonlyArray<T>)[]): T[];
concat(...items: (T | T[] | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@@ -1113,12 +1113,12 @@ interface Array<T> {
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: ReadonlyArray<T>[]): T[];
concat(...items: (T[] | ReadonlyArray<T>)[]): T[];
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
*/
concat(...items: (T | ReadonlyArray<T>)[]): T[];
concat(...items: (T | T[] | ReadonlyArray<T>)[]): T[];
/**
* Adds all the elements of an array separated by the specified separator string.
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@@ -145,7 +145,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类属性声明中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。]]></Val>
<Val><![CDATA[类属性声明中的计算属性名称必须引用类型为文本类型或 "unique symbol" 类型的表达式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -154,7 +154,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[方法重载中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。]]></Val>
<Val><![CDATA[方法重载中的计算属性名称必须引用文本类型或 "unique symbol" 类型的表达式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -163,7 +163,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型文本中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。]]></Val>
<Val><![CDATA[类型文本中的计算属性名称必须引用类型为文本类型或 "unique symbol" 类型的表达式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -172,7 +172,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[环境上下文中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。]]></Val>
<Val><![CDATA[环境上下文中的计算属性名称必须引用类型为文本类型或 "unique symbol" 类型的表达式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -181,7 +181,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[接口中的计算属性名称必须引用必须引用类型为文本类型或“唯一符号”的表达式。]]></Val>
<Val><![CDATA[接口中的计算属性名称必须引用必须引用类型为文本类型或 "unique symbol" 的表达式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -532,7 +532,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型为“唯一符号”的类的属性必须同时为“静态”和“只读”。]]></Val>
<Val><![CDATA[类型为 "unique symbol" 的类的属性必须同时为 "static" 和 "readonly"。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -541,7 +541,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型为“唯一符号”的接口或类型文本的属性必须是“只读”]]></Val>
<Val><![CDATA[类型为 "unique symbol" 的接口或类型文本的属性必须为 "readonly"。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -796,7 +796,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型为“唯一符号”的变量必须是“常量”。]]></Val>
<Val><![CDATA[类型为 "unique symbol" 的变量必须为 "const"。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -866,52 +866,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将 {0}{1} 添加到现有导入声明]]></Val>
<Val><![CDATA[将{0}”从“{1}添加到现有导入声明]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[为属性“{0}”添加索引签名]]></Val>
<Val><![CDATA[为属性“{0}”添加索引签名]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[添加缺失的 "super()" 调用]]></Val>
<Val><![CDATA[添加缺失的 "super()" 调用]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[向未解析的变量添加 "this."]]></Val>
<Val><![CDATA[向未解析的变量添加 "this."]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[添加 tsconfig.json 文件有助于组织包含 TypeScript 和 JavaScript 文件的项目。有关详细信息,请访问 https://aka.ms/tsconfig。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1378,7 +1384,7 @@
<Str Cat="Text">
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[使用 JSDoc 中的类型批注]]></Val>
<Val><![CDATA[通过 JSDoc 类型批注]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1541,10 +1547,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[调用修饰器表达式]]></Val>
<Val><![CDATA[调用修饰器表达式]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1955,34 +1964,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将“{0}”更改为“{1}”]]></Val>
<Val><![CDATA[将“{0}”更改为“{1}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将 "extends" 改为 "implements"]]></Val>
<Val><![CDATA[将 "extends" 改为 "implements"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将拼写更改为“{0}”]]></Val>
<Val><![CDATA[将拼写更改为“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2354,37 +2366,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[声明方法“{0}”]]></Val>
<Val><![CDATA[声明方法“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[声明属性“{0}”]]></Val>
<Val><![CDATA[声明属性“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[声明静态方法“{0}”]]></Val>
<Val><![CDATA[声明静态方法“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[声明静态属性 "{0}"。]]></Val>
<Val><![CDATA[声明静态属性{0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2462,10 +2486,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[禁用检查此文件]]></Val>
<Val><![CDATA[禁用检查此文件]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3429,15 +3456,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[文件规范不能包含多个递归目录通配符("**"):“{0}”。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3731,31 +3749,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[忽略此错误信息]]></Val>
<Val><![CDATA[忽略此错误信息]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[实现继承的抽象类]]></Val>
<Val><![CDATA[实现继承的抽象类]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[实现接口“{0}”]]></Val>
<Val><![CDATA[实现接口“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3770,10 +3794,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[从模块“{1}”导入“{0}”]]></Val>
<Val><![CDATA[从模块“{1}”导入“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3920,37 +3947,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[从用法中推断参数类型]]></Val>
<Val><![CDATA[根据使用情况推断参数类型]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[从用法中推断“{0}”的类型]]></Val>
<Val><![CDATA[根据使用情况推断“{0}”的类型]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[初始化构造函数中的属性“{0}”]]></Val>
<Val><![CDATA[初始化构造函数中的属性“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[初始化静态属性“{0}”]]></Val>
<Val><![CDATA[初始化静态属性“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4481,10 +4520,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[在构造函数中,使 "super()" 调用第一个语句]]></Val>
<Val><![CDATA[在构造函数中,使 "super()" 调用第一个语句]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4701,6 +4743,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[不允许使用多个连续的数字分隔符。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4791,6 +4842,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[此处不允许使用数字分隔符。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5396,10 +5456,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[带下划线的前缀“{0}”]]></Val>
<Val><![CDATA[带下划线的前缀“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5849,10 +5912,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[删除“{0}”的声明]]></Val>
<Val><![CDATA[删除“{0}”的声明]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6275,10 +6341,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[重写为索引访问类型“{0}”]]></Val>
<Val><![CDATA[重写为索引访问类型“{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6390,15 +6459,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[指定 ECMAScript 目标版本: "ES3"(默认)、"ES5"、"ES2015"、"ES2016"、"ES2017" 或 "ESNEXT"。]]></Val>
<Val><![CDATA[指定 ECMAScript 目标版本: "ES3" (默认)、"ES5"、"ES2015"、"ES2016"、"ES2017"、"ES2018" 或 "ESNEXT"。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6504,6 +6570,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[在监视模式下开始编译...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6582,6 +6657,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[后续属性声明必须属于同一类型。属性“{0}”的类型必须为“{1}”,但此处却为类型“{2}”。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7350,7 +7428,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8665,7 +8743,7 @@
<Str Cat="Text">
<Val><![CDATA['readonly' modifier can only appear on a property declaration or index signature.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["readonly" 仅可出现在属性声明或索引签名中。]]></Val>
<Val><![CDATA["readonly" 修饰符仅可出现在属性声明或索引签名中。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8866,7 +8944,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[此处不允许“唯一符号”类型。]]></Val>
<Val><![CDATA[此处不允许使用 "unique symbol" 类型。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8875,7 +8953,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[“唯一符号”类型仅可变量语句中的变量上使用。]]></Val>
<Val><![CDATA["unique symbol" 类型仅可用于变量语句中的变量。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8884,7 +8962,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[不可在具有绑定名称的变量声明中使用“唯一符号”类型。]]></Val>
<Val><![CDATA[不可在具有绑定名称的变量声明中使用 "unique symbol" 类型。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -145,7 +145,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類別屬性宣告中的計算屬性名稱必須參考型為常值型別或 'unique symbol' 型的運算式。]]></Val>
<Val><![CDATA[類別屬性宣告中的計算屬性名稱必須參考型為常值型別或 'unique symbol' 型的運算式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -163,7 +163,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[型別常值中的計算屬性名稱必須參考型為常值型別或 'unique symbol' 型的運算式。]]></Val>
<Val><![CDATA[常值型別中的計算屬性名稱必須參考型為常值型別或 'unique symbol' 型的運算式。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -532,7 +532,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[型為 'unique symbol' 型的類別屬性必須同時為 'static' 'readonly'。]]></Val>
<Val><![CDATA[型為 'unique symbol' 型的類別屬性必須為 'static' 'readonly'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -541,7 +541,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[型為 'unique symbol' 型別的介面或型別常值屬性必須是 'readonly'。]]></Val>
<Val><![CDATA[型為 'unique symbol' 類型之介面或常值型別的屬性必須是 'readonly'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -866,52 +866,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[從 "{1}" 將 '{0}' 新增至現有的匯入宣告]]></Val>
<Val><![CDATA[從 "{1}" 將 '{0}' 新增至現有的匯入宣告]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為屬性 '{0}' 新增索引簽章]]></Val>
<Val><![CDATA[為屬性 '{0}' 新增索引簽章]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增遺漏的 'super()' 呼叫]]></Val>
<Val><![CDATA[新增遺漏的 'super()' 呼叫]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將 'this.' 新增到未經解析的變數]]></Val>
<Val><![CDATA[將 'this' 新增至未解析的變數]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增 tsconfig.json 檔案有助於組織同時包含 TypeScript 及 JavaScript 檔案的專案。如需深入了解,請參閱 https://aka.ms/tsconfig。]]></Val>
<Val><![CDATA[新增 tsconfig.json 檔案有助於組織同時包含 TypeScript 及 JavaScript 檔案的專案。若要深入了解,請前往 https://aka.ms/tsconfig。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1541,10 +1547,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[呼叫裝飾項目運算式]]></Val>
<Val><![CDATA[呼叫裝飾項目運算式]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1955,34 +1964,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將 '{0}' 變更為 '{1}']]></Val>
<Val><![CDATA[將 '{0}' 變更為 '{1}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將 'extends' 變更為 'implements'。]]></Val>
<Val><![CDATA[將 [延伸]5D; 變更至 [實作]5D;]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將拼字變更為 '{0}']]></Val>
<Val><![CDATA[將拼字變更為 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2354,37 +2366,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[宣告方法 '{0}']]></Val>
<Val><![CDATA[宣告方法 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[宣告屬性 '{0}']]></Val>
<Val><![CDATA[宣告屬性 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[宣告靜態方法 '{0}']]></Val>
<Val><![CDATA[宣告靜態方法 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[宣告靜態屬性 '{0}']]></Val>
<Val><![CDATA[宣告靜態屬性 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2462,10 +2486,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[停用此檔案的檢查]]></Val>
<Val><![CDATA[停用此檔案的檢查]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3220,7 +3247,7 @@
<Str Cat="Text">
<Val><![CDATA[Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[運算式解析成編譯器用來擷取 'new.target' 中繼屬性參考的變數宣告 '_newTarget'。]]></Val>
<Val><![CDATA[運算式解析成變數宣告 '_newTarget',而供編譯器用來擷取 'new.target' 中繼屬性參考。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3429,15 +3456,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[檔案規格不能包含多個遞迴目錄萬用字元 ('**'): '{0}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3731,31 +3749,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[略此錯誤訊息]]></Val>
<Val><![CDATA[略此錯誤訊息]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[實作已繼承的抽象類別]]></Val>
<Val><![CDATA[實作已繼承的抽象類別]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[實作介面 '{0}']]></Val>
<Val><![CDATA[實作介面 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3770,10 +3794,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[從模組 "{1}" 匯入 '{0}']]></Val>
<Val><![CDATA[從模組 "{1}" 匯入 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3920,37 +3947,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[從用法推斷參數類型]]></Val>
<Val><![CDATA[從使用方式推斷參數類型]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[從用法推斷 '{0}' 的類型]]></Val>
<Val><![CDATA[從使用方式推斷 '{0}' 的類型]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[初始化建構函式中的屬性 '{0}']]></Val>
<Val><![CDATA[建構函式中的屬性 '{0}' 初始化]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[初始化靜態屬性 '{0}']]></Val>
<Val><![CDATA[靜態屬性 '{0}' 初始化]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4481,10 +4520,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[使 'super()' 呼叫成為建構函式中的第一個陳述式]]></Val>
<Val><![CDATA[使 'super()' 呼叫成為建構函式中的第一個陳述式]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4701,6 +4743,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[不允許多個連續的數字分隔符號。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4791,6 +4842,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[這裡不允許數字分隔符號。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5396,10 +5456,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[有底線的前置詞 '{0}']]></Val>
<Val><![CDATA[有底線的前置詞 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5443,7 +5506,7 @@
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on 'const' enum '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' 列舉 '{1}' 沒有屬性 '{0}'。]]></Val>
<Val><![CDATA['const' 列舉 '{1}' 上並沒有屬性 '{0}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -5849,10 +5912,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[移除 {0} 的宣告]]></Val>
<Val><![CDATA[移除 '{0}' 的宣告]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6275,10 +6341,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[重寫為索引存取類型 '{0}']]></Val>
<Val><![CDATA[重寫為索引存取類型 '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6390,15 +6459,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[指定 ECMAScript 目標版本: 'ES3' (預設)、'ES5'、'ES2015'、'ES2016'、'ES2017' 或 'ESNEXT'。]]></Val>
<Val><![CDATA[指定 ECMAScript 目標版本: 'ES3' (預設)、'ES5'、'ES2015'、'ES2016'、'ES2017'、'ES2018' 或 'ESNEXT'。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6504,6 +6570,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[在監看模式中開始編譯...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6571,7 +6646,7 @@
<Str Cat="Text">
<Val><![CDATA[Stylize errors and messages using color and context (experimental).]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[使用色彩及內容設計錯誤與訊息的風格 (實驗)。]]></Val>
<Val><![CDATA[使用色彩及內容設計錯誤與訊息的風格 (實驗)。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Stylize errors and messages using color and context. (experimental)]]></Val>
@@ -6582,6 +6657,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[後續的屬性宣告必須具有相同的類型。屬性 '{0}' 的類型必須是 '{1}',但此處卻是類型 '{2}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7350,7 +7428,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8374,7 +8452,7 @@
<Str Cat="Text">
<Val><![CDATA['const' declarations can only be declared inside a block.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[只在區塊內宣告 'const' 宣告。]]></Val>
<Val><![CDATA[只在區塊內宣告 'const' 宣告。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8383,7 +8461,7 @@
<Str Cat="Text">
<Val><![CDATA['const' declarations must be initialized.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' 宣告必須初始化 。]]></Val>
<Val><![CDATA['const' 宣告必須初始化。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA['const' declarations must be initialized]]></Val>
@@ -8413,7 +8491,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' 列舉只可用於屬性或索引存取運算式中,或者用於匯入宣告或匯出指派的右側 。]]></Val>
<Val><![CDATA['const' 列舉只可用於屬性或索引存取運算式中,或者用於匯入宣告或匯出指派的右側。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -154,7 +154,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Název vypočítané vlastnosti v deklaraci vlastnosti třídy musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.]]></Val>
<Val><![CDATA[Název počítané vlastnosti v deklaraci vlastnosti třídy musí přímo odkazovat na výraz, jehož typ je literál nebo unique symbol.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -163,7 +163,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Název vypočítané vlastnosti v přetížené metodě musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.]]></Val>
<Val><![CDATA[Název počítané vlastnosti v přetížené metodě musí odkazovat na výraz, jehož typ je literál nebo unique symbol.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -172,7 +172,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Název vypočítané vlastnosti v literálu typu musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.]]></Val>
<Val><![CDATA[Název počítané vlastnosti v literálu typu musí odkazovat na výraz, jehož typ je literál nebo unique symbol.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -181,7 +181,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Název vypočítané vlastnosti v ambientním kontextu musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.]]></Val>
<Val><![CDATA[Název počítané vlastnosti v ambientním kontextu musí odkazovat na výraz, jehož typ je literál nebo unique symbol.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -190,7 +190,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Název vypočítané vlastnosti v rozhraní musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.]]></Val>
<Val><![CDATA[Název počítané vlastnosti v rozhraní musí odkazovat na výraz, jehož typ je literál nebo unique symbol.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -541,7 +541,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Vlastnost třídy, jejíž typ je jedinečný symbol, musí být static a readonly.]]></Val>
<Val><![CDATA[Vlastnost třídy, jejíž typ je unique symbol, musí být static a readonly.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -550,7 +550,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Vlastnost rozhraní nebo literálu typu, jehož typ je jedinečný symbol, musí být readonly.]]></Val>
<Val><![CDATA[Vlastnost rozhraní nebo literálu typu, jehož typ je unique symbol, musí být readonly.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -805,7 +805,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Proměnná, jejíž typ je jedinečný symbol, musí být const.]]></Val>
<Val><![CDATA[Proměnná, jejíž typ je unique symbol, musí být const.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -875,52 +875,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Přidá {0} k existující deklaraci importu z {1}.]]></Val>
<Val><![CDATA[Přidat {0} k existující deklaraci importu z {1}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Přidat signaturu indexu pro vlastnost {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Přidejte chybějící volání metody super().]]></Val>
<Val><![CDATA[Přidat chybějící volání metody super()]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Přidejte k nerozpoznané proměnné this.]]></Val>
<Val><![CDATA[Přidat k nerozpoznané proměnné this.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Přidání souboru tsconfig.json vám pomůže uspořádat projekty, které obsahují jak soubory TypeScript, tak soubory JavaScript. Další informace najdete na adrese https://aka.ms/tsconfig.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1550,10 +1556,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Výraz pro volání dekoratéru]]></Val>
<Val><![CDATA[Zavolat výraz dekorátoru]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1964,34 +1973,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Změnit {0} na {1}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Změňte extends na implements.]]></Val>
<Val><![CDATA[Změnit extends na implements]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Změnit pravopis na {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2363,37 +2375,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarujte metodu {0}.]]></Val>
<Val><![CDATA[Deklarovat metodu {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarujte vlastnost {0}.]]></Val>
<Val><![CDATA[Deklarovat vlastnost {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarujte statickou metodu {0}.]]></Val>
<Val><![CDATA[Deklarovat statickou metodu {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarujte statickou vlastnost {0}.]]></Val>
<Val><![CDATA[Deklarovat statickou vlastnost {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2471,10 +2495,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zakázat kontrolu tohoto souboru]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3438,15 +3465,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Specifikace souboru nemůže obsahovat víc než jeden rekurzivní zástupný znak adresáře (**): {0}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3740,31 +3758,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ignorovat tuto chybovou zprávu]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementujte zděděnou abstraktní třídu.]]></Val>
<Val><![CDATA[Implementovat zděděnou abstraktní třídu]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementujte rozhraní {0}.]]></Val>
<Val><![CDATA[Implementovat rozhraní {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3779,10 +3803,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Import {0} z modulu {1}]]></Val>
<Val><![CDATA[Importovat {0} z modulu {1}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3929,37 +3956,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Odvodit typy parametrů z používání]]></Val>
<Val><![CDATA[Odvodit typy parametrů z využití]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Odvodit typ {0} z používání]]></Val>
<Val><![CDATA[Odvodit typ {0} z využití]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inicializovat vlastnost {0} v konstruktoru]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inicializovat statickou vlastnost {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4490,10 +4529,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nastavit volání metody super() jako první příkaz v konstruktoru]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4710,6 +4752,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Více po sobě jdoucích číselných oddělovačů se nepovoluje.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4800,6 +4851,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Číselné oddělovače tady nejsou povolené.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5405,10 +5465,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Předpona {0} s podtržítkem]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5858,10 +5921,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Odeberte deklaraci pro {0}.]]></Val>
<Val><![CDATA[Odebrat deklaraci pro {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6284,10 +6350,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Proveďte přepis jako indexovaný přístupový typ {0}.]]></Val>
<Val><![CDATA[Přepsat jako indexovaný typ přístupu {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6399,15 +6468,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zadejte cílovou verzi ECMAScriptu: ES3 (výchozí), ES5, ES2015, ES2016, ES2017, nebo ESNEXT.]]></Val>
<Val><![CDATA[Zadejte cílovou verzi ECMAScriptu: ES3 (výchozí), ES5, ES2015, ES2016, ES2017, ES2018 nebo ESNEXT.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6513,6 +6579,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Spouští se kompilace v režimu sledování...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6591,6 +6666,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace následných vlastností musí obsahovat stejný typ. Vlastnost {0} musí být typu {1}, ale tady je typu {2}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7359,7 +7437,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8875,7 +8953,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typy „jedinečný symbol tady nejsou povolené.]]></Val>
<Val><![CDATA[Typy unique symbol tady nejsou povolené.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8884,7 +8962,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typy „jedinečný symbol jsou povolené jen u proměnných v příkazu proměnné.]]></Val>
<Val><![CDATA[Typy unique symbol jsou povolené jen u proměnných v příkazu proměnné.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8893,7 +8971,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typy „jedinečný symbol nejde použít v deklaraci proměnné s názvem vazby.]]></Val>
<Val><![CDATA[Typy unique symbol nejde použít v deklaraci proměnné s názvem vazby.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -863,44 +863,53 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Fügen Sie "{0}" zur vorhandenen Importdeklaration aus "{1}" hinzu.]]></Val>
<Val><![CDATA["{0}" der vorhandenen Importdeklaration aus "{1}" hinzufügen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Indexsignatur für die Eigenschaft "{0}" hinzufügen.]]></Val>
<Val><![CDATA[Indexsignatur für die Eigenschaft "{0}" hinzufügen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Fügen Sie den fehlenden super()-Aufruf hinzu.]]></Val>
<Val><![CDATA[Fehlenden super()-Aufruf hinzufügen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Der nicht aufgelösten Variablen "this." hinzufügen.]]></Val>
<Val><![CDATA[Der nicht aufgelösten Variablen "this." hinzufügen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -1535,10 +1544,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Rufen Sie den Decoratorausdruck auf.]]></Val>
<Val><![CDATA[Decorator-Ausdruck aufrufen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1949,31 +1961,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ändern Sie "{0}" in "{1}".]]></Val>
<Val><![CDATA["{0}" in "{1}" ändern]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["extends" in "implements" ändern]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ändern Sie die Schreibweise in "{0}".]]></Val>
<Val><![CDATA[Schreibweise in "{0}" ändern]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2173,7 +2191,7 @@
<Str Cat="Text">
<Val><![CDATA[Computed values are not permitted in an enum with string valued members.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Berechnete Werte sind in einer Aufzählung mit Membern mit Zeichenfolgenwerten nicht zulässig.]]></Val>
<Val><![CDATA[Berechnete Werte sind in einer Enumeration mit Membern mit Zeichenfolgenwerten nicht zulässig.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2345,37 +2363,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Methode "{0}" deklarieren.]]></Val>
<Val><![CDATA[Methode "{0}" deklarieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eigenschaft "{0}" deklarieren.]]></Val>
<Val><![CDATA[Eigenschaft "{0}" deklarieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Statische Methode "{0}" deklarieren.]]></Val>
<Val><![CDATA[Statische Methode "{0}" deklarieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarieren Sie die statische Eigenschaft "{0}".]]></Val>
<Val><![CDATA[Statische Eigenschaft "{0}" deklarieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2453,10 +2483,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Überprüfung für diese Datei deaktivieren.]]></Val>
<Val><![CDATA[Überprüfung für diese Datei deaktivieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3420,15 +3453,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Die Dateispezifikation darf nicht mehrere rekursive Verzeichnisplatzhalter enthalten ("**"): "{0}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3722,28 +3746,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Diese Fehlermeldung ignorieren.]]></Val>
<Val><![CDATA[Diese Fehlermeldung ignorieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Geerbte abstrakte Klasse implementieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Schnittstelle "{0}" implementieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3758,10 +3791,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Import von "{0}" aus Modul "{1}".]]></Val>
<Val><![CDATA["{0}" aus dem Modul "{1}" importieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3908,37 +3944,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Leiten Sie Parametertypen aus der Nutzung ab.]]></Val>
<Val><![CDATA[Parametertypen aus der Nutzung ableiten]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Leiten Sie den Typ von "{0}" aus der Nutzung ab.]]></Val>
<Val><![CDATA[Typ von "{0}" aus der Nutzung ableiten]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eigenschaft '{0}' im Konstruktor initialisieren.]]></Val>
<Val><![CDATA[Eigenschaft "{0}" im Konstruktor initialisieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Statische Eigenschaft '{0}' initialisieren.]]></Val>
<Val><![CDATA[Statische Eigenschaft "{0}" initialisieren]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4469,10 +4517,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Legen Sie den super()-Aufruf als erste Anweisung im Konstruktor fest.]]></Val>
<Val><![CDATA[super()-Aufruf als erste Anweisung im Konstruktor festlegen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4689,6 +4740,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Mehrere aufeinander folgende numerische Trennzeichen sind nicht zulässig.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4779,6 +4839,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numerische Trennzeichen sind hier nicht zulässig.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5381,10 +5450,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Präfix "{0}" mit einem Unterstrich.]]></Val>
<Val><![CDATA["{0}" einen Unterstrich voranstellen]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5834,10 +5906,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklaration entfernen für: {0}]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6257,10 +6332,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Als indizierten Zugriffstyp "{0}" neu schreiben.]]></Val>
<Val><![CDATA[Als indizierten Zugriffstyp "{0}" neu schreiben]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6372,11 +6450,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[ECMAScript-Zielversion angeben: ES3 (Standard), ES5, ES2015, ES2016, ES2017 oder ESNEXT.]]></Val>
<Val><![CDATA[ECMAScript-Zielversion angeben: ES3 (Standard), ES5, ES2015, ES2016, ES2017, ES2018 oder ESNEXT.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -6483,6 +6561,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kompilierung im Überwachungsmodus wird gestartet...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6561,6 +6648,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nachfolgende Eigenschaftendeklarationen müssen den gleichen Typ aufweisen. Die Eigenschaft "{0}" muss den Typ "{1}" aufweisen, ist hier aber vom Typ "{2}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7329,11 +7419,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typ "{0}" kann nicht zu Typ "{1}" zugewiesen werden. Es sind zwei verschiedene Typen mit diesem Namen vorhanden, diese sind jedoch nicht verwandt.]]></Val>
<Val><![CDATA[Der Typ "{0}" kann dem Typ "{1}" nicht zugewiesen werden. Es sind zwei verschiedene Typen mit diesem Namen vorhanden, diese sind jedoch nicht verwandt.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -436,7 +436,7 @@
<Str Cat="Text">
<Val><![CDATA[A mixin class must have a constructor with a single rest parameter of type 'any[]5D;'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una clase mixin debe tener un constructor con un parámetro de REST sencillo del tipo "any[]5D;".]]></Val>
<Val><![CDATA[Una clase mixin debe tener un constructor con un solo parámetro rest de tipo "any[]5D;"]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -523,7 +523,7 @@
<Str Cat="Text">
<Val><![CDATA[A path in an 'extends' option must be relative or rooted, but '{0}' is not.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una ruta de acceso en una opción "extiende" debe ser relativa o raíz, pero no '{0}'.]]></Val>
<Val><![CDATA[Una ruta de acceso en una opción "extiende" debe ser relativa o raíz, pero no "{0}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -875,52 +875,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Agregue "{0}" a una declaración de importación existente desde "{1}".]]></Val>
<Val><![CDATA[Agregar "{0}" a una declaración de importación existente desde "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Agregue una firma de índice para la propiedad "{0}".]]></Val>
<Val><![CDATA[Agregar una signatura de índice para la propiedad "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Agregue la llamada a "super()" que falta.]]></Val>
<Val><![CDATA[Agregar la llamada a "super()" que falta]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Agrega "this." a una variable no resuelta.]]></Val>
<Val><![CDATA[Agregar "this." a una variable no resuelta]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Agregar un archivo tsconfig.json ayuda a organizar los proyectos que contienen archivos TypeScript y JavaScript. Más información en https://aka.ms/tsconfig.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1414,7 +1420,7 @@
<Str Cat="Text">
<Val><![CDATA[Argument for '{0}' option must be: {1}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El argumento para la opción '{0}' debe ser: {1}.]]></Val>
<Val><![CDATA[El argumento para la opción "{0}" debe ser {1}.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Argument for '{0}' option must be: {1}]]></Val>
@@ -1426,7 +1432,7 @@
<Str Cat="Text">
<Val><![CDATA[Argument of type '{0}' is not assignable to parameter of type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[No se puede asignar un argumento de tipo '{0}' al parámetro de tipo '{1}'.]]></Val>
<Val><![CDATA[No se puede asignar un argumento de tipo "{0}" al parámetro de tipo "{1}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1550,10 +1556,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Llame a la expresión decorador.]]></Val>
<Val><![CDATA[Llamar a la expresión decorador]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1964,34 +1973,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambie "{0}" a "{1}".]]></Val>
<Val><![CDATA[Cambiar "{0}" a "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambiar "extends" por "implements".]]></Val>
<Val><![CDATA[Cambiar "extends" a "implements"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambiar la ortografía a "{0}".]]></Val>
<Val><![CDATA[Cambiar la ortografía a "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2363,37 +2375,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare el método "{0}".]]></Val>
<Val><![CDATA[Declarar el método "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare la propiedad "{0}".]]></Val>
<Val><![CDATA[Declarar la propiedad "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare el método estático "{0}".]]></Val>
<Val><![CDATA[Declarar el método estático "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare la propiedad "{0}" estática.]]></Val>
<Val><![CDATA[Declarar la propiedad estática "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2471,10 +2495,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deshabilite la comprobación para este archivo.]]></Val>
<Val><![CDATA[Deshabilitar la comprobación para este archivo]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3438,15 +3465,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La especificación de archivo no puede contener varios comodines de directorio recursivo ('**'): '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3740,31 +3758,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ignore este mensaje de error.]]></Val>
<Val><![CDATA[Ignorar este mensaje de error]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementar clase abstracta heredada.]]></Val>
<Val><![CDATA[Implementar clase abstracta heredada]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementar interfaz "{0}".]]></Val>
<Val><![CDATA[Implementar la interfaz "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3779,10 +3803,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importar "{0}" desde el módulo "{1}".]]></Val>
<Val><![CDATA[Importar "{0}" desde el módulo "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3929,37 +3956,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Infiera los tipos de parámetro del uso.]]></Val>
<Val><![CDATA[Deducir los tipos de parámetro del uso]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Infiera el tipo de "{0}" del uso.]]></Val>
<Val><![CDATA[Deducir el tipo de "{0}" del uso]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inicialice la propiedad "{0}" en el constructor.]]></Val>
<Val><![CDATA[Inicializar la propiedad "{0}" en el constructor]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inicialice la propiedad estática "{0}".]]></Val>
<Val><![CDATA[Inicializar la propiedad estática "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4490,10 +4529,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Haga que la llamada a "super()" sea la primera instrucción del constructor.]]></Val>
<Val><![CDATA[Hacer que la llamada a "super()" sea la primera instrucción del constructor]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4710,6 +4752,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[No se permiten varios separadores numéricos consecutivos.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4800,6 +4851,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aquí no se permiten separadores numéricos.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5405,10 +5465,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Prefijo '{0}' con guion bajo.]]></Val>
<Val><![CDATA[Prefijo "{0}" con guion bajo]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5858,10 +5921,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Quitar declaración de: "{0}".]]></Val>
<Val><![CDATA[Quitar declaración de: "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6284,10 +6350,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Reescribir como el tipo de acceso indexado "{0}".]]></Val>
<Val><![CDATA[Reescribir como tipo de acceso indexado "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6399,15 +6468,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Especifique la versión de ECMAScript de destino: "ES3" (valor predeterminado), "ES5", "ES2015", "ES2016", "ES2017" o "ESNEXT".]]></Val>
<Val><![CDATA[Especifique la versión de ECMAScript de destino: "ES3" (valor predeterminado), "ES5", "ES2015", "ES2016", "ES2017", "ES2018" o "ESNEXT".]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6513,6 +6579,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Iniciando la compilación en modo de inspección...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6591,6 +6666,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Las declaraciones de propiedad subsiguientes deben tener el mismo tipo. La propiedad "{0}" debe ser de tipo "{1}", pero aquí tiene el tipo "{2}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7359,7 +7437,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -154,7 +154,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un nom de propriété calculée dans une déclaration de propriété de classe doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.]]></Val>
<Val><![CDATA[Un nom de propriété calculée dans une déclaration de propriété de classe doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -163,7 +163,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un nom de propriété calculée dans une surcharge de méthode doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.]]></Val>
<Val><![CDATA[Un nom de propriété calculée dans une surcharge de méthode doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -172,7 +172,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un nom de propriété calculée dans un littéral de type doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.]]></Val>
<Val><![CDATA[Un nom de propriété calculée dans un littéral de type doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -181,7 +181,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un nom de propriété calculée dans un contexte ambiant doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.]]></Val>
<Val><![CDATA[Un nom de propriété calculée dans un contexte ambiant doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -190,7 +190,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un nom de propriété calculée dans une interface doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.]]></Val>
<Val><![CDATA[Un nom de propriété calculée dans une interface doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -541,7 +541,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une propriété d'une classe dont le type est un type 'symbole unique' doit être à la fois 'static' et 'readonly'.]]></Val>
<Val><![CDATA[Une propriété d'une classe dont le type est un type 'unique symbol' doit être à la fois 'static' et 'readonly'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -550,7 +550,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une propriété d'une interface ou d'un littéral de type dont le type est un type 'symbole unique' doit être 'readonly'.]]></Val>
<Val><![CDATA[Une propriété d'une interface ou d'un littéral de type dont le type est un type 'unique symbol' doit être 'readonly'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -805,7 +805,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une variable dont le type est un type 'symbole unique' doit être 'const'.]]></Val>
<Val><![CDATA[Une variable dont le type est un type 'unique symbol' doit être 'const'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -875,52 +875,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajoutez '{0}' à une déclaration d'importation existante à partir de "{1}".]]></Val>
<Val><![CDATA[Ajouter '{0}' à la déclaration d'importation existante de "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajoutez une signature d'index pour la propriété '{0}'.]]></Val>
<Val><![CDATA[Ajouter une signature d'index pour la propriété '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajoutez l'appel manquant à 'super()'.]]></Val>
<Val><![CDATA[Ajouter l'appel manquant à 'super()']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ajoutez 'this.' à la variable non résolue.]]></Val>
<Val><![CDATA[Ajouter 'this.' à la variable non résolue]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[L'ajout d'un fichier tsconfig.json permet d'organiser les projets qui contiennent des fichiers TypeScript et JavaScript. En savoir plus sur https://aka.ms/tsconfig.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1550,10 +1556,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Appelez l'expression de l'élément décoratif.]]></Val>
<Val><![CDATA[Appeler l'expression de l'élément décoratif]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1964,34 +1973,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Changez '{0}' en '{1}'.]]></Val>
<Val><![CDATA[Changer '{0}' en '{1}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Changez 'extends' en 'implements'.]]></Val>
<Val><![CDATA[Changer 'extends' en 'implements']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Changez l'orthographe en '{0}'.]]></Val>
<Val><![CDATA[Changer l'orthographe en '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2067,6 +2079,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_0_incorrectly_implements_interface_1_2420" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class '{0}' incorrectly implements interface '{1}'.]]></Val>
@@ -2363,37 +2381,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déclarez la méthode '{0}'.]]></Val>
<Val><![CDATA[Déclarer la méthode '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déclarez la propriété '{0}'.]]></Val>
<Val><![CDATA[Déclarer la propriété '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déclarez la méthode statique '{0}'.]]></Val>
<Val><![CDATA[Déclarer la méthode statique '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déclarez la propriété statique '{0}'.]]></Val>
<Val><![CDATA[Déclarer la propriété statique '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2471,10 +2501,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Désactivez la vérification de ce fichier.]]></Val>
<Val><![CDATA[Désactiver la vérification de ce fichier]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3438,15 +3471,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une spécification de fichier ne peut pas contenir plusieurs caractères génériques de répertoires récursifs ('**') : '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3740,31 +3764,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ignorez ce message d'erreur.]]></Val>
<Val><![CDATA[Ignorer ce message d'erreur]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implémentez la classe abstraite héritée.]]></Val>
<Val><![CDATA[Implémenter la classe abstraite héritée]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implémentez l'interface '{0}'.]]></Val>
<Val><![CDATA[Implémenter l'interface '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3779,10 +3809,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importez '{0}' à partir du module "{1}".]]></Val>
<Val><![CDATA[Importer '{0}' à partir du module "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3929,37 +3962,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déduisez les types des paramètres à partir de l'utilisation.]]></Val>
<Val><![CDATA[Déduire les types des paramètres à partir de l'utilisation]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Déduisez le type de '{0}' à partir de l'utilisation.]]></Val>
<Val><![CDATA[Déduire le type de '{0}' à partir de l'utilisation]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Initialisez la propriété '{0}' dans le constructeur.]]></Val>
<Val><![CDATA[Initialiser la propriété '{0}' dans le constructeur]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Initialisez la propriété statique '{0}'.]]></Val>
<Val><![CDATA[Initialiser la propriété statique '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4490,10 +4535,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Faites de l'appel à 'super()' la première instruction du constructeur.]]></Val>
<Val><![CDATA[Faire de l'appel à 'super()' la première instruction du constructeur]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4710,6 +4758,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les séparateurs numériques consécutifs multiples ne sont pas autorisés.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4800,6 +4857,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les séparateurs numériques ne sont pas autorisés ici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -4876,7 +4942,7 @@
<Str Cat="Text">
<Val><![CDATA[Octal literals are not allowed in enums members initializer. Use the syntax '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les littéraux octaux ne sont pas autorisés dans l'initialiseur des membres d'énumérations. Utilisez la syntaxe '{0}'.]]></Val>
<Val><![CDATA[Les littéraux octaux ne sont pas autorisés dans l'initialiseur des membres d'enums. Utilisez la syntaxe '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -5405,10 +5471,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Préfixez '{0}' avec un trait de soulignement.]]></Val>
<Val><![CDATA[Faire précéder '{0}' d'un trait de soulignement]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5858,10 +5927,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Supprimez la déclaration pour : '{0}'.]]></Val>
<Val><![CDATA[Supprimer la déclaration pour : '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6284,10 +6356,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Réécrire en tant que type d'accès indexé '{0}'.]]></Val>
<Val><![CDATA[Réécrire en tant que type d'accès indexé '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6399,15 +6474,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Spécifiez la version cible d'ECMAScript : 'ES3' (par défaut), 'ES5', 'ES2015', 'ES2016', 'ES2017' ou 'ESNEXT'.]]></Val>
<Val><![CDATA[Spécifiez la version cible d'ECMAScript : 'ES3' (par défaut), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' ou 'ESNEXT'.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6513,6 +6585,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Démarrage de la compilation en mode espion...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6591,6 +6672,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les prochaines déclarations de propriétés doivent avoir le même type. La propriété '{0}' doit avoir le type '{1}', mais elle a ici le type '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7359,11 +7443,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' ne peut pas être assigné au type '{1}'. Il existe deux types distincts portant ce nom, mais ils ne sont pas liés.]]></Val>
<Val><![CDATA[Impossible d'assigner le type '{0}' au type '{1}'. Il existe deux types distincts portant ce nom, mais ils ne sont pas liés.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8875,7 +8959,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les types 'symbole unique' ne sont pas autorisés ici.]]></Val>
<Val><![CDATA[Les types 'unique symbol' ne sont pas autorisés ici.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8884,7 +8968,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les types 'symbole unique' sont uniquement autorisés sur les variables d'une déclaration de variable.]]></Val>
<Val><![CDATA[Les types 'unique symbol' sont uniquement autorisés sur les variables d'une déclaration de variable.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8893,7 +8977,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les types 'symbole unique' ne peuvent pas être utilisés dans une déclaration de variable avec un nom de liaison.]]></Val>
<Val><![CDATA[Les types 'unique symbol' ne peuvent pas être utilisés dans une déclaration de variable avec un nom de liaison.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -866,52 +866,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aggiungere '{0}' alla dichiarazione di importazione esistente da "{1}".]]></Val>
<Val><![CDATA[Aggiungere '{0}' alla dichiarazione di importazione esistente da "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aggiungere la firma dell'indice per la proprietà '{0}'.]]></Val>
<Val><![CDATA[Aggiungere la firma dell'indice per la proprietà '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aggiunge la chiamata mancante a 'super()'.]]></Val>
<Val><![CDATA[Aggiungere la chiamata mancante a 'super()']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aggiungi 'this.' alla variabile non risolta.]]></Val>
<Val><![CDATA[Aggiungere 'this.' alla variabile non risolta]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aggiungere un file tsconfig.json per organizzare più facilmente progetti che contengono sia file TypeScript che JavaScript. Per altre informazioni, vedere https://aka.ms/tsconfig.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1054,7 +1060,7 @@
<Str Cat="Text">
<Val><![CDATA[An arithmetic operand must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un operando aritmetico deve essere di tipo 'any', 'number' o un tipo di enum.]]></Val>
<Val><![CDATA[Un operando aritmetico deve essere di tipo 'any', 'number' o un tipo di enumerazione.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1099,7 +1105,7 @@
<Str Cat="Text">
<Val><![CDATA[An enum member cannot have a numeric name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il nome di un membro enum non può essere numerico.]]></Val>
<Val><![CDATA[Il nome di un membro di enumerazione non può essere numerico.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1541,10 +1547,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Chiama l'espressione Decorator.]]></Val>
<Val><![CDATA[Chiamare l'espressione Decorator]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1955,34 +1964,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambia '{0}' in '{1}'.]]></Val>
<Val><![CDATA[Modificare '{0}' in '{1}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambia 'extends' in 'implements'.]]></Val>
<Val><![CDATA[Cambiare 'extends' in 'implements']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Modificare l'ortografia in '{0}'.]]></Val>
<Val><![CDATA[Modificare l'ortografia in '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2146,7 +2158,7 @@
<Str Cat="Text">
<Val><![CDATA[Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Compila il progetto di cui è stato specificato il percorso del file di configurazione o di una cartella contenente un file 'tsconfig.json'.]]></Val>
<Val><![CDATA[Compila il progetto in base al percorso del file di configurazione o della cartella contenente un file 'tsconfig.json'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2354,37 +2366,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dichiarare il metodo '{0}'.]]></Val>
<Val><![CDATA[Dichiarare il metodo '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dichiarare la proprietà '{0}'.]]></Val>
<Val><![CDATA[Dichiarare la proprietà '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dichiarare il metodo statico '{0}'.]]></Val>
<Val><![CDATA[Dichiarare il metodo statico '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dichiarare la proprietà statica '{0}'.]]></Val>
<Val><![CDATA[Dichiarare la proprietà statica '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2462,10 +2486,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Disabilita la verifica per questo file.]]></Val>
<Val><![CDATA[Disabilitare la verifica per questo file]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2554,7 +2581,7 @@
<Str Cat="Text">
<Val><![CDATA[Do not erase const enum declarations in generated code.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Non cancella le dichiarazioni enum const nel codice generato.]]></Val>
<Val><![CDATA[Non cancella le dichiarazioni di enumerazione const nel codice generato.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2800,7 +2827,7 @@
<Str Cat="Text">
<Val><![CDATA[Emit a single file with source maps instead of having a separate file.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Crea un unico file con i mapping d origine invece di file separati.]]></Val>
<Val><![CDATA[Crea un unico file con i mapping di origine invece di file separati.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2827,7 +2854,7 @@
<Str Cat="Text">
<Val><![CDATA[Enable strict checking of function types.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Abilitare il controllo tassativo dei tipi funzione.]]></Val>
<Val><![CDATA[Abilita il controllo tassativo dei tipi funzione.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2899,7 +2926,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum declarations must all be const or non-const.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le dichiarazioni enum devono essere tutte const o tutte non const.]]></Val>
<Val><![CDATA[Le dichiarazioni di enumerazione devono essere tutte const o tutte non const.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2908,7 +2935,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum member expected.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[È previsto il membro enum.]]></Val>
<Val><![CDATA[È previsto il membro di enumerazione.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2917,7 +2944,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum member must have initializer.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il membro enum deve contenere l'inizializzatore.]]></Val>
<Val><![CDATA[Il membro di enumerazione deve contenere l'inizializzatore.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3001,7 +3028,7 @@
<Str Cat="Text">
<Val><![CDATA[Expected {0} type arguments; provide these with an '@extends' tag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Sono previsti argomento tipo {0}. Per specificarli, usare un tag '@extends'.]]></Val>
<Val><![CDATA[Sono previsti {0} argomenti tipo. Per specificarli, usare un tag '@extends'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3019,7 +3046,7 @@
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1} or more.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Sono previsti almeno {0} argomenti, ma ne sono stati ottenuti più di {1}.]]></Val>
<Val><![CDATA[Sono previsti almeno {0} argomenti, ma ne sono stati ottenuti {1} o più.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3429,15 +3456,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La specifica del file non può contenere più caratteri jolly ('**') di directory ricorsiva: '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3731,31 +3749,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ignora questo messaggio di errore.]]></Val>
<Val><![CDATA[Ignorare questo messaggio di errore]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementa la classe astratta ereditata.]]></Val>
<Val><![CDATA[Implementare la classe astratta ereditata]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementa l'interfaccia '{0}'.]]></Val>
<Val><![CDATA[Implementare l'interfaccia '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3770,10 +3794,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importa '{0}' dal modulo "{1}".]]></Val>
<Val><![CDATA[Importare '{0}' dal modulo "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3859,7 +3886,7 @@
<Str Cat="Text">
<Val><![CDATA[In ambient enum declarations member initializer must be constant expression.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nelle dichiarazioni enum dell'ambiente l'inizializzatore di membro deve essere un'espressione costante.]]></Val>
<Val><![CDATA[Nelle dichiarazioni di enumerazione dell'ambiente l'inizializzatore di membro deve essere un'espressione costante.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3868,7 +3895,7 @@
<Str Cat="Text">
<Val><![CDATA[In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[In un'enumerazione con più dichiarazioni solo una di queste può omettere un inizializzatore per il primo elemento enum.]]></Val>
<Val><![CDATA[In un'enumerazione con più dichiarazioni solo una di queste può omettere un inizializzatore per il primo elemento dell'enumerazione.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3877,7 +3904,7 @@
<Str Cat="Text">
<Val><![CDATA[In 'const' enum declarations member initializer must be constant expression.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nelle dichiarazioni enum 'const' l'inizializzatore di membro deve essere un'espressione costante.]]></Val>
<Val><![CDATA[Nelle dichiarazioni di enumerazione 'const' l'inizializzatore di membro deve essere un'espressione costante.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3920,37 +3947,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deriva i tipi di parametro dall'utilizzo.]]></Val>
<Val><![CDATA[Derivare i tipi di parametro dall'utilizzo]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deriva il tipo di '{0}' dall'utilizzo.]]></Val>
<Val><![CDATA[Derivare il tipo di '{0}' dall'utilizzo]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inizializza la proprietà '{0}' nel costruttore.]]></Val>
<Val><![CDATA[Inizializzare la proprietà '{0}' nel costruttore]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inizializza la proprietà statica '{0}'.]]></Val>
<Val><![CDATA[Inizializzare la proprietà statica '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4481,10 +4520,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Imposta la chiamata a 'super()' come prima istruzione nel costruttore.]]></Val>
<Val><![CDATA[Impostare la chiamata a 'super()' come prima istruzione nel costruttore]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4701,6 +4743,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Non sono consentiti più separatori numerici consecutivi.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4791,6 +4842,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[I separatori numerici non sono consentiti in questa posizione.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5396,10 +5456,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Anteporre un carattere di sottolineatura a '{0}'.]]></Val>
<Val><![CDATA[Anteporre un carattere di sottolineatura a '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5849,10 +5912,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Rimuovi la dichiarazione per {0}.]]></Val>
<Val><![CDATA[Rimuovere la dichiarazione per '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6223,7 +6289,7 @@
<Str Cat="Text">
<Val><![CDATA[Return type of public static getter '{0}' from exported class has or is using private name '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il tipo restituito del getter di proprietà pubblico '{0}' della classe esportata contiene o usa il nome privato '{1}'.]]></Val>
<Val><![CDATA[Il tipo restituito del getter statico pubblico '{0}' della classe esportata contiene o usa il nome privato '{1}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -6275,10 +6341,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Riscrivere come tipo di accesso indicizzato '{0}'.]]></Val>
<Val><![CDATA[Riscrivere come tipo di accesso indicizzato '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6390,15 +6459,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Specifica la versione di destinazione di ECMAScript: 'ES3' (predefinita), 'ES5', 'ES2015', 'ES2016', 'ES2017' o 'ESNEXT'.]]></Val>
<Val><![CDATA[Specificare la versione di destinazione di ECMAScript: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' o 'ESNEXT'.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6504,6 +6570,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Avvio della compilazione in modalità espressione di controllo...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6582,6 +6657,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le dichiarazioni di proprietà successive devono essere dello stesso tipo. La proprietà '{0}' deve essere di tipo '{1}', ma qui è di tipo '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7063,7 +7141,7 @@
<Str Cat="Text">
<Val><![CDATA[The target of an object rest assignment must be a variable or a property access.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La destinazione di un'assegnazione rimanente dell'oggetto deve essere una variabile o un accesso a proprietà.]]></Val>
<Val><![CDATA[La destinazione di un'assegnazione REST di oggetto deve essere una variabile o un accesso a proprietà.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -7350,7 +7428,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8395,7 +8473,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enum member initializer was evaluated to a non-finite value.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[L'inizializzatore di membro enum 'const' è stato valutato come valore non finito.]]></Val>
<Val><![CDATA[L'inizializzatore del membro di enumerazione 'const' è stato valutato come valore non finito.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8404,7 +8482,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enum member initializer was evaluated to disallowed value 'NaN'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[L'inizializzatore di membro enum 'const' è stato valutato come valore non consentito 'NaN'.]]></Val>
<Val><![CDATA[L'inizializzatore del membro di enumerazione 'const' è stato valutato come valore non consentito 'NaN'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
File diff suppressed because it is too large Load Diff
@@ -145,7 +145,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[클래스 속성 선언의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.]]></Val>
<Val><![CDATA[클래스 속성 선언의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -154,7 +154,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[메서드 오버로드의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.]]></Val>
<Val><![CDATA[메서드 오버로드의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -163,7 +163,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[리터럴 형식의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.]]></Val>
<Val><![CDATA[리터럴 형식의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -172,7 +172,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[앰비언트 컨텍스트의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.]]></Val>
<Val><![CDATA[앰비언트 컨텍스트의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -181,7 +181,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[인터페이스의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.]]></Val>
<Val><![CDATA[인터페이스의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -337,7 +337,7 @@
<Str Cat="Text">
<Val><![CDATA[A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[동적 가져오기 호출은 'Promise'를 반환해야 합니다. 'Promise'에 대한 선언이 있거나 `--lib` 옵션에 'ES2015'가 포함되었는지 확인하세요.]]></Val>
<Val><![CDATA[동적 가져오기 호출은 'Promise'를 반환합니다. 'Promise'에 대한 선언이 있거나 `--lib` 옵션에 'ES2015'가 포함되었는지 확인하세요.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -532,7 +532,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[형식이 '고유 기호' 형식인 클래스의 속성은 'static'과 'readonly' 둘 다여야 합니다.]]></Val>
<Val><![CDATA[형식이 'unique symbol' 형식인 클래스의 속성은 'static'과 'readonly' 둘 다여야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -541,7 +541,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[형식이 '고유 기호' 형식인 인터페이스 또는 형식 리터럴의 속성은 'readonly'여야 합니다.]]></Val>
<Val><![CDATA[형식이 'unique symbol' 형식인 인터페이스 또는 형식 리터럴의 속성은 'readonly'여야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -796,7 +796,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[형식이 '고유한 기호' 형식인 변수는 'const'여야 합니다.]]></Val>
<Val><![CDATA[형식이 'unique symbol' 형식인 변수는 'const'여야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -866,52 +866,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{1}"에서 기존 가져오기 선언에 '{0}'을(를) 추가합니다.]]></Val>
<Val><![CDATA["{1}"에서 기존 가져오기 선언에 '{0}' 추가]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 속성에 대해 인덱스 시그니처 추가합니다.]]></Val>
<Val><![CDATA['{0}' 속성에 대해 인덱스 시그니처 추가]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[누락된 'super()' 호출 추가하세요.]]></Val>
<Val><![CDATA[누락된 'super()' 호출 추가]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[확인되지 않은 변수에 'this.' 추가하세요.]]></Val>
<Val><![CDATA[확인되지 않은 변수에 'this.' 추가]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[tsconfig.json 파일을 추가하면 TypeScript 파일과 JavaScript 파일이 둘 다 포함된 프로젝트를 정리하는 데 도움이 됩니다. 자세한 내용은 https://aka.ms/tsconfig를 참조하세요.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1541,10 +1547,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[decorator 호출합니다.]]></Val>
<Val><![CDATA[데코레이터 식 호출]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1955,34 +1964,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}'을(를) '{1}'(으)로 변경합니다.]]></Val>
<Val><![CDATA['{0}'을(를) '{1}'(으)로 변경]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['extends'를 'implements'로 변경하세요.]]></Val>
<Val><![CDATA['extends'를 'implements'로 변경]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[철자를 '{0}'(으)로 변경하세요.]]></Val>
<Val><![CDATA[맞춤법을 '{0}'(으)로 변경]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2058,6 +2070,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_0_incorrectly_implements_interface_1_2420" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class '{0}' incorrectly implements interface '{1}'.]]></Val>
@@ -2354,37 +2372,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 메서드 선언합니다.]]></Val>
<Val><![CDATA['{0}' 메서드 선언]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 속성 선언합니다.]]></Val>
<Val><![CDATA['{0}' 속성 선언]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 정적 메서드 선언합니다.]]></Val>
<Val><![CDATA['{0}' 정적 메서드 선언]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[정적 속성 '{0}'을(를) 선언합니다.]]></Val>
<Val><![CDATA['{0}' 정적 속성 선언]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2462,10 +2492,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[이 파일 확인을 사용하지 않도록 설정합니다.]]></Val>
<Val><![CDATA[이 파일 확인을 사용하지 않도록 설정]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2764,7 +2797,7 @@
<Str Cat="Text">
<Val><![CDATA[Dynamic import's specifier must be of type 'string', but here has type '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[동적 가져오기의 지정자는 'string' 형식이어야 하지만 여기에 '{0}' 형식이 있습니다.]]></Val>
<Val><![CDATA[동적 가져오기의 지정자는 'string' 형식이어야 하지만 여기에서 형식은 '{0}'니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2836,7 +2869,7 @@
<Str Cat="Text">
<Val><![CDATA[Enable strict checking of property initialization in classes.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[클래스의 속성 초기화에 대해 엄격한 검사를 사용합니다.]]></Val>
<Val><![CDATA[클래스의 속성 초기화에 대해 엄격한 검사를 사용하도록 설정합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3082,7 +3115,7 @@
<Str Cat="Text">
<Val><![CDATA[Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[ECMAScript 모듈을 대상으로 하는 경우 할당 내보내기 사용할 수 없습니다. 대신 'export default'나 다른 모듈 형식 사용을 고려하세요.]]></Val>
<Val><![CDATA[ECMAScript 모듈을 대상으로 하는 경우 내보내기 할당을 사용할 수 없습니다. 대신 'export default'나 다른 모듈 형식 사용을 고려하세요.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3175,7 +3208,7 @@
<Str Cat="Text">
<Val><![CDATA[Exports and export assignments are not permitted in module augmentations.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[내보내기 및 할당 내보내기는 모듈 확대에서 허용되지 않습니다.]]></Val>
<Val><![CDATA[내보내기 및 내보내기 할당는 모듈 확대에서 허용되지 않습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3429,15 +3462,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[파일 사양은 여러 개의 재귀 디렉터리 와일드카드('**')를 포함할 수 없습니다. '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3731,31 +3755,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[이 오류 메시지 무시합니다.]]></Val>
<Val><![CDATA[이 오류 메시지 무시]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[상속된 추상 클래스 구현하세요.]]></Val>
<Val><![CDATA[상속된 추상 클래스 구현]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 인터페이스 구현하세요.]]></Val>
<Val><![CDATA['{0}' 인터페이스 구현]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3770,10 +3800,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{1}" 모듈에서 '{0}'을(를) 가져옵니다.]]></Val>
<Val><![CDATA["{1}" 모듈에서 '{0}' 가져오기]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3920,37 +3953,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[사용량에서 매개 변수 형식 유추합니다.]]></Val>
<Val><![CDATA[사용량에서 매개 변수 형식 유추]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[사용량에서 '{0}'의 형식 유추합니다.]]></Val>
<Val><![CDATA[사용량에서 '{0}'의 형식 유추]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[생성자에서 속성 '{0}'을(를) 초기화합니다.]]></Val>
<Val><![CDATA[생성자에서 속성 '{0}' 초기화]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[정적 속성 '{0}'을(를) 초기화합니다.]]></Val>
<Val><![CDATA[정적 속성 '{0}' 초기화]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4441,7 +4486,7 @@
<Str Cat="Text">
<Val><![CDATA[Loading module as file / folder, candidate module location '{0}', target file type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[모듈을 파일/폴더로 로드하고 있습니다. 후보 모듈 위치: '{0}', 대상 파일 형식: '{1}'.]]></Val>
<Val><![CDATA[모듈을 파일/폴더로 로드하고 있습니다. 후보 모듈 위치 '{0}', 대상 파일 형식 '{1}'입니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -4481,10 +4526,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[생성자의 첫 번째 문을 'super()'로 호출하세요.]]></Val>
<Val><![CDATA[생성자의 첫 번째 문을 'super()'로 호출]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4701,6 +4749,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[여러 개의 연속된 숫자 구분 기호는 허용되지 않습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4791,6 +4848,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[숫자 구분 기호는 여기에서 허용되지 않습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5396,10 +5462,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' 앞에 밑줄을 붙이세요.]]></Val>
<Val><![CDATA['{0}' 앞에 밑줄 추가]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5849,10 +5918,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}'에 대한 선언 제거합니다.]]></Val>
<Val><![CDATA['{0}'에 대한 선언 제거]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6275,10 +6347,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[인덱싱된 액세스 형식 '{0}'(으)로 다시 작성하세요.]]></Val>
<Val><![CDATA[인덱싱된 액세스 형식 '{0}'(으)로 다시 작성]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6390,15 +6465,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[ECMAScript 대상 버전을 'ES3'(기본값), 'ES5', 'ES2015', 'ES2016', 'ES2017' 또는 'ESNEXT'로 지정합니다.]]></Val>
<Val><![CDATA[ECMAScript 대상 버전을 'ES3'(기본값), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' 또는 'ESNEXT'로 지정합니다.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6504,6 +6576,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[감시 모드에서 컴파일을 시작하는 중...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6582,6 +6663,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[후속 속성 선언에 같은 형식이 있어야 합니다. '{0}' 속성이 '{1}' 형식이어야 하는데 여기에는 '{2}' 형식이 있습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7350,7 +7434,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8866,7 +8950,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[여기에서 '고유 기호' 형식은 허용되지 않습니다.]]></Val>
<Val><![CDATA[여기에서 'unique symbol' 형식은 허용되지 않습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8875,7 +8959,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['고유 기호' 형식은 변수 문의 변수에만 허용됩니다.]]></Val>
<Val><![CDATA['unique symbol' 형식은 변수 문의 변수에만 허용됩니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8884,7 +8968,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['고유 기호' 형식은 바인딩 이름과 함께 변수 선언에 사용할 수 없습니다.]]></Val>
<Val><![CDATA['unique symbol' 형식은 바인딩 이름과 함께 변수 선언에 사용할 수 없습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -138,7 +138,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwa właściwości obliczanej w deklaracji właściwości klasy musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.]]></Val>
<Val><![CDATA[Nazwa właściwości obliczanej w deklaracji właściwości klasy musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -147,7 +147,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwa właściwości obliczanej w przeciążeniu metody musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.]]></Val>
<Val><![CDATA[Nazwa właściwości obliczanej w przeciążeniu metody musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -156,7 +156,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwa właściwości obliczanej w typie literału musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.]]></Val>
<Val><![CDATA[Nazwa właściwości obliczanej w typie literału musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -165,7 +165,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwa właściwości obliczanej w otaczającym kontekście musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.]]></Val>
<Val><![CDATA[Nazwa właściwości obliczanej w otaczającym kontekście musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -174,7 +174,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nazwa właściwości obliczanej w interfejsie musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.]]></Val>
<Val><![CDATA[Nazwa właściwości obliczanej w interfejsie musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -525,7 +525,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Właściwość klasy, której typem jest typ „unikatowy symbol”, musi być „static” i „readonly”.]]></Val>
<Val><![CDATA[Właściwość klasy, której typem jest „unique symbol”, musi być określona zarówno jako „static”, jak i „readonly”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -534,7 +534,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Właściwość interfejsu lub typu, którego typem jest typ „unikatowy symbol”, musi być „readonly”.]]></Val>
<Val><![CDATA[Właściwość klasy, której typem jest literał lub „unique symbol”, musi być określona zarówno jako „static”, jak i „readonly”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -786,7 +786,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zmienna, której typem jest typ „unikatowy symbol”, musi być „const”.]]></Val>
<Val><![CDATA[Zmienna, której typem „unique symbol”, musi być określona jako „const”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -856,44 +856,53 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dodaj element „{0}” do istniejącej deklaracji importu z elementu „{1}”.]]></Val>
<Val><![CDATA[Dodaj element „{0}” do istniejącej deklaracji importu z elementu „{1}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dodaj sygnaturę indeksu dla właściwości „{0}”.]]></Val>
<Val><![CDATA[Dodaj sygnaturę indeksu dla właściwości „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dodaj brakujące wywołanie „super()”.]]></Val>
<Val><![CDATA[Dodaj brakujące wywołanie „super()”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dodaj „this.” do nierozpoznanej zmiennej.]]></Val>
<Val><![CDATA[Dodaj „this.” do nierozpoznanej zmiennej]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -1365,7 +1374,7 @@
<Str Cat="Text">
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dodaj adnotację przy użyciu typu z JSDoc]]></Val>
<Val><![CDATA[Dodaj adnotację z typem z danych JSDoc]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1374,7 +1383,7 @@
<Str Cat="Text">
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dodaj adnotację przy użyciu typów z JSDoc]]></Val>
<Val><![CDATA[Dodaj adnotację z typami z danych JSDoc]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1528,10 +1537,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Wywołaj wyrażenie dekoratora.]]></Val>
<Val><![CDATA[Wywołaj wyrażenie dekoratora]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1942,31 +1954,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zmień element „{0}” na „{1}”.]]></Val>
<Val><![CDATA[Zmień element „{0}” na „{1}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zmień atrybut „extends” na „implements”.]]></Val>
<Val><![CDATA[Zmień atrybut „extends” na „implements”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zmiana pisowni na „{0}”.]]></Val>
<Val><![CDATA[Zmi pisownię na „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2338,37 +2356,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zadeklaruj metodę „{0}”.]]></Val>
<Val><![CDATA[Zadeklaruj metodę „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zadeklaruj właściwość „{0}”.]]></Val>
<Val><![CDATA[Zadeklaruj właściwość „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zadeklaruj metodę statyczną „{0}”.]]></Val>
<Val><![CDATA[Zadeklaruj metodę statyczną „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zadeklaruj właściwość statyczną „{0}”.]]></Val>
<Val><![CDATA[Zadeklaruj właściwość statyczną „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2446,10 +2476,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Wyłącz sprawdzanie dla tego pliku.]]></Val>
<Val><![CDATA[Wyłącz sprawdzanie dla tego pliku]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3413,15 +3446,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Specyfikacja pliku nie może zawierać wielu cyklicznych symboli wieloznacznych katalogu („**”): „{0}”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3715,28 +3739,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ignoruj ten komunikat o błędzie.]]></Val>
<Val><![CDATA[Ignoruj ten komunikat o błędzie]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementuj odziedziczoną klasę abstrakcyjną.]]></Val>
<Val><![CDATA[Wdróż odziedziczoną klasę abstrakcyjną]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implementuj interfejs „{0}”.]]></Val>
<Val><![CDATA[Implementuj interfejs „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3751,10 +3784,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Import „{0}” z modułu „{1}”.]]></Val>
<Val><![CDATA[Importuj element „{0}” z modułu „{1}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3901,37 +3937,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Wywnioskuj typy parametrów na podstawie użycia.]]></Val>
<Val><![CDATA[Wnioskuj typy parametrów na podstawie użycia]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Wywnioskuj typ elementu „{0}” na podstawie użycia.]]></Val>
<Val><![CDATA[Wnioskuj typ elementu „{0}” na podstawie użycia]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zainicjuj właściwość „{0}” w konstruktorze.]]></Val>
<Val><![CDATA[Zainicjuj właściwość „{0}” w konstruktorze]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zainicjuj właściwość statyczną „{0}”.]]></Val>
<Val><![CDATA[Zainicjuj właściwość statyczną „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4462,10 +4510,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ustaw wywołanie „super()” jako pierwszą instrukcję w konstruktorze.]]></Val>
<Val><![CDATA[Ustaw wywołanie „super()” jako pierwszą instrukcję w konstruktorze]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4682,6 +4733,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kolejne następujące po sobie separatory liczbowe nie są dozwolone.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4772,6 +4832,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Separatory liczbowe nie są dozwolone w tym miejscu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5374,10 +5443,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Prefiks „{0}” z podkreśleniem.]]></Val>
<Val><![CDATA[Poprzedzaj elementy „{0}” znakiem podkreślenia]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5827,10 +5899,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Usuń deklarację dla: „{0}”.]]></Val>
<Val><![CDATA[Usuń deklarację dla: „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6250,10 +6325,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zapisz ponownie jako typ dostępu indeksowanego „{0}”.]]></Val>
<Val><![CDATA[Napisz ponownie jako indeksowany typ dostępu „{0}”]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6365,11 +6443,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Podaj wersję docelową języka ECMAScript: „ES3” (domyślna), „ES5”, „ES2015”, „ES2016”, „ES2017” lub „ESNEXT”.]]></Val>
<Val><![CDATA[Podaj wersję docelową języka ECMAScript: „ES3” (domyślna), „ES5”, „ES2015”, „ES2016”, „ES2017”, „ES2018” lub „ESNEXT”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -6476,6 +6554,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Trwa uruchamianie kompilacji w trybie śledzenia...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6554,6 +6641,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kolejne deklaracje właściwości muszą być tego samego typu. Właściwość „{0}” musi być typu „{1}”, ale w tym miejscu jest typu „{2}”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7322,7 +7412,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8838,7 +8928,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typy „unikatowy symbol” nie są dozwolone w tym miejscu.]]></Val>
<Val><![CDATA[Typy „unique symbol” nie są dozwolone w tym miejscu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8847,7 +8937,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typy „unikatowy symbol” są dozwolone tylko w zmiennych w instrukcji zmiennej.]]></Val>
<Val><![CDATA[Typy „unique symbol” są dozwolone tylko w zmiennych w instrukcji zmiennej.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8856,7 +8946,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typów „unikatowy symbol” nie można używać w deklaracji zmiennej z nazwą powiązania.]]></Val>
<Val><![CDATA[Typów „unique symbol” nie można używać w deklaracji zmiennej z nazwą powiązania.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -138,7 +138,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um nome de propriedade computado em uma declaração de propriedade de classe deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.]]></Val>
<Val><![CDATA[Um nome de propriedade computado em uma declaração de propriedade de classe deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -147,7 +147,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um nome de propriedade computado em uma sobrecarga do método deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.]]></Val>
<Val><![CDATA[Um nome de propriedade computado em uma sobrecarga do método deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -156,7 +156,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um nome de propriedade computado em um tipo literal deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.]]></Val>
<Val><![CDATA[Um nome de propriedade computado em um tipo literal deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -165,7 +165,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um nome de propriedade computado em um contexto de ambiente deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.]]></Val>
<Val><![CDATA[Um nome de propriedade computado em um contexto de ambiente deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -174,7 +174,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um nome de propriedade computado em uma interface deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.]]></Val>
<Val><![CDATA[Um nome de propriedade computado em uma interface deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -210,7 +210,7 @@
<Str Cat="Text">
<Val><![CDATA[A 'const' initializer in an ambient context must be a string or numeric literal.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um inicializador "const" em um contexto de ambiente deve ser uma cadeia ou um literal numérico.]]></Val>
<Val><![CDATA[Um inicializador 'const' em um contexto de ambiente deve ser uma cadeia ou um literal numérico.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -276,7 +276,7 @@
<Str Cat="Text">
<Val><![CDATA[A decorator can only decorate a method implementation, not an overload.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um decorador pode decoras somente uma implementação de método, não uma sobrecarga.]]></Val>
<Val><![CDATA[Um decorador pode decorar somente uma implementação de método, não uma sobrecarga.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -411,7 +411,7 @@
<Str Cat="Text">
<Val><![CDATA[A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O inicializador de um membro em uma declaração enum não pode referenciar membros declarados depois dele, inclusive membros definidos em outros enums.]]></Val>
<Val><![CDATA[O inicializador de um membro em uma declaração de enumeração não pode referenciar membros declarados depois dele, inclusive membros definidos em outras enumerações.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -525,7 +525,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma propriedade de uma classe cujo tipo é um tipo de 'símbolo exclusivo' deve ser 'estática' e 'somente leitura'.]]></Val>
<Val><![CDATA[Uma propriedade de uma classe cujo tipo é um tipo de 'unique symbol' deve ser 'static' e 'readonly'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -534,7 +534,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma propriedade de uma interface ou tipo literal cujo tipo é um tipo de 'símbolo exclusivo' deve ser 'somente leitura'.]]></Val>
<Val><![CDATA[Uma propriedade de uma interface ou tipo literal cujo tipo é um tipo de 'unique symbol' deve ser 'readonly'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -786,7 +786,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma variável cujo tipo é um tipo de 'símbolo exclusivo' deve ser 'const'.]]></Val>
<Val><![CDATA[Uma variável cujo tipo é um tipo de 'unique symbol' deve ser 'const'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -856,48 +856,57 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adicione "{0}" à declaração de importação existente de "{1}".]]></Val>
<Val><![CDATA[Adicionar '{0}' à declaração de importação existente de "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adicione assinatura de índice para a propriedade '{0}'.]]></Val>
<Val><![CDATA[Adicionar assinatura de índice para a propriedade '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adicionar chamada 'super()' ausente.]]></Val>
<Val><![CDATA[Adicionar chamada 'super()' ausente]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adicione 'this.' a uma variável não resolvida.]]></Val>
<Val><![CDATA[Adicionar 'this.' a uma variável não resolvida]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adicionar um arquivo tsconfig.json ajuda a organizar projetos que contêm arquivos TypeScript e JavaScript. Saiba mais em https://aka.ms/tsconfig.]]></Val>
<Val><![CDATA[Adicionar um arquivo tsconfig.json ajuda a organizar projetos que contêm arquivos TypeScript e JavaScript. Saiba mais em https://aka.ms/tsconfig.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1041,7 +1050,7 @@
<Str Cat="Text">
<Val><![CDATA[An arithmetic operand must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um operando aritmético deve ser do tipo 'any', 'number' ou um tipo enum.]]></Val>
<Val><![CDATA[Um operando aritmético deve ser do tipo 'any', 'number' ou um tipo de enumeração.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1086,7 +1095,7 @@
<Str Cat="Text">
<Val><![CDATA[An enum member cannot have a numeric name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Um membro enum não pode ter um nome numérico.]]></Val>
<Val><![CDATA[Um membro de enumeração não pode ter um nome numérico.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1528,10 +1537,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Chamar expressão decoradora.]]></Val>
<Val><![CDATA[Chamar expressão do decorador]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1942,31 +1954,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Alterar '{0}' para '{1}'.]]></Val>
<Val><![CDATA[Alterar '{0}' para '{1}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Altere 'extends' para 'implements'.]]></Val>
<Val><![CDATA[Alterar 'extends' para 'implements']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Alterar ortografia para '{0}'.]]></Val>
<Val><![CDATA[Alterar ortografia para '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2166,7 +2184,7 @@
<Str Cat="Text">
<Val><![CDATA[Computed values are not permitted in an enum with string valued members.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Os valores computados não são permitidos em um enum com membros de valor de cadeia de caracteres.]]></Val>
<Val><![CDATA[Os valores computados não são permitidos em uma enumeração com membros de valor de cadeia de caracteres.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2338,37 +2356,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare o método '{0}'.]]></Val>
<Val><![CDATA[Declarar método '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare a propriedade '{0}'.]]></Val>
<Val><![CDATA[Declarar propriedade '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare o método estático '{0}'.]]></Val>
<Val><![CDATA[Declarar método estático '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declare a propriedade estática "{0}".]]></Val>
<Val><![CDATA[Declarar propriedade estática '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2446,10 +2476,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Desabilitar a verificação para esse arquivo.]]></Val>
<Val><![CDATA[Desabilitar a verificação para esse arquivo]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2874,7 +2907,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum '{0}' used before its declaration.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Enum '{0}' usada antes de sua declaração.]]></Val>
<Val><![CDATA[A enumeração '{0}' usada antes de sua declaração.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2883,7 +2916,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum declarations must all be const or non-const.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declarações enum devem ser const ou não const.]]></Val>
<Val><![CDATA[Declarações de enumeração devem ser const ou não const.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2892,7 +2925,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum member expected.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Membro enum esperado.]]></Val>
<Val><![CDATA[Membro de enumeração esperado.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2901,7 +2934,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum member must have initializer.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O membro enum deve ter um inicializador.]]></Val>
<Val><![CDATA[O membro de enumeração deve ter um inicializador.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2910,7 +2943,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum name cannot be '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O nome de enum não pode ser '{0}'.]]></Val>
<Val><![CDATA[O nome de enumeração não pode ser '{0}'.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Enum name cannot be '{0}']]></Val>
@@ -2922,7 +2955,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum type '{0}' has members with initializers that are not literals.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O tipo Enum '{0}' tem membros com inicializadores que não são literais.]]></Val>
<Val><![CDATA[O tipo de Enumeração '{0}' tem membros com inicializadores que não são literais.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3413,15 +3446,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[A especificação de arquivo não pode conter vários curingas do diretório recursivo ('**'): '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3715,28 +3739,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ignore essa mensagem de erro.]]></Val>
<Val><![CDATA[Ignorar essa mensagem de erro]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implemente a classe abstrata herdada.]]></Val>
<Val><![CDATA[Implementar classe abstrata herdada]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Implemente a interface '{0}'.]]></Val>
<Val><![CDATA[Implementar a interface '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3751,10 +3784,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Importar '{0}' do módulo "{1}".]]></Val>
<Val><![CDATA[Importar '{0}' do módulo "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3840,7 +3876,7 @@
<Str Cat="Text">
<Val><![CDATA[In ambient enum declarations member initializer must be constant expression.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Em declarações enum de ambiente, o inicializador de membro deve ser uma expressão de constante.]]></Val>
<Val><![CDATA[Em declarações de enumeração de ambiente, o inicializador de membro deve ser uma expressão de constante.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3849,7 +3885,7 @@
<Str Cat="Text">
<Val><![CDATA[In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Em um enum com várias declarações, somente uma declaração pode omitir um inicializador para o primeiro elemento enum.]]></Val>
<Val><![CDATA[Em uma enumeração com várias declarações, somente uma declaração pode omitir um inicializador para o primeiro elemento de enumeração.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3858,7 +3894,7 @@
<Str Cat="Text">
<Val><![CDATA[In 'const' enum declarations member initializer must be constant expression.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Em declarações enum 'const', o inicializador de membro deve ser uma expressão de constante.]]></Val>
<Val><![CDATA[Em declarações de enumeração 'const', o inicializador de membro deve ser uma expressão de constante.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3901,37 +3937,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inferir os tipos de parâmetro do uso.]]></Val>
<Val><![CDATA[Inferir tipos de parâmetro pelo uso]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inferir o tipo de '{0}' do uso.]]></Val>
<Val><![CDATA[Inferir tipo de '{0}' pelo uso]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inicializar a propriedade '{0}' no construtor.]]></Val>
<Val><![CDATA[Inicializar a propriedade '{0}' no construtor]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Inicializar a propriedade estática '{0}'.]]></Val>
<Val><![CDATA[Inicializar a propriedade estática '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4462,10 +4510,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tornar a chamada 'super()' a primeira instrução no construtor.]]></Val>
<Val><![CDATA[Tornar a chamada 'super()' a primeira instrução no construtor]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4682,6 +4733,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Não são permitidos vários separadores numéricos consecutivos.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4772,6 +4832,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Separadores numéricos não são permitidos aqui.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5374,10 +5443,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Prefixo '{0}' com um sublinhado.]]></Val>
<Val><![CDATA[Prefixo '{0}' com um sublinhado]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5421,7 +5493,7 @@
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on 'const' enum '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[A propriedade '{0}' não existe no enum 'const' '{1}'.]]></Val>
<Val><![CDATA[A propriedade '{0}' não existe na enumeração 'const' '{1}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -5827,10 +5899,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Remover declaração para: '{0}'.]]></Val>
<Val><![CDATA[Remover declaração para: '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6250,10 +6325,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Regravar como o tipo de acesso indexado '{0}'.]]></Val>
<Val><![CDATA[Reescrever como o tipo de acesso indexado '{0}']]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6365,11 +6443,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Especifique a versão de destino do ECMAScript: 'ES3' (padrão), 'ES5', 'ES2015', 'ES2016', 'ES2017' ou 'ESNEXT'.]]></Val>
<Val><![CDATA[Especifique a versão de destino do ECMAScript: 'ES3' (padrão), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' ou 'ESNEXT'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -6476,6 +6554,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Iniciando compilação no modo de inspeção...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6554,6 +6641,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Declarações de propriedade subsequentes devem ter o mesmo tipo. A propriedade '{0}' deve ser do tipo '{1}', mas aqui tem o tipo '{2}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6846,7 +6936,7 @@
<Str Cat="Text">
<Val><![CDATA[The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O lado esquerdo de uma operação aritmética deve ser do tipo 'any', 'number' ou enum.]]></Val>
<Val><![CDATA[O lado esquerdo de uma operação aritmética deve ser do tipo 'any', 'number' ou de enumeração.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -6984,7 +7074,7 @@
<Str Cat="Text">
<Val><![CDATA[The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O lado direito de uma operação aritmética deve ser do tipo 'any', 'number' ou enum.]]></Val>
<Val><![CDATA[O lado direito de uma operação aritmética deve ser do tipo 'any', 'number' ou de enumeração.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -7322,11 +7412,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O tipo '{0}' não é atribuível ao tipo '{1}'. Dois tipos diferentes com esse nome existem, mas eles não são relacionados.]]></Val>
<Val><![CDATA[O tipo '{0}' não é atribuível ao tipo '{1}'. Dois tipos diferentes com esse nome existem, mas eles não estão relacionados.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8346,7 +8436,7 @@
<Str Cat="Text">
<Val><![CDATA['const' declarations can only be declared inside a block.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[declarações 'const' só podem ser declaradas dentro de um bloco.]]></Val>
<Val><![CDATA[Declarações 'const' só podem ser declaradas dentro de um bloco.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8355,7 +8445,7 @@
<Str Cat="Text">
<Val><![CDATA['const' declarations must be initialized.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[As declarações 'const' devem ser inicializadas.]]></Val>
<Val><![CDATA[Declarações 'const' devem ser inicializadas.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA['const' declarations must be initialized]]></Val>
@@ -8367,7 +8457,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enum member initializer was evaluated to a non-finite value.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O inicializador de membro enum 'const' foi avaliado como um valor não finito.]]></Val>
<Val><![CDATA[O inicializador de membro de enumeração 'const' foi avaliado como um valor não finito.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8376,7 +8466,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enum member initializer was evaluated to disallowed value 'NaN'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O inicializador de membro enum 'const' foi avaliado como o valor não permitido 'NaN'.]]></Val>
<Val><![CDATA[O inicializador de membro de enumeração 'const' foi avaliado como o valor não permitido 'NaN'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8385,7 +8475,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Enums 'const' só podem ser usados em expressões de acesso de índice ou propriedade, ou do lado direito de uma declaração de importação ou atribuição de exportação.]]></Val>
<Val><![CDATA[Enumerações 'const' só podem ser usadas em expressões de acesso de índice ou propriedade, ou do lado direito de uma declaração de importação ou atribuição de exportação.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8838,7 +8928,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[tipos de 'símbolo exclusivo' não são permitidos aqui.]]></Val>
<Val><![CDATA[Tipos de 'unique symbol' não são permitidos aqui.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8847,7 +8937,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[tipos de 'símbolo exclusivo' são permitidos apenas em variáveis em uma declaração de variável.]]></Val>
<Val><![CDATA[Tipos de 'unique symbol' são permitidos apenas em variáveis em uma declaração de variável.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8856,7 +8946,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[tipos de 'símbolo exclusivo' não podem ser usados em uma declaração de variável com um nome associado.]]></Val>
<Val><![CDATA[Tipos de 'unique symbol' não podem ser usados em uma declaração de variável com um nome associado.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -144,7 +144,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a class property declaration must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Имя вычисляемого свойства в объявлении свойств класса должно ссылаться на выражение, тип которого — литерал или уникальный символ.]]></Val>
<Val><![CDATA[Имя вычисляемого свойства в объявлении свойств класса должно ссылаться на выражение, тип которого — литерал или "unique symbol".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -153,7 +153,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Имя вычисляемого свойства в перегрузке метода должно ссылаться на выражение, тип которого — литерал или уникальный символ.]]></Val>
<Val><![CDATA[Имя вычисляемого свойства в перегрузке метода должно ссылаться на выражение, тип которого — литерал или "unique symbol".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -162,7 +162,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Имя вычисляемого свойства в литерале должно ссылаться на выражение, тип которого — литерал или уникальный символ.]]></Val>
<Val><![CDATA[Имя вычисляемого свойства в литерале должно ссылаться на выражение, тип которого — литерал или "unique symbol".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -171,7 +171,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Имя вычисляемого свойства в окружающем контексте должно ссылаться на выражение, тип которого — литерал или уникальный символ.]]></Val>
<Val><![CDATA[Имя вычисляемого свойства в окружающем контексте должно ссылаться на выражение, тип которого — литерал или "unique symbol".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -180,7 +180,7 @@
<Str Cat="Text">
<Val><![CDATA[A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Имя вычисляемого свойства в интерфейсе должно ссылаться на выражение, тип которого — литерал или уникальный символ.]]></Val>
<Val><![CDATA[Имя вычисляемого свойства в интерфейсе должно ссылаться на выражение, тип которого — литерал или "unique symbol".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -531,7 +531,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Свойство класса, тип которого — уникальный символ, должно быть задано как "static" и "readonly".]]></Val>
<Val><![CDATA[Свойство класса, тип которого — "unique symbol", должно быть задано как "static" и "readonly".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -540,7 +540,7 @@
<Str Cat="Text">
<Val><![CDATA[A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Свойство интерфейса или литерала, тип которого — уникальный символ, должно быть задано как "readonly".]]></Val>
<Val><![CDATA[Свойство интерфейса или литерала, тип которого — "unique symbol", должно быть задано как "readonly".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -795,7 +795,7 @@
<Str Cat="Text">
<Val><![CDATA[A variable whose type is a 'unique symbol' type must be 'const'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Переменная типа "уникальный символ" должна быть задана как "const".]]></Val>
<Val><![CDATA[Переменная, тип которой — "unique symbol", должна быть задана как "const".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -865,52 +865,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Добавьте "{0}" в существующее объявление импорта из "{1}".]]></Val>
<Val><![CDATA[Добавьте "{0}" в существующее объявление импорта из "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Добавьте сигнатуру индекса для свойства "{0}".]]></Val>
<Val><![CDATA[Добавьте сигнатуру индекса для свойства "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Добавьте отсутствующий вызов "super()".]]></Val>
<Val><![CDATA[Добавьте отсутствующий вызов "super()"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Добавление "this." к неразрешенной переменной.]]></Val>
<Val><![CDATA[Добавьте "this." к неразрешенной переменной]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Добавление файла tsconfig.json поможет организовать проекты, содержащие файлы TypeScript и JavaScript. Дополнительные сведения: https://aka.ms/tsconfig.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1540,10 +1546,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Вызов выражения-декоратора.]]></Val>
<Val><![CDATA[Вызовите выражение декоратора]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1954,34 +1963,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Замена "{0}" на "{1}".]]></Val>
<Val><![CDATA[Измените "{0}" на "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Измените "extends" на "implements".]]></Val>
<Val><![CDATA[Измените "extends" на "implements"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Изменить правописание на "{0}".]]></Val>
<Val><![CDATA[Измените написание на "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2353,37 +2365,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявите метод "{0}".]]></Val>
<Val><![CDATA[Объявите метод "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявите свойство "{0}".]]></Val>
<Val><![CDATA[Объявите свойство "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявите статический метод "{0}".]]></Val>
<Val><![CDATA[Объявите статический метод "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявление статического свойства "{0}".]]></Val>
<Val><![CDATA[Объявите статическое свойство "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2461,10 +2485,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Отключить проверку для этого файла.]]></Val>
<Val><![CDATA[Отключите проверку для этого файла]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3009,7 +3036,7 @@
<Str Cat="Text">
<Val><![CDATA[Expected at least {0} arguments, but got {1}.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ожидалось аргументов не менее: {0}, получено: {1}.]]></Val>
<Val><![CDATA[Ожидалось аргументов не меньше: {0}, получено: {1}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3428,15 +3455,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Спецификация файла не может содержать несколько рекурсивных подстановочных знаков каталога ("**"): "{0}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3730,31 +3748,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Пропустить это сообщение об ошибке.]]></Val>
<Val><![CDATA[Пропустите это сообщение об ошибке]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Реализуйте унаследованный абстрактный класс.]]></Val>
<Val><![CDATA[Реализуйте наследуемый абстрактный класс]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Реализуйте интерфейс "{0}".]]></Val>
<Val><![CDATA[Реализуйте интерфейс "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3769,10 +3793,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Импорт "{0}" из модуля "{1}".]]></Val>
<Val><![CDATA[Импортируйте "{0}" из модуля "{1}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3919,37 +3946,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Вывод типов параметров на основе использования.]]></Val>
<Val><![CDATA[Выведите типы параметров на основании их использования]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Вывод типа "{0}" на основе использования.]]></Val>
<Val><![CDATA[Выведите тип "{0}" на основании его использования]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Инициализировать свойство "{0}" в конструкторе.]]></Val>
<Val><![CDATA[Инициализируйте свойство "{0}" в конструкторе]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Инициализировать статическое свойство "{0}".]]></Val>
<Val><![CDATA[Инициализируйте статическое свойство "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4480,10 +4519,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Сделайте вызов "super()" первой инструкцией в конструкторе.]]></Val>
<Val><![CDATA[Сделайте вызов "super()" первой инструкцией в конструкторе]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4700,6 +4742,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Использовать несколько последовательных числовых разделителей запрещено.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4790,6 +4841,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Числовые разделители здесь запрещены.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5395,10 +5455,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Добавьте к "{0}" префикс — символ подчеркивания.]]></Val>
<Val><![CDATA[Добавьте к "{0}" префикс — символ подчеркивания]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5848,10 +5911,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Удалите объявление: "{0}".]]></Val>
<Val><![CDATA[Удалите объявление: "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6274,10 +6340,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Необходима перезапись с типом индексного доступа {0}.]]></Val>
<Val><![CDATA[Перезапишите как тип с индексным доступом "{0}"]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6389,15 +6458,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Укажите целевую версию ECMAScript: "ES3" (по умолчанию), "ES5", "ES2015", "ES2016", "ES2017" или "ESNEXT".]]></Val>
<Val><![CDATA[Укажите целевую версию ECMAScript: "ES3" (по умолчанию), "ES5", "ES2015", "ES2016", "ES2017", "ES2018" или "ESNEXT".]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6503,6 +6569,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Запуск компиляции в режиме наблюдения...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6581,6 +6656,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Последовательные объявления свойств должны иметь один и тот же тип. Свойство "{0}" должно иметь тип "{1}", но имеет здесь тип "{2}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -7349,7 +7427,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8865,7 +8943,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Типы "уникальный символ" здесь запрещены.]]></Val>
<Val><![CDATA[Типы "unique symbol" здесь запрещены.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8874,7 +8952,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types are only allowed on variables in a variable statement.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Типы "уникальный символ" разрешены только в переменных в операторе с переменной.]]></Val>
<Val><![CDATA[Типы "unique symbol" разрешены только у переменных в операторах с переменными.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8883,7 +8961,7 @@
<Str Cat="Text">
<Val><![CDATA['unique symbol' types may not be used on a variable declaration with a binding name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Типы "уникальный символ" невозможно использовать в объявлении переменной с именем привязки.]]></Val>
<Val><![CDATA[Типы "unique symbol" невозможно использовать в объявлении переменной с именем привязки.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -411,7 +411,7 @@
<Str Cat="Text">
<Val><![CDATA[A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numaralandırma bildirimdeki bir üye başlatıcısı, diğer numaralandırmalarda tanımlanan üyeler dahil olmak üzere kendinden sonra bildirilen üyelere başvuramaz.]]></Val>
<Val><![CDATA[Sabit listesi bildirimindeki bir üye başlatıcısı, diğer sabit listelerinde tanımlanan üyeler dahil olmak üzere kendinden sonra bildirilen üyelere başvuramaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -859,52 +859,58 @@
</Item>
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' öğesini "{1}" konumundaki mevcut içeri aktarma bildirimine ekleyin.]]></Val>
<Val><![CDATA['{0}' öğesini "{1}" konumundaki mevcut içeri aktarma bildirimine ekle]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_index_signature_for_property_0_90017" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
<Val><![CDATA[Add index signature for property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' özelliği için dizin imzası ekleyin.]]></Val>
<Val><![CDATA['{0}' özelliği için dizin imzası ekle]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add index signature for property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_missing_super_call_90001" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
<Val><![CDATA[Add missing 'super()' call]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eksik 'super()' çağrısını ekleyin.]]></Val>
<Val><![CDATA[Eksik 'super()' çağrısını ekle]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add missing 'super()' call.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_this_to_unresolved_variable_90008" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
<Val><![CDATA[Add 'this.' to unresolved variable]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Çözümlenmemiş değişkene 'this.' ekleyin.]]></Val>
<Val><![CDATA[Çözümlenmemiş değişkene 'this.' ekle]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Add 'this.' to unresolved variable.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Bir tsconfig.json dosyası eklemek, hem TypeScript hem de JavaScript dosyaları içeren projeleri düzenlemenize yardımcı olur. Daha fazla bilgi edinmek için bkz. https://aka.ms/tsconfig.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -975,7 +981,7 @@
<Str Cat="Text">
<Val><![CDATA[Ambient const enums are not allowed when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--isolatedModules' bayrağı sağlandığında çevresel const numaralandırma değerlerine izin verilmez.]]></Val>
<Val><![CDATA['--isolatedModules' bayrağı sağlandığında çevresel const sabit listesi değerlerine izin verilmez.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1047,7 +1053,7 @@
<Str Cat="Text">
<Val><![CDATA[An arithmetic operand must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aritmetik işlenen, 'any', 'number' veya numaralandırma türünde olmalıdır.]]></Val>
<Val><![CDATA[Aritmetik işlenen, 'any', 'number' veya sabit listesi türünde olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1092,7 +1098,7 @@
<Str Cat="Text">
<Val><![CDATA[An enum member cannot have a numeric name.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numaralandırma üyesi, sayısal bir ada sahip olamaz.]]></Val>
<Val><![CDATA[Sabit listesi üyesi, sayısal bir ada sahip olamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1534,10 +1540,13 @@
</Item>
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
<Val><![CDATA[Call decorator expression]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dekoratör ifadesini çağırın.]]></Val>
<Val><![CDATA[Dekoratör ifadesini çağır]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Call decorator expression.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -1948,34 +1957,37 @@
</Item>
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' değerini '{1}' olarak değiştirin.]]></Val>
<Val><![CDATA['{0}' değerini '{1}' olarak değiştir]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change {0} to {1}.]]></Val>
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_extends_to_implements_90003" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['extends' ifadesini 'implements' olarak değiştirin.]]></Val>
<Val><![CDATA['extends' ifadesini 'implements' olarak değiştirin]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change 'extends' to 'implements']]></Val>
<Val><![CDATA[Change 'extends' to 'implements'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_spelling_to_0_90022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
<Val><![CDATA[Change spelling to '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Yazımı '{0}' olarak değiştirin.]]></Val>
<Val><![CDATA[Yazımı '{0}' olarak değiştir]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Change spelling to '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2051,6 +2063,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Class_0_incorrectly_implements_interface_1_2420" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Class '{0}' incorrectly implements interface '{1}'.]]></Val>
@@ -2166,7 +2184,7 @@
<Str Cat="Text">
<Val><![CDATA[Computed property names are not allowed in enums.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numaralandırmalarda hesaplanan özellik adına izin verilmiyor.]]></Val>
<Val><![CDATA[Sabit listelerinde hesaplanan özellik adına izin verilmiyor.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2347,37 +2365,49 @@
</Item>
<Item ItemId=";Declare_method_0_90023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
<Val><![CDATA[Declare method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' metodunu bildirin.]]></Val>
<Val><![CDATA['{0}' metodunu bildir]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_property_0_90016" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
<Val><![CDATA[Declare property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' özelliğini bildirin.]]></Val>
<Val><![CDATA['{0}' özelliğini bildir]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_method_0_90024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
<Val><![CDATA[Declare static method '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' statik metodunu bildirin.]]></Val>
<Val><![CDATA['{0}' statik metodunu bildir]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static method '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Declare_static_property_0_90027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
<Val><![CDATA[Declare static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' statik özelliğini bildirin.]]></Val>
<Val><![CDATA['{0}' statik özelliğini bildir]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Declare static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2455,10 +2485,13 @@
</Item>
<Item ItemId=";Disable_checking_for_this_file_90018" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
<Val><![CDATA[Disable checking for this file]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Bu dosya için denetimi devre dışı bırakın.]]></Val>
<Val><![CDATA[Bu dosya için denetimi devre dışı bırak]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Disable checking for this file.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -2547,7 +2580,7 @@
<Str Cat="Text">
<Val><![CDATA[Do not erase const enum declarations in generated code.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Oluşturulan kodda const numaralandırma bildirimlerini silme.]]></Val>
<Val><![CDATA[Oluşturulan kodda const sabit listesi bildirimlerini silme.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2892,7 +2925,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum declarations must all be const or non-const.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numaralandırma bildirimlerinin tümü const veya const olmayan değerler olmalıdır.]]></Val>
<Val><![CDATA[Sabit listesi bildirimlerinin tümü const veya const olmayan değerler olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2901,7 +2934,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum member expected.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numaralandırma üyesi bekleniyor.]]></Val>
<Val><![CDATA[Sabit listesi üyesi bekleniyor.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -2910,7 +2943,7 @@
<Str Cat="Text">
<Val><![CDATA[Enum member must have initializer.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Numaralandırma üyesi bir başlatıcıya sahip olmalıdır.]]></Val>
<Val><![CDATA[Sabit listesi üyesi bir başlatıcıya sahip olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3422,15 +3455,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dosya belirtimi, birden fazla özyinelemeli dizin joker karakter ('**') içeremez: '{0}'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[File specification cannot end in a recursive directory wildcard ('**'): '{0}'.]]></Val>
@@ -3724,31 +3748,37 @@
</Item>
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
<Val><![CDATA[Ignore this error message]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Bu hata iletisini yoksayın.]]></Val>
<Val><![CDATA[Bu hata iletisini yoksay]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Ignore this error message.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_inherited_abstract_class_90007" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement inherited abstract class.]]></Val>
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Devralınmış soyut sınıfı uygulayın.]]></Val>
<Val><![CDATA[Devralınan soyut sınıfı uygula]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement inherited abstract class]]></Val>
<Val><![CDATA[Implement inherited abstract class.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_interface_0_90006" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
<Val><![CDATA[Implement interface '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' arabirimini uygulayın.]]></Val>
<Val><![CDATA['{0}' arabirimini uygula]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Implement interface '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3763,10 +3793,13 @@
</Item>
<Item ItemId=";Import_0_from_module_1_90013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
<Val><![CDATA[Import '{0}' from module "{1}"]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["{1}" modülünden '{0}' öğesini içeri aktarın.]]></Val>
<Val><![CDATA["{1}" modülünden '{0}' öğesini içeri aktar]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Import '{0}' from module "{1}".]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -3852,7 +3885,7 @@
<Str Cat="Text">
<Val><![CDATA[In ambient enum declarations member initializer must be constant expression.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Çevresel numaralandırma bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.]]></Val>
<Val><![CDATA[Çevresel sabit listesi bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3861,7 +3894,7 @@
<Str Cat="Text">
<Val><![CDATA[In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Birden fazla bildirime sahip numaralandırmada yalnızca bir bildirim ilk numaralandırma öğesine ait başlatıcıyı atlayabilir.]]></Val>
<Val><![CDATA[Birden fazla bildirime sahip sabit listesinde yalnızca bir bildirim ilk sabit listesi öğesine ait başlatıcıyı atlayabilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3870,7 +3903,7 @@
<Str Cat="Text">
<Val><![CDATA[In 'const' enum declarations member initializer must be constant expression.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' numaralandırma bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.]]></Val>
<Val><![CDATA['const' sabit listesi bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3913,37 +3946,49 @@
</Item>
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
<Val><![CDATA[Infer parameter types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Parametre türlerini kullanımdan çıkarsayın.]]></Val>
<Val><![CDATA[Parametre türleri için kullanımdan çıkarım yap]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer parameter types from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
<Val><![CDATA[Infer type of '{0}' from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' türünü kullanımdan çıkarsayın.]]></Val>
<Val><![CDATA['{0}' türü için kullanımdan çıkarım yap]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
<Val><![CDATA[Initialize property '{0}' in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Oluşturucu içinde '{0}' özelliğini başlatın.]]></Val>
<Val><![CDATA[Oluşturucu içinde '{0}' özelliğini başlat]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Initialize_static_property_0_90021" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
<Val><![CDATA[Initialize static property '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' statik özelliğini başlatın.]]></Val>
<Val><![CDATA['{0}' statik özelliğini başlat]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Initialize static property '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4474,10 +4519,13 @@
</Item>
<Item ItemId=";Make_super_call_the_first_statement_in_the_constructor_90002" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
<Val><![CDATA[Make 'super()' call the first statement in the constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Oluşturucudaki ilk deyime 'super()' tarafından çağrı yapılmasını sağla.]]></Val>
<Val><![CDATA[Oluşturucudaki ilk deyime 'super()' tarafından çağrı yapılmasını sağla]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Make 'super()' call the first statement in the constructor.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -4694,6 +4742,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_consecutive_numeric_separators_are_not_permitted_6189" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple consecutive numeric separators are not permitted.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Birbirini izleyen birden çok sayısal ayırıcıya izin verilmez.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Multiple_constructor_implementations_are_not_allowed_2392" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Multiple constructor implementations are not allowed.]]></Val>
@@ -4784,6 +4841,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Numeric_separators_are_not_allowed_here_6188" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Numeric separators are not allowed here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Burada sayısal ayırıcılara izin verilmez.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Object_is_possibly_null_2531" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Object is possibly 'null'.]]></Val>
@@ -5389,10 +5455,13 @@
</Item>
<Item ItemId=";Prefix_0_with_an_underscore_90025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
<Val><![CDATA[Prefix '{0}' with an underscore]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' için ön ek olarak alt çizgi kullanın.]]></Val>
<Val><![CDATA['{0}' için ön ek olarak alt çizgi kullan]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Prefix '{0}' with an underscore.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -5436,7 +5505,7 @@
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on 'const' enum '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' özelliği, '{1}' 'const' numaralandırması üzerinde değil.]]></Val>
<Val><![CDATA['{0}' özelliği, '{1}' 'const' sabit listesi üzerinde değil.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -5842,10 +5911,13 @@
</Item>
<Item ItemId=";Remove_declaration_for_Colon_0_90004" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
<Val><![CDATA[Remove declaration for: '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['{0}' bildirimini kaldırın.]]></Val>
<Val><![CDATA['{0}' bildirimini kaldır]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Remove declaration for: '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6268,10 +6340,13 @@
</Item>
<Item ItemId=";Rewrite_as_the_indexed_access_type_0_90026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
<Val><![CDATA[Rewrite as the indexed access type '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dizine eklenmiş erişim türü '{0}' olarak yeniden yazın.]]></Val>
<Val><![CDATA[Dizine eklenmiş erişim türü '{0}' olarak yeniden yaz]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Rewrite as the indexed access type '{0}'.]]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6383,15 +6458,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'.]]></Val>
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[ECMAScript hedef sürümünü belirleyin: 'ES3' (varsayılan), 'ES5', 'ES2015', 'ES2016', 'ES2017' ya da 'ESNEXT'.]]></Val>
<Val><![CDATA[ECMAScript hedef sürümünü belirleyin: 'ES3' (varsayılan), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' ya da 'ESNEXT'.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT']]></Val>
</Prev>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6497,6 +6569,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Starting_compilation_in_watch_mode_6031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Starting compilation in watch mode...]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Derleme, izleme modunda başlatılıyor...]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Statement_expected_1129" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Statement expected.]]></Val>
@@ -6575,6 +6656,9 @@
<Item ItemId=";Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ardışık özellik bildirimleri aynı türe sahip olmalıdır. '{0}' özelliği '{1}' türünde olmalıdır, ancak burada '{2}' türüne sahip.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@@ -6867,7 +6951,7 @@
<Str Cat="Text">
<Val><![CDATA[The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aritmetik işlemin sol tarafı, 'any', 'number' veya bir numaralandırma türünde olmalıdır.]]></Val>
<Val><![CDATA[Aritmetik işlemin sol tarafı, 'any', 'number' veya bir sabit listesi türünde olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -7005,7 +7089,7 @@
<Str Cat="Text">
<Val><![CDATA[The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Aritmetik işlemin sağ tarafı, 'any', 'number' veya bir numaralandırma türünde olmalıdır.]]></Val>
<Val><![CDATA[Aritmetik işlemin sağ tarafı, 'any', 'number' veya bir sabit listesi türünde olmalıdır.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -7343,7 +7427,7 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
@@ -8388,7 +8472,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enum member initializer was evaluated to a non-finite value.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' numaralandırma üyesi başlatıcısı, sonlu olmayan bir değer olarak hesaplandı.]]></Val>
<Val><![CDATA['const' sabit listesi üyesi başlatıcısı, sonlu olmayan bir değer olarak hesaplandı.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8397,7 +8481,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enum member initializer was evaluated to disallowed value 'NaN'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' numaralandırma üyesi başlatıcısı, izin verilmeyen 'NaN' değeri olarak hesaplandı.]]></Val>
<Val><![CDATA['const' sabit listesi üyesi başlatıcısı, izin verilmeyen 'NaN' değeri olarak hesaplandı.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -8406,7 +8490,7 @@
<Str Cat="Text">
<Val><![CDATA['const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['const' numaralandırmaları yalnızca bir özellikte, dizin erişim ifadelerinde, içeri aktarma bildiriminin sağ tarafında veya dışarı aktarma atamasında kullanılabilir.]]></Val>
<Val><![CDATA['const' sabit listeleri yalnızca bir özellikte, dizin erişim ifadelerinde, içeri aktarma bildiriminin sağ tarafında veya dışarı aktarma atamasında kullanılabilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
+11 -11
View File
@@ -200,7 +200,7 @@ namespace ts.server {
const response = this.processResponse<protocol.CompletionDetailsResponse>(request);
Debug.assert(response.body.length === 1, "Unexpected length of completion details response body.");
const convertedCodeActions = map(response.body[0].codeActions, codeAction => this.convertCodeActions(codeAction, fileName));
const convertedCodeActions = map(response.body[0].codeActions, ({ description, changes }) => ({ description, changes: this.convertChanges(changes, fileName) }));
return { ...response.body[0], codeActions: convertedCodeActions };
}
@@ -553,15 +553,18 @@ namespace ts.server {
return notImplemented();
}
getCodeFixesAtPosition(file: string, start: number, end: number, errorCodes: number[]): CodeAction[] {
getCodeFixesAtPosition(file: string, start: number, end: number, errorCodes: ReadonlyArray<number>): ReadonlyArray<CodeFixAction> {
const args: protocol.CodeFixRequestArgs = { ...this.createFileRangeRequestArgs(file, start, end), errorCodes };
const request = this.processRequest<protocol.CodeFixRequest>(CommandNames.GetCodeFixes, args);
const response = this.processResponse<protocol.CodeFixResponse>(request);
return response.body.map(entry => this.convertCodeActions(entry, file));
// TODO: GH#20538 shouldn't need cast
return (response.body as ReadonlyArray<protocol.CodeFixAction>).map(({ description, changes, fixId }) => ({ description, changes: this.convertChanges(changes, file), fixId }));
}
getCombinedCodeFix = notImplemented;
applyCodeActionCommand = notImplemented;
private createFileLocationOrRangeRequestArgs(positionOrRange: number | TextRange, fileName: string): protocol.FileLocationOrRangeRequestArgs {
@@ -638,14 +641,11 @@ namespace ts.server {
});
}
convertCodeActions(entry: protocol.CodeAction, fileName: string): CodeAction {
return {
description: entry.description,
changes: entry.changes.map(change => ({
fileName: change.fileName,
textChanges: change.textChanges.map(textChange => this.convertTextChangeToCodeEdit(textChange, fileName))
}))
};
private convertChanges(changes: protocol.FileCodeEdits[], fileName: string): FileTextChanges[] {
return changes.map(change => ({
fileName: change.fileName,
textChanges: change.textChanges.map(textChange => this.convertTextChangeToCodeEdit(textChange, fileName))
}));
}
convertTextChangeToCodeEdit(change: protocol.CodeEdit, fileName: string): ts.TextChange {
+2
View File
@@ -547,9 +547,11 @@ namespace ts.server {
}
switch (response.kind) {
case ActionSet:
project.resolutionCache.clear();
this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings);
break;
case ActionInvalidate:
project.resolutionCache.clear();
this.typingsCache.deleteTypingsForProject(response.projectName);
break;
}
+26 -5
View File
@@ -506,6 +506,14 @@ namespace ts.server {
}
abstract getTypeAcquisition(): TypeAcquisition;
protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition {
if (!newTypeAcquisition || !newTypeAcquisition.include) {
// Nothing to filter out, so just return as-is
return newTypeAcquisition;
}
return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) };
}
getExternalFiles(): SortedReadonlyArray<string> {
return emptyArray as SortedReadonlyArray<string>;
}
@@ -718,7 +726,8 @@ namespace ts.server {
this.projectStateVersion++;
}
private extractUnresolvedImportsFromSourceFile(file: SourceFile, result: Push<string>) {
/* @internal */
private extractUnresolvedImportsFromSourceFile(file: SourceFile, result: Push<string>, ambientModules: string[]) {
const cached = this.cachedUnresolvedImportsPerFile.get(file.path);
if (cached) {
// found cached result - use it and return
@@ -731,7 +740,7 @@ namespace ts.server {
if (file.resolvedModules) {
file.resolvedModules.forEach((resolvedModule, name) => {
// pick unresolved non-relative names
if (!resolvedModule && !isExternalModuleNameRelative(name)) {
if (!resolvedModule && !isExternalModuleNameRelative(name) && !isAmbientlyDeclaredModule(name)) {
// for non-scoped names extract part up-to the first slash
// for scoped names - extract up to the second slash
let trimmed = name.trim();
@@ -748,6 +757,10 @@ namespace ts.server {
});
}
this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || emptyArray);
function isAmbientlyDeclaredModule(name: string) {
return ambientModules.some(m => m === name);
}
}
/**
@@ -777,8 +790,9 @@ namespace ts.server {
// 4. compilation settings were changed in the way that might affect module resolution - drop all caches and collect all data from the scratch
if (hasChanges || changedFiles.length) {
const result: string[] = [];
const ambientModules = this.program.getTypeChecker().getAmbientModules().map(mod => stripQuotes(mod.getName()));
for (const sourceFile of this.program.getSourceFiles()) {
this.extractUnresolvedImportsFromSourceFile(sourceFile, result);
this.extractUnresolvedImportsFromSourceFile(sourceFile, result, ambientModules);
}
this.lastCachedUnresolvedImportsList = toDeduplicatedSortedArray(result);
}
@@ -804,6 +818,13 @@ namespace ts.server {
return !hasChanges;
}
protected removeExistingTypings(include: string[]): string[] {
const existing = ts.getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
return include.filter(i => existing.indexOf(i) < 0);
}
private setTypings(typings: SortedReadonlyArray<string>): boolean {
if (arrayIsEqualTo(this.typingFiles, typings)) {
return false;
@@ -1299,7 +1320,7 @@ namespace ts.server {
}
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void {
this.typeAcquisition = newTypeAcquisition;
this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition);
}
getTypeAcquisition() {
@@ -1445,7 +1466,7 @@ namespace ts.server {
Debug.assert(!!newTypeAcquisition.include, "newTypeAcquisition.include may not be null/undefined");
Debug.assert(!!newTypeAcquisition.exclude, "newTypeAcquisition.exclude may not be null/undefined");
Debug.assert(typeof newTypeAcquisition.enable === "boolean", "newTypeAcquisition.enable may not be null/undefined");
this.typeAcquisition = newTypeAcquisition;
this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition);
}
}
}
+71 -3
View File
@@ -71,6 +71,7 @@ namespace ts.server.protocol {
SignatureHelp = "signatureHelp",
/* @internal */
SignatureHelpFull = "signatureHelp-full",
Status = "status",
TypeDefinition = "typeDefinition",
ProjectInfo = "projectInfo",
ReloadProjects = "reloadProjects",
@@ -99,9 +100,14 @@ namespace ts.server.protocol {
BreakpointStatement = "breakpointStatement",
CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
GetCodeFixes = "getCodeFixes",
ApplyCodeActionCommand = "applyCodeActionCommand",
/* @internal */
GetCodeFixesFull = "getCodeFixes-full",
// TODO: GH#20538
/* @internal */
GetCombinedCodeFix = "getCombinedCodeFix",
/* @internal */
GetCombinedCodeFixFull = "getCombinedCodeFix-full",
ApplyCodeActionCommand = "applyCodeActionCommand",
GetSupportedCodeFixes = "getSupportedCodeFixes",
GetApplicableRefactors = "getApplicableRefactors",
@@ -216,6 +222,24 @@ namespace ts.server.protocol {
projectFileName?: string;
}
export interface StatusRequest extends Request {
command: CommandTypes.Status;
}
export interface StatusResponseBody {
/**
* The TypeScript version (`ts.version`).
*/
version: string;
}
/**
* Response to StatusRequest
*/
export interface StatusResponse extends Response {
body: StatusResponseBody;
}
/**
* Requests a JS Doc comment template for a given position
*/
@@ -533,6 +557,19 @@ namespace ts.server.protocol {
arguments: CodeFixRequestArgs;
}
// TODO: GH#20538
/* @internal */
export interface GetCombinedCodeFixRequest extends Request {
command: CommandTypes.GetCombinedCodeFix;
arguments: GetCombinedCodeFixRequestArgs;
}
// TODO: GH#20538
/* @internal */
export interface GetCombinedCodeFixResponse extends Response {
body: CombinedCodeActions;
}
export interface ApplyCodeActionCommandRequest extends Request {
command: CommandTypes.ApplyCodeActionCommand;
arguments: ApplyCodeActionCommandRequestArgs;
@@ -582,7 +619,21 @@ namespace ts.server.protocol {
/**
* Errorcodes we want to get the fixes for.
*/
errorCodes?: number[];
errorCodes?: ReadonlyArray<number>;
}
// TODO: GH#20538
/* @internal */
export interface GetCombinedCodeFixRequestArgs {
scope: GetCombinedCodeFixScope;
fixId: {};
}
// TODO: GH#20538
/* @internal */
export interface GetCombinedCodeFixScope {
type: "file";
args: FileRequestArgs;
}
export interface ApplyCodeActionCommandRequestArgs {
@@ -1568,7 +1619,7 @@ namespace ts.server.protocol {
export interface CodeFixResponse extends Response {
/** The code actions that are available */
body?: CodeAction[];
body?: CodeAction[]; // TODO: GH#20538 CodeFixAction[]
}
export interface CodeAction {
@@ -1580,6 +1631,23 @@ namespace ts.server.protocol {
commands?: {}[];
}
// TODO: GH#20538
/* @internal */
export interface CombinedCodeActions {
changes: ReadonlyArray<FileCodeEdits>;
commands?: ReadonlyArray<{}>;
}
// TODO: GH#20538
/* @internal */
export interface CodeFixAction extends CodeAction {
/**
* 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.
*/
fixId?: {};
}
/**
* Format and format on key response message.
*/
+42 -24
View File
@@ -1230,7 +1230,7 @@ namespace ts.server {
return project.getLanguageService().getCompletionEntryDetails(file, position, name, formattingOptions, source);
});
return simplifiedResult
? result.map(details => ({ ...details, codeActions: map(details.codeActions, action => this.mapCodeAction(action, scriptInfo)) }))
? result.map(details => ({ ...details, codeActions: map(details.codeActions, action => this.mapCodeAction(project, action)) }))
: result;
}
@@ -1538,18 +1538,14 @@ namespace ts.server {
const oldText = snapshot.getText(0, snapshot.getLength());
mappedRenameLocation = getLocationInNewDocument(oldText, renameFilename, renameLocation, edits);
}
return {
renameLocation: mappedRenameLocation,
renameFilename,
edits: edits.map(change => this.mapTextChangesToCodeEdits(project, change))
};
return { renameLocation: mappedRenameLocation, renameFilename, edits: this.mapTextChangesToCodeEdits(project, edits) };
}
else {
return result;
}
}
private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): protocol.CodeAction[] | CodeAction[] {
private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.CodeAction> | ReadonlyArray<CodeAction> {
if (args.errorCodes.length === 0) {
return undefined;
}
@@ -1564,22 +1560,35 @@ namespace ts.server {
return undefined;
}
if (simplifiedResult) {
return codeActions.map(codeAction => this.mapCodeAction(codeAction, scriptInfo));
return codeActions.map(codeAction => this.mapCodeAction(project, codeAction));
}
else {
return codeActions;
}
}
private applyCodeActionCommand(commandName: string, requestSeq: number, args: protocol.ApplyCodeActionCommandRequestArgs): void {
private getCombinedCodeFix({ scope, fixId }: protocol.GetCombinedCodeFixRequestArgs, simplifiedResult: boolean): protocol.CombinedCodeActions | CombinedCodeActions {
Debug.assert(scope.type === "file");
const { file, project } = this.getFileAndProject(scope.args);
const formatOptions = this.projectService.getFormatCodeOptions(file);
const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId, formatOptions);
if (simplifiedResult) {
return { changes: this.mapTextChangesToCodeEdits(project, res.changes), commands: res.commands };
}
else {
return res;
}
}
private applyCodeActionCommand(args: protocol.ApplyCodeActionCommandRequestArgs): {} {
const commands = args.command as CodeActionCommand | CodeActionCommand[]; // They should be sending back the command we sent them.
for (const command of toArray(commands)) {
const { project } = this.getFileAndProject(command);
const output = (success: boolean, message: string) => this.doOutput({}, commandName, requestSeq, success, message);
project.getLanguageService().applyCodeActionCommand(command).then(
result => { output(/*success*/ true, result.successMessage); },
error => { output(/*success*/ false, error); });
_result => { /* TODO: GH#20447 report success message? */ },
_error => { /* TODO: GH#20447 report errors */ });
}
return {};
}
private getStartAndEndPosition(args: protocol.FileRangeRequestArgs, scriptInfo: ScriptInfo) {
@@ -1604,16 +1613,16 @@ namespace ts.server {
return { startPosition, endPosition };
}
private mapCodeAction({ description, changes: unmappedChanges, commands }: CodeAction, scriptInfo: ScriptInfo): protocol.CodeAction {
const changes = unmappedChanges.map(change => ({
fileName: change.fileName,
textChanges: change.textChanges.map(textChange => this.convertTextChangeToCodeEdit(textChange, scriptInfo))
}));
private mapCodeAction(project: Project, { description, changes: unmappedChanges, commands }: CodeAction): protocol.CodeAction {
const changes = unmappedChanges.map(change => this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(toNormalizedPath(change.fileName))));
return { description, changes, commands };
}
private mapTextChangesToCodeEdits(project: Project, textChanges: FileTextChanges): protocol.FileCodeEdits {
const scriptInfo = project.getScriptInfoForNormalizedPath(toNormalizedPath(textChanges.fileName));
private mapTextChangesToCodeEdits(project: Project, textChanges: ReadonlyArray<FileTextChanges>): protocol.FileCodeEdits[] {
return textChanges.map(change => this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(toNormalizedPath(change.fileName))));
}
private mapTextChangesToCodeEditsUsingScriptinfo(textChanges: FileTextChanges, scriptInfo: ScriptInfo): protocol.FileCodeEdits {
return {
fileName: textChanges.fileName,
textChanges: textChanges.textChanges.map(textChange => this.convertTextChangeToCodeEdit(textChange, scriptInfo))
@@ -1703,19 +1712,23 @@ namespace ts.server {
}
private handlers = createMapFromTemplate<(request: protocol.Request) => HandlerResponse>({
[CommandNames.Status]: () => {
const response: protocol.StatusResponseBody = { version };
return this.requiredResponse(response);
},
[CommandNames.OpenExternalProject]: (request: protocol.OpenExternalProjectRequest) => {
this.projectService.openExternalProject(request.arguments, /*suppressRefreshOfInferredProjects*/ false);
// TODO: report errors
// TODO: GH#20447 report errors
return this.requiredResponse(/*response*/ true);
},
[CommandNames.OpenExternalProjects]: (request: protocol.OpenExternalProjectsRequest) => {
this.projectService.openExternalProjects(request.arguments.projects);
// TODO: report errors
// TODO: GH#20447 report errors
return this.requiredResponse(/*response*/ true);
},
[CommandNames.CloseExternalProject]: (request: protocol.CloseExternalProjectRequest) => {
this.projectService.closeExternalProject(request.arguments.projectFileName);
// TODO: report errors
// TODO: GH#20447 report errors
return this.requiredResponse(/*response*/ true);
},
[CommandNames.SynchronizeProjectList]: (request: protocol.SynchronizeProjectListRequest) => {
@@ -1956,9 +1969,14 @@ namespace ts.server {
[CommandNames.GetCodeFixesFull]: (request: protocol.CodeFixRequest) => {
return this.requiredResponse(this.getCodeFixes(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.GetCombinedCodeFix]: (request: protocol.GetCombinedCodeFixRequest) => {
return this.requiredResponse(this.getCombinedCodeFix(request.arguments, /*simplifiedResult*/ true));
},
[CommandNames.GetCombinedCodeFixFull]: (request: protocol.GetCombinedCodeFixRequest) => {
return this.requiredResponse(this.getCombinedCodeFix(request.arguments, /*simplifiedResult*/ false));
},
[CommandNames.ApplyCodeActionCommand]: (request: protocol.ApplyCodeActionCommandRequest) => {
this.applyCodeActionCommand(request.command, request.seq, request.arguments);
return this.notRequired(); // Response will come asynchronously.
return this.requiredResponse(this.applyCodeActionCommand(request.arguments));
},
[CommandNames.GetSupportedCodeFixes]: () => {
return this.requiredResponse(this.getSupportedCodeFixes());
+18 -24
View File
@@ -205,35 +205,29 @@ namespace ts.server.typingsInstaller {
this.knownCachesSet.set(cacheLocation, true);
}
private filterTypings(typingsToInstall: string[]) {
if (typingsToInstall.length === 0) {
return typingsToInstall;
}
const result: string[] = [];
for (const typing of typingsToInstall) {
if (this.missingTypingsSet.get(typing) || this.packageNameToTypingLocation.get(typing)) {
continue;
private filterTypings(typingsToInstall: ReadonlyArray<string>): ReadonlyArray<string> {
return typingsToInstall.filter(typing => {
if (this.missingTypingsSet.get(typing)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}' is in missingTypingsSet - skipping...`);
return false;
}
if (this.packageNameToTypingLocation.get(typing)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}' already has a typing - skipping...`);
return false;
}
const validationResult = JsTyping.validatePackageName(typing);
if (validationResult === JsTyping.PackageNameValidationResult.Ok) {
if (this.typesRegistry.has(typing)) {
result.push(typing);
}
else {
if (this.log.isEnabled()) {
this.log.writeLine(`Entry for package '${typing}' does not exist in local types registry - skipping...`);
}
}
}
else {
if (validationResult !== JsTyping.PackageNameValidationResult.Ok) {
// add typing name to missing set so we won't process it again
this.missingTypingsSet.set(typing, true);
if (this.log.isEnabled()) {
this.log.writeLine(JsTyping.renderPackageNameValidationFailure(validationResult, typing));
}
if (this.log.isEnabled()) this.log.writeLine(JsTyping.renderPackageNameValidationFailure(validationResult, typing));
return false;
}
}
return result;
if (!this.typesRegistry.has(typing)) {
if (this.log.isEnabled()) this.log.writeLine(`Entry for package '${typing}' does not exist in local types registry - skipping...`);
return false;
}
return true;
});
}
protected ensurePackageDirectoryExists(directory: string) {
+70 -19
View File
@@ -1,40 +1,56 @@
/* @internal */
namespace ts {
export interface CodeFix {
export interface CodeFixRegistration {
errorCodes: number[];
getCodeActions(context: CodeFixContext): CodeAction[] | undefined;
getCodeActions(context: CodeFixContext): CodeFixAction[] | undefined;
fixIds?: string[];
getAllCodeActions?(context: CodeFixAllContext): CombinedCodeActions;
}
export interface CodeFixContext extends textChanges.TextChangesContext {
errorCode: number;
export interface CodeFixContextBase extends textChanges.TextChangesContext {
sourceFile: SourceFile;
span: TextSpan;
program: Program;
host: LanguageServiceHost;
cancellationToken: CancellationToken;
}
export namespace codefix {
const codeFixes: CodeFix[][] = [];
export interface CodeFixAllContext extends CodeFixContextBase {
fixId: {};
}
export function registerCodeFix(codeFix: CodeFix) {
forEach(codeFix.errorCodes, error => {
let fixes = codeFixes[error];
if (!fixes) {
fixes = [];
codeFixes[error] = fixes;
export interface CodeFixContext extends CodeFixContextBase {
errorCode: number;
span: TextSpan;
}
export namespace codefix {
const codeFixRegistrations: CodeFixRegistration[][] = [];
const fixIdToRegistration = createMap<CodeFixRegistration>();
export function registerCodeFix(reg: CodeFixRegistration) {
for (const error of reg.errorCodes) {
let registrations = codeFixRegistrations[error];
if (!registrations) {
registrations = [];
codeFixRegistrations[error] = registrations;
}
fixes.push(codeFix);
});
registrations.push(reg);
}
if (reg.fixIds) {
for (const fixId of reg.fixIds) {
Debug.assert(!fixIdToRegistration.has(fixId));
fixIdToRegistration.set(fixId, reg);
}
}
}
export function getSupportedErrorCodes() {
return Object.keys(codeFixes);
return Object.keys(codeFixRegistrations);
}
export function getFixes(context: CodeFixContext): CodeAction[] {
const fixes = codeFixes[context.errorCode];
const allActions: CodeAction[] = [];
export function getFixes(context: CodeFixContext): CodeFixAction[] {
const fixes = codeFixRegistrations[context.errorCode];
const allActions: CodeFixAction[] = [];
forEach(fixes, f => {
const actions = f.getCodeActions(context);
@@ -52,5 +68,40 @@ namespace ts {
return allActions;
}
export function getAllFixes(context: CodeFixAllContext): CombinedCodeActions {
// Currently fixId is always a string.
return fixIdToRegistration.get(cast(context.fixId, isString))!.getAllCodeActions!(context);
}
function createCombinedCodeActions(changes: FileTextChanges[], commands?: CodeActionCommand[]): CombinedCodeActions {
return { changes, commands };
}
export function createFileTextChanges(fileName: string, textChanges: TextChange[]): FileTextChanges {
return { fileName, textChanges };
}
export function codeFixAll(context: CodeFixAllContext, errorCodes: number[], use: (changes: textChanges.ChangeTracker, error: Diagnostic, commands: Push<CodeActionCommand>) => void): CombinedCodeActions {
const commands: CodeActionCommand[] = [];
const changes = textChanges.ChangeTracker.with(context, t =>
eachDiagnostic(context, errorCodes, diag => use(t, diag, commands)));
return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands);
}
export function codeFixAllWithTextChanges(context: CodeFixAllContext, errorCodes: number[], use: (changes: Push<TextChange>, error: Diagnostic) => void): CombinedCodeActions {
const changes: TextChange[] = [];
eachDiagnostic(context, errorCodes, diag => use(changes, diag));
changes.sort((a, b) => b.span.start - a.span.start);
return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]);
}
function eachDiagnostic({ program, sourceFile }: CodeFixAllContext, errorCodes: number[], cb: (diag: Diagnostic) => void): void {
for (const diag of program.getSemanticDiagnostics(sourceFile)) {
if (contains(errorCodes, diag.code)) {
cb(diag);
}
}
}
}
}
@@ -1,20 +1,22 @@
/* @internal */
namespace ts.codefix {
const fixId = "addMissingInvocationForDecorator";
const errorCodes = [Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];
registerCodeFix({
errorCodes: [Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
const decorator = getAncestor(token, SyntaxKind.Decorator) as Decorator;
Debug.assert(!!decorator, "Expected position to be owned by a decorator.");
const replacement = createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined);
const changeTracker = textChanges.ChangeTracker.fromContext(context);
changeTracker.replaceNode(sourceFile, decorator.expression, replacement);
return [{
description: getLocaleSpecificMessage(Diagnostics.Call_decorator_expression),
changes: changeTracker.getChanges()
}];
}
errorCodes,
getCodeActions: (context) => {
const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start));
return [{ description: getLocaleSpecificMessage(Diagnostics.Call_decorator_expression), changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file!, diag.start!)),
});
function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number) {
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false);
const decorator = findAncestor(token, isDecorator)!;
Debug.assert(!!decorator, "Expected position to be owned by a decorator.");
const replacement = createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined);
changeTracker.replaceNode(sourceFile, decorator.expression, replacement);
}
}
@@ -1,27 +1,36 @@
/* @internal */
namespace ts.codefix {
const fixId = "correctQualifiedNameToIndexedAccessType";
const errorCodes = [Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];
registerCodeFix({
errorCodes: [Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
const qualifiedName = getAncestor(token, SyntaxKind.QualifiedName) as QualifiedName;
Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name.");
if (!isIdentifier(qualifiedName.left)) {
return undefined;
errorCodes,
getCodeActions(context) {
const qualifiedName = getQualifiedName(context.sourceFile, context.span.start);
if (!qualifiedName) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, qualifiedName));
const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Rewrite_as_the_indexed_access_type_0), [`${qualifiedName.left.text}["${qualifiedName.right.text}"]`]);
return [{ description, changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: (context) => codeFixAll(context, errorCodes, (changes, diag) => {
const q = getQualifiedName(diag.file, diag.start);
if (q) {
doChange(changes, diag.file, q);
}
const leftText = qualifiedName.left.getText(sourceFile);
const rightText = qualifiedName.right.getText(sourceFile);
const replacement = createIndexedAccessTypeNode(
createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined),
createLiteralTypeNode(createLiteral(rightText)));
const changeTracker = textChanges.ChangeTracker.fromContext(context);
changeTracker.replaceNode(sourceFile, qualifiedName, replacement);
return [{
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Rewrite_as_the_indexed_access_type_0), [`${leftText}["${rightText}"]`]),
changes: changeTracker.getChanges()
}];
}
}),
});
function getQualifiedName(sourceFile: SourceFile, pos: number): QualifiedName & { left: Identifier } | undefined {
const qualifiedName = findAncestor(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isQualifiedName)!;
Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name.");
return isIdentifier(qualifiedName.left) ? qualifiedName as QualifiedName & { left: Identifier } : undefined;
}
function doChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, qualifiedName: QualifiedName): void {
const rightText = qualifiedName.right.text;
const replacement = createIndexedAccessTypeNode(
createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined),
createLiteralTypeNode(createLiteral(rightText)));
changeTracker.replaceNode(sourceFile, qualifiedName, replacement);
}
}
+39 -39
View File
@@ -1,18 +1,47 @@
/* @internal */
namespace ts.codefix {
registerCodeFix({
errorCodes: getApplicableDiagnosticCodes(),
getCodeActions: getDisableJsDiagnosticsCodeActions
const fixId = "disableJsDiagnostics";
const errorCodes = mapDefined(Object.keys(Diagnostics), key => {
const diag = (Diagnostics as MapLike<DiagnosticMessage>)[key];
return diag.category === DiagnosticCategory.Error ? diag.code : undefined;
});
function getApplicableDiagnosticCodes(): number[] {
const allDiagnostcs = <MapLike<DiagnosticMessage>>Diagnostics;
return Object.keys(allDiagnostcs)
.filter(d => allDiagnostcs[d] && allDiagnostcs[d].category === DiagnosticCategory.Error)
.map(d => allDiagnostcs[d].code);
}
registerCodeFix({
errorCodes,
getCodeActions(context) {
const { sourceFile, program, newLineCharacter, span } = context;
function getIgnoreCommentLocationForLocation(sourceFile: SourceFile, position: number, newLineCharacter: string) {
if (!isInJavaScriptFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) {
return undefined;
}
return [{
description: getLocaleSpecificMessage(Diagnostics.Ignore_this_error_message),
changes: [createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)])],
fixId,
},
{
description: getLocaleSpecificMessage(Diagnostics.Disable_checking_for_this_file),
changes: [createFileTextChanges(sourceFile.fileName, [{
span: {
start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0,
length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0
},
newText: `// @ts-nocheck${newLineCharacter}`
}])],
// fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file.
fixId: undefined,
}];
},
fixIds: [fixId], // No point applying as a group, doing it once will fix all errors
getAllCodeActions: context => codeFixAllWithTextChanges(context, errorCodes, (changes, err) => {
if (err.start !== undefined) {
changes.push(getIgnoreCommentLocationForLocation(err.file!, err.start, context.newLineCharacter));
}
}),
});
function getIgnoreCommentLocationForLocation(sourceFile: SourceFile, position: number, newLineCharacter: string): TextChange {
const { line } = getLineAndCharacterOfPosition(sourceFile, position);
const lineStartPosition = getStartPositionOfLine(line, sourceFile);
const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition);
@@ -38,33 +67,4 @@ namespace ts.codefix {
newText: `${position === startPosition ? "" : newLineCharacter}// @ts-ignore${newLineCharacter}`
};
}
function getDisableJsDiagnosticsCodeActions(context: CodeFixContext): CodeAction[] | undefined {
const { sourceFile, program, newLineCharacter, span } = context;
if (!isInJavaScriptFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) {
return undefined;
}
return [{
description: getLocaleSpecificMessage(Diagnostics.Ignore_this_error_message),
changes: [{
fileName: sourceFile.fileName,
textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)]
}]
},
{
description: getLocaleSpecificMessage(Diagnostics.Disable_checking_for_this_file),
changes: [{
fileName: sourceFile.fileName,
textChanges: [{
span: {
start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0,
length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0
},
newText: `// @ts-nocheck${newLineCharacter}`
}]
}]
}];
}
}
+169 -184
View File
@@ -1,209 +1,194 @@
/* @internal */
namespace ts.codefix {
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,
];
const fixId = "addMissingMember";
registerCodeFix({
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],
getCodeActions: getActionsForAddMissingMember
errorCodes,
getCodeActions(context) {
const info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker());
if (!info) return undefined;
const { classDeclaration, classDeclarationSourceFile, inJs, makeStatic, token, call } = info;
const methodCodeAction = call && getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs);
const addMember = inJs ?
singleElementArray(getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, token.text, makeStatic)) :
getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic);
return concatenate(singleElementArray(methodCodeAction), addMember);
},
fixIds: [fixId],
getAllCodeActions: context => {
const seenNames = createMap<true>();
return codeFixAll(context, errorCodes, (changes, diag) => {
const { program } = context;
const info = getInfo(diag.file!, diag.start!, program.getTypeChecker());
if (!info) return;
const { classDeclaration, classDeclarationSourceFile, inJs, makeStatic, token, call } = info;
if (!addToSeen(seenNames, token.text)) {
return;
}
// Always prefer to add a method declaration if possible.
if (call) {
addMethodDeclaration(changes, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs);
}
else {
if (inJs) {
addMissingMemberInJs(changes, classDeclarationSourceFile, classDeclaration, token.text, makeStatic);
}
else {
const typeNode = getTypeNode(program.getTypeChecker(), classDeclaration, token);
addPropertyDeclaration(changes, classDeclarationSourceFile, classDeclaration, token.text, typeNode, makeStatic);
}
}
});
},
});
function getActionsForAddMissingMember(context: CodeFixContext): CodeAction[] | undefined {
const tokenSourceFile = context.sourceFile;
const start = context.span.start;
interface Info { token: Identifier; classDeclaration: ClassLikeDeclaration; makeStatic: boolean; classDeclarationSourceFile: SourceFile; inJs: boolean; call: CallExpression; }
function getInfo(tokenSourceFile: SourceFile, tokenPos: number, checker: TypeChecker): Info | undefined {
// The identifier of the missing property. eg:
// this.missing = 1;
// ^^^^^^^
const token = getTokenAtPosition(tokenSourceFile, start, /*includeJsDocComment*/ false);
if (token.kind !== SyntaxKind.Identifier) {
const token = getTokenAtPosition(tokenSourceFile, tokenPos, /*includeJsDocComment*/ false);
if (!isIdentifier(token)) {
return undefined;
}
if (!isPropertyAccessExpression(token.parent)) {
const classAndMakeStatic = getClassAndMakeStatic(token, checker);
if (!classAndMakeStatic) {
return undefined;
}
const { classDeclaration, makeStatic } = classAndMakeStatic;
const classDeclarationSourceFile = classDeclaration.getSourceFile();
const inJs = isInJavaScriptFile(classDeclarationSourceFile);
const call = tryCast(token.parent.parent, isCallExpression);
return { token, classDeclaration, makeStatic, classDeclarationSourceFile, inJs, call };
}
function getClassAndMakeStatic(token: Node, checker: TypeChecker): { readonly classDeclaration: ClassLikeDeclaration, readonly makeStatic: boolean } | undefined {
const { parent } = token;
if (!isPropertyAccessExpression(parent)) {
return undefined;
}
const tokenName = token.getText(tokenSourceFile);
let makeStatic = false;
let classDeclaration: ClassLikeDeclaration;
if (token.parent.expression.kind === SyntaxKind.ThisKeyword) {
if (parent.expression.kind === SyntaxKind.ThisKeyword) {
const containingClassMemberDeclaration = getThisContainer(token, /*includeArrowFunctions*/ false);
if (!isClassElement(containingClassMemberDeclaration)) {
return undefined;
}
classDeclaration = <ClassLikeDeclaration>containingClassMemberDeclaration.parent;
const classDeclaration = containingClassMemberDeclaration.parent;
// Property accesses on `this` in a static method are accesses of a static member.
makeStatic = classDeclaration && hasModifier(containingClassMemberDeclaration, ModifierFlags.Static);
return isClassLike(classDeclaration) ? { classDeclaration, makeStatic: hasModifier(containingClassMemberDeclaration, ModifierFlags.Static) } : undefined;
}
else {
const checker = context.program.getTypeChecker();
const leftExpression = token.parent.expression;
const leftExpressionType = checker.getTypeAtLocation(leftExpression);
if (leftExpressionType.flags & TypeFlags.Object) {
const symbol = leftExpressionType.symbol;
if (symbol.flags & SymbolFlags.Class) {
classDeclaration = symbol.declarations && <ClassLikeDeclaration>symbol.declarations[0];
if (leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol)) {
// The expression is a class symbol but the type is not the instance-side.
makeStatic = true;
}
}
}
}
if (!classDeclaration || !isClassLike(classDeclaration)) {
return undefined;
}
const classDeclarationSourceFile = getSourceFileOfNode(classDeclaration);
const classOpenBrace = getOpenBraceOfClassLike(classDeclaration, classDeclarationSourceFile);
return isInJavaScriptFile(classDeclarationSourceFile) ?
getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) :
getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic);
function getActionsForAddMissingMemberInJavaScriptFile(classDeclaration: ClassLikeDeclaration, makeStatic: boolean): CodeAction[] | undefined {
let actions: CodeAction[];
const methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ false);
if (methodCodeAction) {
actions = [methodCodeAction];
}
if (makeStatic) {
if (classDeclaration.kind === SyntaxKind.ClassExpression) {
return actions;
}
const className = classDeclaration.name.getText();
const staticInitialization = createStatement(createAssignment(
createPropertyAccess(createIdentifier(className), tokenName),
createIdentifier("undefined")));
const staticInitializationChangeTracker = textChanges.ChangeTracker.fromContext(context);
staticInitializationChangeTracker.insertNodeAfter(
classDeclarationSourceFile,
classDeclaration,
staticInitialization,
{ prefix: context.newLineCharacter, suffix: context.newLineCharacter });
const initializeStaticAction = {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Initialize_static_property_0), [tokenName]),
changes: staticInitializationChangeTracker.getChanges()
};
(actions || (actions = [])).push(initializeStaticAction);
return actions;
}
else {
const classConstructor = getFirstConstructorWithBody(classDeclaration);
if (!classConstructor) {
return actions;
}
const propertyInitialization = createStatement(createAssignment(
createPropertyAccess(createThis(), tokenName),
createIdentifier("undefined")));
const propertyInitializationChangeTracker = textChanges.ChangeTracker.fromContext(context);
propertyInitializationChangeTracker.insertNodeBefore(
classDeclarationSourceFile,
classConstructor.body.getLastToken(),
propertyInitialization,
{ suffix: context.newLineCharacter });
const initializeAction = {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]),
changes: propertyInitializationChangeTracker.getChanges()
};
(actions || (actions = [])).push(initializeAction);
return actions;
}
}
function getActionsForAddMissingMemberInTypeScriptFile(classDeclaration: ClassLikeDeclaration, makeStatic: boolean): CodeAction[] | undefined {
let actions: CodeAction[];
const methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ true);
if (methodCodeAction) {
actions = [methodCodeAction];
}
let typeNode: TypeNode;
if (token.parent.parent.kind === SyntaxKind.BinaryExpression) {
const binaryExpression = token.parent.parent as BinaryExpression;
const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;
const checker = context.program.getTypeChecker();
const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));
typeNode = checker.typeToTypeNode(widenedType, classDeclaration);
}
typeNode = typeNode || createKeywordTypeNode(SyntaxKind.AnyKeyword);
const property = createProperty(
/*decorators*/undefined,
/*modifiers*/ makeStatic ? [createToken(SyntaxKind.StaticKeyword)] : undefined,
tokenName,
/*questionToken*/ undefined,
typeNode,
/*initializer*/ undefined);
const propertyChangeTracker = textChanges.ChangeTracker.fromContext(context);
propertyChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, property, { suffix: context.newLineCharacter });
const diag = makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0;
actions = append(actions, {
description: formatStringFromArgs(getLocaleSpecificMessage(diag), [tokenName]),
changes: propertyChangeTracker.getChanges()
});
if (!makeStatic) {
// Index signatures cannot have the static modifier.
const stringTypeNode = createKeywordTypeNode(SyntaxKind.StringKeyword);
const indexingParameter = createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
"x",
/*questionToken*/ undefined,
stringTypeNode,
/*initializer*/ undefined);
const indexSignature = createIndexSignature(
/*decorators*/ undefined,
/*modifiers*/ undefined,
[indexingParameter],
typeNode);
const indexSignatureChangeTracker = textChanges.ChangeTracker.fromContext(context);
indexSignatureChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, indexSignature, { suffix: context.newLineCharacter });
actions.push({
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_index_signature_for_property_0), [tokenName]),
changes: indexSignatureChangeTracker.getChanges()
});
}
return actions;
}
function getActionForMethodDeclaration(includeTypeScriptSyntax: boolean): CodeAction | undefined {
if (token.parent.parent.kind === SyntaxKind.CallExpression) {
const callExpression = <CallExpression>token.parent.parent;
const methodDeclaration = createMethodFromCallExpression(callExpression, tokenName, includeTypeScriptSyntax, makeStatic);
const methodDeclarationChangeTracker = textChanges.ChangeTracker.fromContext(context);
methodDeclarationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, methodDeclaration, { suffix: context.newLineCharacter });
const diag = makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0;
return {
description: formatStringFromArgs(getLocaleSpecificMessage(diag), [tokenName]),
changes: methodDeclarationChangeTracker.getChanges()
};
const leftExpressionType = checker.getTypeAtLocation(parent.expression);
const { symbol } = leftExpressionType;
if (!(leftExpressionType.flags & TypeFlags.Object && symbol.flags & SymbolFlags.Class)) {
return undefined;
}
const classDeclaration = cast(first(symbol.declarations), isClassLike);
// The expression is a class symbol but the type is not the instance-side.
return { classDeclaration, makeStatic: leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol) };
}
}
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));
if (changes.length === 0) return undefined;
const description = formatStringFromArgs(getLocaleSpecificMessage(makeStatic ? Diagnostics.Initialize_static_property_0 : Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]);
return { description, changes, fixId };
}
function addMissingMemberInJs(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, makeStatic: boolean): void {
if (makeStatic) {
if (classDeclaration.kind === SyntaxKind.ClassExpression) {
return;
}
const className = classDeclaration.name.getText();
const staticInitialization = initializePropertyToUndefined(createIdentifier(className), tokenName);
changeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization);
}
else {
const classConstructor = getFirstConstructorWithBody(classDeclaration);
if (!classConstructor) {
return;
}
const propertyInitialization = initializePropertyToUndefined(createThis(), tokenName);
changeTracker.insertNodeAtConstructorEnd(classDeclarationSourceFile, classConstructor, propertyInitialization);
}
}
function initializePropertyToUndefined(obj: Expression, propertyName: string) {
return createStatement(createAssignment(createPropertyAccess(obj, propertyName), createIdentifier("undefined")));
}
function getActionsForAddMissingMemberInTypeScriptFile(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, token: Identifier, makeStatic: boolean): CodeFixAction[] | undefined {
const typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token);
const addProp = createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, token.text, typeNode);
return makeStatic ? [addProp] : [addProp, createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, token.text, typeNode)];
}
function getTypeNode(checker: TypeChecker, classDeclaration: ClassLikeDeclaration, token: Node) {
let typeNode: TypeNode;
if (token.parent.parent.kind === SyntaxKind.BinaryExpression) {
const binaryExpression = token.parent.parent as BinaryExpression;
const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left;
const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression)));
typeNode = checker.typeToTypeNode(widenedType, classDeclaration);
}
return typeNode || createKeywordTypeNode(SyntaxKind.AnyKeyword);
}
function createAddPropertyDeclarationAction(context: textChanges.TextChangesContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, makeStatic: boolean, tokenName: string, typeNode: TypeNode): CodeFixAction {
const description = formatStringFromArgs(getLocaleSpecificMessage(makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0), [tokenName]);
const changes = textChanges.ChangeTracker.with(context, t => addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic));
return { description, changes, fixId };
}
function addPropertyDeclaration(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, typeNode: TypeNode, makeStatic: boolean): void {
const property = createProperty(
/*decorators*/ undefined,
/*modifiers*/ makeStatic ? [createToken(SyntaxKind.StaticKeyword)] : undefined,
tokenName,
/*questionToken*/ undefined,
typeNode,
/*initializer*/ undefined);
changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, property);
}
function createAddIndexSignatureAction(context: textChanges.TextChangesContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, typeNode: TypeNode): CodeFixAction {
// Index signatures cannot have the static modifier.
const stringTypeNode = createKeywordTypeNode(SyntaxKind.StringKeyword);
const indexingParameter = createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
"x",
/*questionToken*/ undefined,
stringTypeNode,
/*initializer*/ undefined);
const indexSignature = createIndexSignature(
/*decorators*/ undefined,
/*modifiers*/ undefined,
[indexingParameter],
typeNode);
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 { description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_index_signature_for_property_0), [tokenName]), changes, fixId: undefined };
}
function getActionForMethodDeclaration(context: textChanges.TextChangesContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, token: Identifier, callExpression: CallExpression, makeStatic: boolean, inJs: boolean): CodeFixAction | undefined {
const description = formatStringFromArgs(getLocaleSpecificMessage(makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0), [token.text]);
const changes = textChanges.ChangeTracker.with(context, t => addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs));
return { description, changes, fixId };
}
function addMethodDeclaration(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, token: Identifier, callExpression: CallExpression, makeStatic: boolean, inJs: boolean) {
const methodDeclaration = createMethodFromCallExpression(callExpression, token.text, inJs, makeStatic);
changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration);
}
}
+28 -21
View File
@@ -1,34 +1,41 @@
/* @internal */
namespace ts.codefix {
const fixId = "fixCannotFindModule";
const errorCodes = [Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code];
registerCodeFix({
errorCodes: [
Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
errorCodes,
getCodeActions: context => [
{ fixId, ...tryGetCodeActionForInstallPackageTypes(context.host, context.sourceFile.fileName, getModuleName(context.sourceFile, context.span.start)) }
],
getCodeActions: context => {
const { sourceFile, span: { start } } = context;
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
if (!isStringLiteral(token)) {
throw Debug.fail(); // These errors should only happen on the module name.
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (_, diag, commands) => {
const pkg = getTypesPackageNameToInstall(context.host, getModuleName(diag.file, diag.start));
if (pkg) {
commands.push(getCommand(diag.file.fileName, pkg));
}
const action = tryGetCodeActionForInstallPackageTypes(context.host, sourceFile.fileName, token.text);
return action && [action];
},
}),
});
export function tryGetCodeActionForInstallPackageTypes(host: LanguageServiceHost, fileName: string, moduleName: string): CodeAction | undefined {
function getModuleName(sourceFile: SourceFile, pos: number): string {
return cast(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isStringLiteral).text;
}
function getCommand(fileName: string, packageName: string): InstallPackageAction {
return { type: "install package", file: fileName, packageName };
}
function getTypesPackageNameToInstall(host: LanguageServiceHost, moduleName: string): string | undefined {
const { packageName } = getPackageName(moduleName);
// If !registry, registry not available yet, can't do anything.
return host.isKnownTypesPackageName(packageName) ? getTypesPackageName(packageName) : undefined;
}
if (!host.isKnownTypesPackageName(packageName)) {
// If !registry, registry not available yet, can't do anything.
return undefined;
}
const typesPackageName = getTypesPackageName(packageName);
return {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Install_0), [typesPackageName]),
export function tryGetCodeActionForInstallPackageTypes(host: LanguageServiceHost, fileName: string, moduleName: string): CodeAction | undefined {
const packageName = getTypesPackageNameToInstall(host, moduleName);
return packageName === undefined ? undefined : {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Install_0), [packageName]),
changes: [],
commands: [{ type: "install package", file: fileName, packageName: typesPackageName }],
commands: [getCommand(fileName, packageName)],
};
}
}
@@ -1,52 +1,48 @@
/* @internal */
namespace ts.codefix {
const errorCodes = [
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,
];
const fixId = "fixClassDoesntImplementInheritedAbstractMember";
registerCodeFix({
errorCodes: [Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code],
getCodeActions: getActionForClassLikeMissingAbstractMember
errorCodes,
getCodeActions(context) {
const { program, sourceFile, span } = context;
const changes = textChanges.ChangeTracker.with(context, t =>
addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t));
return changes.length === 0 ? undefined : [{ description: getLocaleSpecificMessage(Diagnostics.Implement_inherited_abstract_class), changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
addMissingMembers(getClass(diag.file!, diag.start!), context.sourceFile, context.program.getTypeChecker(), changes);
}),
});
registerCodeFix({
errorCodes: [Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code],
getCodeActions: getActionForClassLikeMissingAbstractMember
});
function getActionForClassLikeMissingAbstractMember(context: CodeFixContext): CodeAction[] | undefined {
const sourceFile = context.sourceFile;
const start = context.span.start;
function getClass(sourceFile: SourceFile, pos: number): ClassLikeDeclaration {
// This is the identifier in the case of a class declaration
// or the class keyword token in the case of a class expression.
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
const checker = context.program.getTypeChecker();
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false);
const classDeclaration = token.parent;
Debug.assert(isClassLike(classDeclaration));
return classDeclaration as ClassLikeDeclaration;
}
if (isClassLike(token.parent)) {
const classDeclaration = token.parent as ClassLikeDeclaration;
function addMissingMembers(classDeclaration: ClassLikeDeclaration, sourceFile: SourceFile, checker: TypeChecker, changeTracker: textChanges.ChangeTracker): void {
const extendsNode = getClassExtendsHeritageClauseElement(classDeclaration);
const instantiatedExtendsType = checker.getTypeAtLocation(extendsNode);
const extendsNode = getClassExtendsHeritageClauseElement(classDeclaration);
const instantiatedExtendsType = checker.getTypeAtLocation(extendsNode);
// Note that this is ultimately derived from a map indexed by symbol names,
// so duplicates cannot occur.
const extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType);
const abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember);
const newNodes = createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker);
const changes = newNodesToChanges(newNodes, getOpenBraceOfClassLike(classDeclaration, sourceFile), context);
if (changes && changes.length > 0) {
return [{
description: getLocaleSpecificMessage(Diagnostics.Implement_inherited_abstract_class),
changes
}];
}
}
return undefined;
// Note that this is ultimately derived from a map indexed by symbol names,
// so duplicates cannot occur.
const abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember);
createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, member => changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member));
}
function symbolPointsToNonPrivateAndAbstractMember(symbol: Symbol): boolean {
const decls = symbol.getDeclarations();
Debug.assert(!!(decls && decls.length > 0));
const flags = getModifierFlags(decls[0]);
// See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files
// (now named `codeFixClassExtendAbstractPrivateProperty.ts`)
const flags = getModifierFlags(first(symbol.getDeclarations()));
return !(flags & ModifierFlags.Private) && !!(flags & ModifierFlags.Abstract);
}
}
}
@@ -1,64 +1,70 @@
/* @internal */
namespace ts.codefix {
const errorCodes = [Diagnostics.Class_0_incorrectly_implements_interface_1.code,
Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code];
const fixId = "fixClassIncorrectlyImplementsInterface"; // TODO: share a group with fixClassDoesntImplementInheritedAbstractMember?
registerCodeFix({
errorCodes: [Diagnostics.Class_0_incorrectly_implements_interface_1.code],
getCodeActions: getActionForClassLikeIncorrectImplementsInterface
errorCodes,
getCodeActions(context) {
const { program, sourceFile, span } = context;
const classDeclaration = getClass(sourceFile, span.start);
const checker = program.getTypeChecker();
return mapDefined<ExpressionWithTypeArguments, CodeFixAction>(getClassImplementsHeritageClauseElements(classDeclaration), implementedTypeNode => {
const changes = textChanges.ChangeTracker.with(context, t => addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t));
if (changes.length === 0) return undefined;
const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]);
return { description, changes, fixId };
});
},
fixIds: [fixId],
getAllCodeActions(context) {
const seenClassDeclarations = createMap<true>();
return codeFixAll(context, errorCodes, (changes, diag) => {
const classDeclaration = getClass(diag.file!, diag.start!);
if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) {
for (const implementedTypeNode of getClassImplementsHeritageClauseElements(classDeclaration)) {
addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file!, classDeclaration, changes);
}
}
});
},
});
function getActionForClassLikeIncorrectImplementsInterface(context: CodeFixContext): CodeAction[] | undefined {
const sourceFile = context.sourceFile;
const start = context.span.start;
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
const checker = context.program.getTypeChecker();
function getClass(sourceFile: SourceFile, pos: number): ClassLikeDeclaration {
const classDeclaration = getContainingClass(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false));
Debug.assert(!!classDeclaration);
return classDeclaration!;
}
const classDeclaration = getContainingClass(token);
if (!classDeclaration) {
return undefined;
function addMissingDeclarations(
checker: TypeChecker,
implementedTypeNode: ExpressionWithTypeArguments,
sourceFile: SourceFile,
classDeclaration: ClassLikeDeclaration,
changeTracker: textChanges.ChangeTracker
): void {
// Note that this is ultimately derived from a map indexed by symbol names,
// so duplicates cannot occur.
const implementedType = checker.getTypeAtLocation(implementedTypeNode) as InterfaceType;
const implementedTypeSymbols = checker.getPropertiesOfType(implementedType);
const nonPrivateMembers = implementedTypeSymbols.filter(symbol => !(getModifierFlags(symbol.valueDeclaration) & ModifierFlags.Private));
const classType = checker.getTypeAtLocation(classDeclaration);
if (!checker.getIndexTypeOfType(classType, IndexKind.Number)) {
createMissingIndexSignatureDeclaration(implementedType, IndexKind.Number);
}
if (!checker.getIndexTypeOfType(classType, IndexKind.String)) {
createMissingIndexSignatureDeclaration(implementedType, IndexKind.String);
}
const openBrace = getOpenBraceOfClassLike(classDeclaration, sourceFile);
const classType = checker.getTypeAtLocation(classDeclaration) as InterfaceType;
const implementedTypeNodes = getClassImplementsHeritageClauseElements(classDeclaration);
const hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, IndexKind.Number);
const hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, IndexKind.String);
const result: CodeAction[] = [];
for (const implementedTypeNode of implementedTypeNodes) {
// Note that this is ultimately derived from a map indexed by symbol names,
// so duplicates cannot occur.
const implementedType = checker.getTypeAtLocation(implementedTypeNode) as InterfaceType;
const implementedTypeSymbols = checker.getPropertiesOfType(implementedType);
const nonPrivateMembers = implementedTypeSymbols.filter(symbol => !(getModifierFlags(symbol.valueDeclaration) & ModifierFlags.Private));
let newNodes: Node[] = [];
createAndAddMissingIndexSignatureDeclaration(implementedType, IndexKind.Number, hasNumericIndexSignature, newNodes);
createAndAddMissingIndexSignatureDeclaration(implementedType, IndexKind.String, hasStringIndexSignature, newNodes);
newNodes = newNodes.concat(createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker));
const message = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]);
if (newNodes.length > 0) {
pushAction(result, newNodes, message);
}
}
return result;
function createAndAddMissingIndexSignatureDeclaration(type: InterfaceType, kind: IndexKind, hasIndexSigOfKind: boolean, newNodes: Node[]): void {
if (hasIndexSigOfKind) {
return;
}
createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker, member => changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member));
function createMissingIndexSignatureDeclaration(type: InterfaceType, kind: IndexKind): void {
const indexInfoOfKind = checker.getIndexInfoOfType(type, kind);
if (!indexInfoOfKind) {
return;
if (indexInfoOfKind) {
changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration));
}
const newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration);
newNodes.push(newIndexSignatureDeclaration);
}
function pushAction(result: CodeAction[], newNodes: Node[], description: string): void {
result.push({ description, changes: newNodesToChanges(newNodes, openBrace, context) });
}
}
}
}
@@ -1,49 +1,52 @@
/* @internal */
namespace ts.codefix {
const fixId = "classSuperMustPrecedeThisAccess";
const errorCodes = [Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];
registerCodeFix({
errorCodes: [Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
if (token.kind !== SyntaxKind.ThisKeyword) {
return undefined;
}
const constructor = getContainingFunction(token);
const superCall = findSuperCall((<ConstructorDeclaration>constructor).body);
if (!superCall) {
return undefined;
}
// figure out if the `this` access is actually inside the supercall
// i.e. super(this.a), since in that case we won't suggest a fix
if (superCall.expression && superCall.expression.kind === SyntaxKind.CallExpression) {
const expressionArguments = (<CallExpression>superCall.expression).arguments;
for (const arg of expressionArguments) {
if ((<PropertyAccessExpression>arg).expression === token) {
return undefined;
}
errorCodes,
getCodeActions(context) {
const { sourceFile, span } = context;
const nodes = getNodes(sourceFile, span.start);
if (!nodes) return undefined;
const { constructor, superCall } = nodes;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, constructor, superCall));
return [{ description: getLocaleSpecificMessage(Diagnostics.Make_super_call_the_first_statement_in_the_constructor), changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions(context) {
const { sourceFile } = context;
const seenClasses = createMap<true>(); // Ensure we only do this once per class.
return codeFixAll(context, errorCodes, (changes, diag) => {
const nodes = getNodes(diag.file!, diag.start!);
if (!nodes) return;
const { constructor, superCall } = nodes;
if (addToSeen(seenClasses, getNodeId(constructor.parent))) {
doChange(changes, sourceFile, constructor, superCall);
}
}
const changeTracker = textChanges.ChangeTracker.fromContext(context);
changeTracker.insertNodeAfter(sourceFile, getOpenBrace(<ConstructorDeclaration>constructor, sourceFile), superCall, { suffix: context.newLineCharacter });
changeTracker.deleteNode(sourceFile, superCall);
return [{
description: getLocaleSpecificMessage(Diagnostics.Make_super_call_the_first_statement_in_the_constructor),
changes: changeTracker.getChanges()
}];
function findSuperCall(n: Node): ExpressionStatement {
if (n.kind === SyntaxKind.ExpressionStatement && isSuperCall((<ExpressionStatement>n).expression)) {
return <ExpressionStatement>n;
}
if (isFunctionLike(n)) {
return undefined;
}
return forEachChild(n, findSuperCall);
}
}
});
},
});
function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, constructor: ConstructorDeclaration, superCall: ExpressionStatement): void {
changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall);
changes.deleteNode(sourceFile, superCall);
}
function getNodes(sourceFile: SourceFile, pos: number): { readonly constructor: ConstructorDeclaration, readonly superCall: ExpressionStatement } {
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false);
Debug.assert(token.kind === SyntaxKind.ThisKeyword);
const constructor = getContainingFunction(token) as ConstructorDeclaration;
const superCall = findSuperCall(constructor.body);
// figure out if the `this` access is actually inside the supercall
// i.e. super(this.a), since in that case we won't suggest a fix
return superCall && !superCall.expression.arguments.some(arg => isPropertyAccessExpression(arg) && arg.expression === token) ? { constructor, superCall } : undefined;
}
function findSuperCall(n: Node): ExpressionStatement & { expression: CallExpression } | undefined {
return isExpressionStatement(n) && isSuperCall(n.expression)
? n as ExpressionStatement & { expression: CallExpression }
: isFunctionLike(n)
? undefined
: forEachChild(n, findSuperCall);
}
}
@@ -1,23 +1,28 @@
/* @internal */
namespace ts.codefix {
const fixId = "constructorForDerivedNeedSuperCall";
const errorCodes = [Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];
registerCodeFix({
errorCodes: [Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
if (token.kind !== SyntaxKind.ConstructorKeyword) {
return undefined;
}
const changeTracker = textChanges.ChangeTracker.fromContext(context);
const superCall = createStatement(createCall(createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ emptyArray));
changeTracker.insertNodeAfter(sourceFile, getOpenBrace(<ConstructorDeclaration>token.parent, sourceFile), superCall, { suffix: context.newLineCharacter });
return [{
description: getLocaleSpecificMessage(Diagnostics.Add_missing_super_call),
changes: changeTracker.getChanges()
}];
}
errorCodes,
getCodeActions(context) {
const { sourceFile, span } = context;
const ctr = getNode(sourceFile, span.start);
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, ctr));
return [{ description: getLocaleSpecificMessage(Diagnostics.Add_missing_super_call), changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) =>
doChange(changes, context.sourceFile, getNode(diag.file, diag.start!))),
});
}
function getNode(sourceFile: SourceFile, pos: number): ConstructorDeclaration {
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false);
Debug.assert(token.kind === SyntaxKind.ConstructorKeyword);
return token.parent as ConstructorDeclaration;
}
function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, ctr: ConstructorDeclaration) {
const superCall = createStatement(createCall(createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ emptyArray));
changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall);
}
}
@@ -1,43 +1,37 @@
/* @internal */
namespace ts.codefix {
const fixId = "extendsInterfaceBecomesImplements";
const errorCodes = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];
registerCodeFix({
errorCodes: [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const start = context.span.start;
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
const classDeclNode = getContainingClass(token);
if (!(token.kind === SyntaxKind.Identifier && isClassLike(classDeclNode))) {
return undefined;
}
const heritageClauses = classDeclNode.heritageClauses;
if (!(heritageClauses && heritageClauses.length > 0)) {
return undefined;
}
const extendsToken = heritageClauses[0].getFirstToken();
if (!(extendsToken && extendsToken.kind === SyntaxKind.ExtendsKeyword)) {
return undefined;
}
const changeTracker = textChanges.ChangeTracker.fromContext(context);
changeTracker.replaceNode(sourceFile, extendsToken, createToken(SyntaxKind.ImplementsKeyword));
// We replace existing keywords with commas.
for (let i = 1; i < heritageClauses.length; i++) {
const keywordToken = heritageClauses[i].getFirstToken();
if (keywordToken) {
changeTracker.replaceNode(sourceFile, keywordToken, createToken(SyntaxKind.CommaToken));
}
}
const result = [{
description: getLocaleSpecificMessage(Diagnostics.Change_extends_to_implements),
changes: changeTracker.getChanges()
}];
return result;
}
errorCodes,
getCodeActions(context) {
const { sourceFile } = context;
const nodes = getNodes(sourceFile, context.span.start);
if (!nodes) return undefined;
const { extendsToken, heritageClauses } = nodes;
const changes = textChanges.ChangeTracker.with(context, t => doChanges(t, sourceFile, extendsToken, heritageClauses));
return [{ description: getLocaleSpecificMessage(Diagnostics.Change_extends_to_implements), changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
const nodes = getNodes(diag.file, diag.start!);
if (nodes) doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses);
}),
});
function getNodes(sourceFile: SourceFile, pos: number) {
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false);
const heritageClauses = getContainingClass(token)!.heritageClauses;
const extendsToken = heritageClauses[0].getFirstToken();
return extendsToken.kind === SyntaxKind.ExtendsKeyword ? { extendsToken, heritageClauses } : undefined;
}
function doChanges(changes: textChanges.ChangeTracker, sourceFile: SourceFile, extendsToken: Node, heritageClauses: ReadonlyArray<HeritageClause>): void {
changes.replaceNode(sourceFile, extendsToken, createToken(SyntaxKind.ImplementsKeyword));
// We replace existing keywords with commas.
for (let i = 1; i < heritageClauses.length; i++) {
const keywordToken = heritageClauses[i].getFirstToken()!;
changes.replaceNode(sourceFile, keywordToken, createToken(SyntaxKind.CommaToken));
}
}
}
@@ -1,20 +1,26 @@
/* @internal */
namespace ts.codefix {
const fixId = "forgottenThisPropertyAccess";
const errorCodes = [Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code];
registerCodeFix({
errorCodes: [Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
if (token.kind !== SyntaxKind.Identifier) {
return undefined;
}
const changeTracker = textChanges.ChangeTracker.fromContext(context);
changeTracker.replaceNode(sourceFile, token, createPropertyAccess(createThis(), <Identifier>token));
return [{
description: getLocaleSpecificMessage(Diagnostics.Add_this_to_unresolved_variable),
changes: changeTracker.getChanges()
}];
}
errorCodes,
getCodeActions(context) {
const { sourceFile } = context;
const token = getNode(sourceFile, context.span.start);
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, token));
return [{ description: getLocaleSpecificMessage(Diagnostics.Add_this_to_unresolved_variable), changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
doChange(changes, context.sourceFile, getNode(diag.file, diag.start!));
}),
});
function getNode(sourceFile: SourceFile, pos: number): Identifier {
return cast(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isIdentifier);
}
function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Identifier): void {
changes.replaceNode(sourceFile, token, createPropertyAccess(createThis(), token));
}
}
+80 -50
View File
@@ -1,61 +1,91 @@
/* @internal */
namespace ts.codefix {
const fixIdPlain = "fixJSDocTypes_plain";
const fixIdNullable = "fixJSDocTypes_nullable";
const errorCodes = [Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code];
registerCodeFix({
errorCodes: [Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code],
getCodeActions: getActionsForJSDocTypes
errorCodes,
getCodeActions(context) {
const { sourceFile } = context;
const checker = context.program.getTypeChecker();
const info = getInfo(sourceFile, context.span.start, checker);
if (!info) return undefined;
const { typeNode, type } = info;
const original = typeNode.getText(sourceFile);
const actions = [fix(type, fixIdPlain)];
if (typeNode.kind === SyntaxKind.JSDocNullableType) {
// for nullable types, suggest the flow-compatible `T | null | undefined`
// in addition to the jsdoc/closure-compatible `T | null`
actions.push(fix(checker.getNullableType(type, TypeFlags.Undefined), fixIdNullable));
}
return actions;
function fix(type: Type, fixId: string): CodeFixAction {
const newText = typeString(type, checker);
return {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Change_0_to_1), [original, newText]),
changes: [createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])],
fixId,
};
}
},
fixIds: [fixIdPlain, fixIdNullable],
getAllCodeActions(context) {
const { fixId, program, sourceFile } = context;
const checker = program.getTypeChecker();
return codeFixAllWithTextChanges(context, errorCodes, (changes, err) => {
const info = getInfo(err.file, err.start!, checker);
if (!info) return;
const { typeNode, type } = info;
const fixedType = typeNode.kind === SyntaxKind.JSDocNullableType && fixId === fixIdNullable ? checker.getNullableType(type, TypeFlags.Undefined) : type;
changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker)));
});
}
});
function getActionsForJSDocTypes(context: CodeFixContext): CodeAction[] | undefined {
const sourceFile = context.sourceFile;
const node = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false);
function getInfo(sourceFile: SourceFile, pos: number, checker: TypeChecker): { readonly typeNode: TypeNode, type: Type } {
const decl = findAncestor(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isTypeContainer);
const typeNode = decl && decl.type;
return typeNode && { typeNode, type: checker.getTypeFromTypeNode(typeNode) };
}
function createChange(declaration: TypeNode, sourceFile: SourceFile, newText: string): TextChange {
return { span: createTextSpanFromBounds(declaration.getStart(sourceFile), declaration.getEnd()), newText };
}
function typeString(type: Type, checker: TypeChecker): string {
return checker.typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.NoTruncation);
}
// TODO: GH#19856 Node & { type: TypeNode }
type TypeContainer =
| AsExpression | CallSignatureDeclaration | ConstructSignatureDeclaration | FunctionDeclaration
| GetAccessorDeclaration | IndexSignatureDeclaration | MappedTypeNode | MethodDeclaration
| MethodSignature | ParameterDeclaration | PropertyDeclaration | PropertySignature | SetAccessorDeclaration
| TypeAliasDeclaration | TypeAssertion | VariableDeclaration;
function isTypeContainer(node: Node): node is TypeContainer {
// NOTE: Some locations are not handled yet:
// MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments
const decl = ts.findAncestor(node,
n =>
n.kind === SyntaxKind.AsExpression ||
n.kind === SyntaxKind.CallSignature ||
n.kind === SyntaxKind.ConstructSignature ||
n.kind === SyntaxKind.FunctionDeclaration ||
n.kind === SyntaxKind.GetAccessor ||
n.kind === SyntaxKind.IndexSignature ||
n.kind === SyntaxKind.MappedType ||
n.kind === SyntaxKind.MethodDeclaration ||
n.kind === SyntaxKind.MethodSignature ||
n.kind === SyntaxKind.Parameter ||
n.kind === SyntaxKind.PropertyDeclaration ||
n.kind === SyntaxKind.PropertySignature ||
n.kind === SyntaxKind.SetAccessor ||
n.kind === SyntaxKind.TypeAliasDeclaration ||
n.kind === SyntaxKind.TypeAssertionExpression ||
n.kind === SyntaxKind.VariableDeclaration);
if (!decl) return;
const checker = context.program.getTypeChecker();
const jsdocType = (decl as VariableDeclaration).type;
if (!jsdocType) return;
const original = getTextOfNode(jsdocType);
const type = checker.getTypeFromTypeNode(jsdocType);
const actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.NoTruncation))];
if (jsdocType.kind === SyntaxKind.JSDocNullableType) {
// for nullable types, suggest the flow-compatible `T | null | undefined`
// in addition to the jsdoc/closure-compatible `T | null`
const replacementWithUndefined = checker.typeToString(checker.getNullableType(type, TypeFlags.Undefined), /*enclosingDeclaration*/ undefined, TypeFormatFlags.NoTruncation);
actions.push(createAction(jsdocType, sourceFile.fileName, original, replacementWithUndefined));
switch (node.kind) {
case SyntaxKind.AsExpression:
case SyntaxKind.CallSignature:
case SyntaxKind.ConstructSignature:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.IndexSignature:
case SyntaxKind.MappedType:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
case SyntaxKind.Parameter:
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.PropertySignature:
case SyntaxKind.SetAccessor:
case SyntaxKind.TypeAliasDeclaration:
case SyntaxKind.TypeAssertionExpression:
case SyntaxKind.VariableDeclaration:
return true;
default:
return false;
}
return actions;
}
function createAction(declaration: TypeNode, fileName: string, original: string, replacement: string): CodeAction {
return {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Change_0_to_1), [original, replacement]),
changes: [{
fileName,
textChanges: [{
span: { start: declaration.getStart(), length: declaration.getWidth() },
newText: replacement
}]
}],
};
}
}
+29 -20
View File
@@ -1,19 +1,34 @@
/* @internal */
namespace ts.codefix {
const fixId = "fixSpelling";
const errorCodes = [
Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,
Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,
];
registerCodeFix({
errorCodes: [Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,
Diagnostics.Cannot_find_name_0_Did_you_mean_1.code],
getCodeActions: getActionsForCorrectSpelling
errorCodes,
getCodeActions(context) {
const { sourceFile } = context;
const info = getInfo(sourceFile, context.span.start, context.program.getTypeChecker());
if (!info) return undefined;
const { node, suggestion } = info;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, node, suggestion));
const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Change_spelling_to_0), [suggestion]);
return [{ description, changes, fixId }];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
const info = getInfo(diag.file!, diag.start!, context.program.getTypeChecker());
if (info) doChange(changes, context.sourceFile, info.node, info.suggestion);
}),
});
function getActionsForCorrectSpelling(context: CodeFixContext): CodeAction[] | undefined {
const sourceFile = context.sourceFile;
function getInfo(sourceFile: SourceFile, pos: number, checker: TypeChecker): { node: Node, suggestion: string } | undefined {
// This is the identifier of the misspelled word. eg:
// this.speling = 1;
// ^^^^^^^
const node = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); // TODO: GH#15852
const checker = context.program.getTypeChecker();
const node = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); // TODO: GH#15852
let suggestion: string;
if (isPropertyAccessExpression(node.parent) && node.parent.name === node) {
Debug.assert(node.kind === SyntaxKind.Identifier);
@@ -26,18 +41,12 @@ namespace ts.codefix {
Debug.assert(name !== undefined, "name should be defined");
suggestion = checker.getSuggestionForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning));
}
if (suggestion) {
return [{
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Change_spelling_to_0), [suggestion]),
changes: [{
fileName: sourceFile.fileName,
textChanges: [{
span: { start: node.getStart(), length: node.getWidth() },
newText: suggestion
}],
}],
}];
}
return suggestion === undefined ? undefined : { node, suggestion };
}
function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, node: Node, suggestion: string) {
changes.replaceNode(sourceFile, node, createIdentifier(suggestion));
}
function convertSemanticMeaningToSymbolFlags(meaning: SemanticMeaning): SymbolFlags {
+217 -189
View File
@@ -1,207 +1,235 @@
/* @internal */
namespace ts.codefix {
const fixIdPrefix = "unusedIdentifier_prefix";
const fixIdDelete = "unusedIdentifier_delete";
const errorCodes = [
Diagnostics._0_is_declared_but_its_value_is_never_read.code,
Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,
];
registerCodeFix({
errorCodes: [
Diagnostics._0_is_declared_but_its_value_is_never_read.code,
Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code
],
getCodeActions: (context: CodeFixContext) => {
const sourceFile = context.sourceFile;
const start = context.span.start;
errorCodes,
getCodeActions(context) {
const { sourceFile } = context;
const token = getToken(sourceFile, context.span.start);
const result: CodeFixAction[] = [];
let token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
// this handles var ["computed"] = 12;
if (token.kind === SyntaxKind.OpenBracketToken) {
token = getTokenAtPosition(sourceFile, start + 1, /*includeJsDocComment*/ false);
const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token));
if (deletion.length) {
const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]);
result.push({ description, changes: deletion, fixId: fixIdDelete });
}
switch (token.kind) {
case ts.SyntaxKind.Identifier:
return deleteIdentifierOrPrefixWithUnderscore(<Identifier>token, context.errorCode);
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.NamespaceImport:
return [deleteNode(token.parent)];
default:
return deleteDefault();
const prefix = textChanges.ChangeTracker.with(context, t => tryPrefixDeclaration(t, context.errorCode, sourceFile, token));
if (prefix.length) {
const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Prefix_0_with_an_underscore), [token.getText()]);
result.push({ description, changes: prefix, fixId: fixIdPrefix });
}
function deleteDefault(): CodeAction[] | undefined {
if (isDeclarationName(token)) {
return [deleteNode(token.parent)];
}
else if (isLiteralComputedPropertyDeclarationName(token)) {
return [deleteNode(token.parent.parent)];
}
else {
return undefined;
}
}
function prefixIdentifierWithUnderscore(identifier: Identifier): CodeAction {
const startPosition = identifier.getStart(sourceFile, /*includeJsDocComment*/ false);
return {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Prefix_0_with_an_underscore), { 0: token.getText() }),
changes: [{
fileName: sourceFile.path,
textChanges: [{
span: { start: startPosition, length: 0 },
newText: "_"
}]
}]
};
}
function deleteIdentifierOrPrefixWithUnderscore(identifier: Identifier, errorCode: number): CodeAction[] | undefined {
const parent = identifier.parent;
switch (parent.kind) {
case ts.SyntaxKind.VariableDeclaration:
return deleteVariableDeclarationOrPrefixWithUnderscore(identifier, <ts.VariableDeclaration>parent);
case SyntaxKind.TypeParameter:
const typeParameters = (<DeclarationWithTypeParameters>parent.parent).typeParameters;
if (typeParameters.length === 1) {
const previousToken = getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false);
const nextToken = getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false);
Debug.assert(previousToken.kind === SyntaxKind.LessThanToken);
Debug.assert(nextToken.kind === SyntaxKind.GreaterThanToken);
return [deleteNodeRange(previousToken, nextToken)];
}
else {
return [deleteNodeInList(parent)];
}
case ts.SyntaxKind.Parameter:
const functionDeclaration = <FunctionDeclaration>parent.parent;
const deleteAction = functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent);
return errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code
? [deleteAction]
: [deleteAction, prefixIdentifierWithUnderscore(identifier)];
// handle case where 'import a = A;'
case SyntaxKind.ImportEqualsDeclaration:
const importEquals = getAncestor(identifier, SyntaxKind.ImportEqualsDeclaration);
return [deleteNode(importEquals)];
case SyntaxKind.ImportSpecifier:
const namedImports = <NamedImports>parent.parent;
if (namedImports.elements.length === 1) {
return deleteNamedImportBinding(namedImports);
}
else {
// delete import specifier
return [deleteNodeInList(parent)];
}
case SyntaxKind.ImportClause: // this covers both 'import |d|' and 'import |d,| *'
const importClause = <ImportClause>parent;
if (!importClause.namedBindings) { // |import d from './file'|
const importDecl = getAncestor(importClause, SyntaxKind.ImportDeclaration);
return [deleteNode(importDecl)];
}
else {
// import |d,| * as ns from './file'
const start = importClause.name.getStart(sourceFile);
const nextToken = getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false);
if (nextToken && nextToken.kind === SyntaxKind.CommaToken) {
// shift first non-whitespace position after comma to the start position of the node
return [deleteRange({ pos: start, end: skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) })];
}
else {
return [deleteNode(importClause.name)];
}
}
case SyntaxKind.NamespaceImport:
return deleteNamedImportBinding(<NamespaceImport>parent);
default:
return deleteDefault();
}
}
function deleteNamedImportBinding(namedBindings: NamedImportBindings): CodeAction[] | undefined {
if ((<ImportClause>namedBindings.parent).name) {
// Delete named imports while preserving the default import
// import d|, * as ns| from './file'
// import d|, { a }| from './file'
const previousToken = getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false);
if (previousToken && previousToken.kind === SyntaxKind.CommaToken) {
return [deleteRange({ pos: previousToken.getStart(), end: namedBindings.end })];
return result;
},
fixIds: [fixIdPrefix, fixIdDelete],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {
const { sourceFile } = context;
const token = getToken(diag.file!, diag.start!);
switch (context.fixId) {
case fixIdPrefix:
if (isIdentifier(token) && canPrefix(token)) {
tryPrefixDeclaration(changes, diag.code, sourceFile, token);
}
return undefined;
}
else {
// Delete the entire import declaration
// |import * as ns from './file'|
// |import { a } from './file'|
const importDecl = getAncestor(namedBindings, SyntaxKind.ImportDeclaration);
return [deleteNode(importDecl)];
}
break;
case fixIdDelete:
tryDeleteDeclaration(changes, sourceFile, token);
break;
default:
Debug.fail(JSON.stringify(context.fixId));
}
}),
});
// token.parent is a variableDeclaration
function deleteVariableDeclarationOrPrefixWithUnderscore(identifier: Identifier, varDecl: ts.VariableDeclaration): CodeAction[] | undefined {
function getToken(sourceFile: SourceFile, pos: number): Node {
const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false);
// this handles var ["computed"] = 12;
return token.kind === SyntaxKind.OpenBracketToken ? getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token;
}
function tryPrefixDeclaration(changes: textChanges.ChangeTracker, errorCode: number, sourceFile: SourceFile, token: Node): void {
// Don't offer to prefix a property.
if (errorCode !== Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code && isIdentifier(token) && canPrefix(token)) {
changes.replaceNode(sourceFile, token, createIdentifier(`_${token.text}`));
}
}
function canPrefix(token: Identifier): boolean {
switch (token.parent.kind) {
case SyntaxKind.Parameter:
return true;
case SyntaxKind.VariableDeclaration: {
const varDecl = token.parent as VariableDeclaration;
switch (varDecl.parent.parent.kind) {
case SyntaxKind.ForStatement:
const forStatement = <ForStatement>varDecl.parent.parent;
const forInitializer = <VariableDeclarationList>forStatement.initializer;
return [forInitializer.declarations.length === 1 ? deleteNode(forInitializer) : deleteNodeInList(varDecl)];
case SyntaxKind.ForOfStatement:
const forOfStatement = <ForOfStatement>varDecl.parent.parent;
Debug.assert(forOfStatement.initializer.kind === SyntaxKind.VariableDeclarationList);
const forOfInitializer = <VariableDeclarationList>forOfStatement.initializer;
return [
replaceNode(forOfInitializer.declarations[0], createObjectLiteral()),
prefixIdentifierWithUnderscore(identifier)
];
case SyntaxKind.ForInStatement:
// There is no valid fix in the case of:
// for .. in
return [prefixIdentifierWithUnderscore(identifier)];
default:
const variableStatement = <VariableStatement>varDecl.parent.parent;
if (variableStatement.declarationList.declarations.length === 1) {
return [deleteNode(variableStatement)];
}
else {
return [deleteNodeInList(varDecl)];
}
return true;
}
}
function deleteNode(n: Node) {
return makeChange(textChanges.ChangeTracker.fromContext(context).deleteNode(sourceFile, n));
}
function deleteRange(range: TextRange) {
return makeChange(textChanges.ChangeTracker.fromContext(context).deleteRange(sourceFile, range));
}
function deleteNodeInList(n: Node) {
return makeChange(textChanges.ChangeTracker.fromContext(context).deleteNodeInList(sourceFile, n));
}
function deleteNodeRange(start: Node, end: Node) {
return makeChange(textChanges.ChangeTracker.fromContext(context).deleteNodeRange(sourceFile, start, end));
}
function replaceNode(n: Node, newNode: Node) {
return makeChange(textChanges.ChangeTracker.fromContext(context).replaceNode(sourceFile, n, newNode));
}
function makeChange(changeTracker: textChanges.ChangeTracker): CodeAction {
return {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }),
changes: changeTracker.getChanges()
};
}
}
});
return false;
}
function tryDeleteDeclaration(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node): void {
switch (token.kind) {
case SyntaxKind.Identifier:
tryDeleteIdentifier(changes, sourceFile, <Identifier>token);
break;
case SyntaxKind.PropertyDeclaration:
case SyntaxKind.NamespaceImport:
changes.deleteNode(sourceFile, token.parent);
break;
default:
tryDeleteDefault(changes, sourceFile, token);
}
}
function tryDeleteDefault(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node): void {
if (isDeclarationName(token)) {
changes.deleteNode(sourceFile, token.parent);
}
else if (isLiteralComputedPropertyDeclarationName(token)) {
changes.deleteNode(sourceFile, token.parent.parent);
}
}
function tryDeleteIdentifier(changes: textChanges.ChangeTracker, sourceFile: SourceFile, identifier: Identifier): void {
const parent = identifier.parent;
switch (parent.kind) {
case SyntaxKind.VariableDeclaration:
tryDeleteVariableDeclaration(changes, sourceFile, <VariableDeclaration>parent);
break;
case SyntaxKind.TypeParameter:
const typeParameters = (<DeclarationWithTypeParameters>parent.parent).typeParameters;
if (typeParameters.length === 1) {
const previousToken = getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false);
const nextToken = getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false);
Debug.assert(previousToken.kind === SyntaxKind.LessThanToken);
Debug.assert(nextToken.kind === SyntaxKind.GreaterThanToken);
changes.deleteNodeRange(sourceFile, previousToken, nextToken);
}
else {
changes.deleteNodeInList(sourceFile, parent);
}
break;
case SyntaxKind.Parameter:
const functionDeclaration = <FunctionDeclaration>parent.parent;
if (functionDeclaration.parameters.length === 1) {
changes.deleteNode(sourceFile, parent);
}
else {
changes.deleteNodeInList(sourceFile, parent);
}
break;
// handle case where 'import a = A;'
case SyntaxKind.ImportEqualsDeclaration:
const importEquals = getAncestor(identifier, SyntaxKind.ImportEqualsDeclaration);
changes.deleteNode(sourceFile, importEquals);
break;
case SyntaxKind.ImportSpecifier:
const namedImports = <NamedImports>parent.parent;
if (namedImports.elements.length === 1) {
tryDeleteNamedImportBinding(changes, sourceFile, namedImports);
}
else {
// delete import specifier
changes.deleteNodeInList(sourceFile, parent);
}
break;
case SyntaxKind.ImportClause: // this covers both 'import |d|' and 'import |d,| *'
const importClause = <ImportClause>parent;
if (!importClause.namedBindings) { // |import d from './file'|
changes.deleteNode(sourceFile, getAncestor(importClause, SyntaxKind.ImportDeclaration)!);
}
else {
// import |d,| * as ns from './file'
const start = importClause.name.getStart(sourceFile);
const nextToken = getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false);
if (nextToken && nextToken.kind === SyntaxKind.CommaToken) {
// shift first non-whitespace position after comma to the start position of the node
const end = skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true);
changes.deleteRange(sourceFile, { pos: start, end });
}
else {
changes.deleteNode(sourceFile, importClause.name);
}
}
break;
case SyntaxKind.NamespaceImport:
tryDeleteNamedImportBinding(changes, sourceFile, <NamespaceImport>parent);
break;
default:
tryDeleteDefault(changes, sourceFile, identifier);
break;
}
}
function tryDeleteNamedImportBinding(changes: textChanges.ChangeTracker, sourceFile: SourceFile, namedBindings: NamedImportBindings): void {
if ((<ImportClause>namedBindings.parent).name) {
// Delete named imports while preserving the default import
// import d|, * as ns| from './file'
// import d|, { a }| from './file'
const previousToken = getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false);
if (previousToken && previousToken.kind === SyntaxKind.CommaToken) {
changes.deleteRange(sourceFile, { pos: previousToken.getStart(), end: namedBindings.end });
}
}
else {
// Delete the entire import declaration
// |import * as ns from './file'|
// |import { a } from './file'|
const importDecl = getAncestor(namedBindings, SyntaxKind.ImportDeclaration);
changes.deleteNode(sourceFile, importDecl);
}
}
// token.parent is a variableDeclaration
function tryDeleteVariableDeclaration(changes: textChanges.ChangeTracker, sourceFile: SourceFile, varDecl: VariableDeclaration): void {
switch (varDecl.parent.parent.kind) {
case SyntaxKind.ForStatement: {
const forStatement = varDecl.parent.parent;
const forInitializer = <VariableDeclarationList>forStatement.initializer;
if (forInitializer.declarations.length === 1) {
changes.deleteNode(sourceFile, forInitializer);
}
else {
changes.deleteNodeInList(sourceFile, varDecl);
}
break;
}
case SyntaxKind.ForOfStatement:
const forOfStatement = <ForOfStatement>varDecl.parent.parent;
Debug.assert(forOfStatement.initializer.kind === SyntaxKind.VariableDeclarationList);
const forOfInitializer = <VariableDeclarationList>forOfStatement.initializer;
changes.replaceNode(sourceFile, forOfInitializer.declarations[0], createObjectLiteral());
break;
case SyntaxKind.ForInStatement:
case SyntaxKind.TryStatement:
break;
default:
const variableStatement = <VariableStatement>varDecl.parent.parent;
if (variableStatement.declarationList.declarations.length === 1) {
changes.deleteNode(sourceFile, variableStatement);
}
else {
changes.deleteNodeInList(sourceFile, varDecl);
}
}
}
}
+48 -96
View File
@@ -1,61 +1,24 @@
/* @internal */
namespace ts.codefix {
export function newNodesToChanges(newNodes: Node[], insertAfter: Node, context: CodeFixContext) {
const sourceFile = context.sourceFile;
const changeTracker = textChanges.ChangeTracker.fromContext(context);
for (const newNode of newNodes) {
changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter });
}
const changes = changeTracker.getChanges();
if (!some(changes)) {
return changes;
}
Debug.assert(changes.length === 1);
const consolidatedChanges: FileTextChanges[] = [{
fileName: changes[0].fileName,
textChanges: [{
span: changes[0].textChanges[0].span,
newText: changes[0].textChanges.reduce((prev, cur) => prev + cur.newText, "")
}]
}];
return consolidatedChanges;
}
/**
* Finds members of the resolved type that are missing in the class pointed to by class decl
* and generates source code for the missing members.
* @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for.
* @returns Empty string iff there are no member insertions.
*/
export function createMissingMemberNodes(classDeclaration: ClassLikeDeclaration, possiblyMissingSymbols: Symbol[], checker: TypeChecker): Node[] {
export function createMissingMemberNodes(classDeclaration: ClassLikeDeclaration, possiblyMissingSymbols: ReadonlyArray<Symbol>, checker: TypeChecker, out: (node: ClassElement) => void): void {
const classMembers = classDeclaration.symbol.members;
const missingMembers = possiblyMissingSymbols.filter(symbol => !classMembers.has(symbol.escapedName));
let newNodes: Node[] = [];
for (const symbol of missingMembers) {
const newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker);
if (newNode) {
if (Array.isArray(newNode)) {
newNodes = newNodes.concat(newNode);
}
else {
newNodes.push(newNode);
}
for (const symbol of possiblyMissingSymbols) {
if (!classMembers.has(symbol.escapedName)) {
addNewNodeForMemberSymbol(symbol, classDeclaration, checker, out);
}
}
return newNodes;
}
/**
* @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`.
*/
function createNewNodeForMemberSymbol(symbol: Symbol, enclosingDeclaration: ClassLikeDeclaration, checker: TypeChecker): Node[] | Node | undefined {
function addNewNodeForMemberSymbol(symbol: Symbol, enclosingDeclaration: ClassLikeDeclaration, checker: TypeChecker, out: (node: Node) => void): void {
const declarations = symbol.getDeclarations();
if (!(declarations && declarations.length)) {
return undefined;
@@ -63,7 +26,7 @@ namespace ts.codefix {
const declaration = declarations[0] as Declaration;
// Clone name to remove leading trivia.
const name = getSynthesizedClone(getNameOfDeclaration(declaration)) as PropertyName;
const name = getSynthesizedDeepClone(getNameOfDeclaration(declaration)) as PropertyName;
const visibilityModifier = createVisibilityModifier(getModifierFlags(declaration));
const modifiers = visibilityModifier ? createNodeArray([visibilityModifier]) : undefined;
const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
@@ -75,14 +38,14 @@ namespace ts.codefix {
case SyntaxKind.PropertySignature:
case SyntaxKind.PropertyDeclaration:
const typeNode = checker.typeToTypeNode(type, enclosingDeclaration);
const property = createProperty(
out(createProperty(
/*decorators*/undefined,
modifiers,
name,
optional ? createToken(SyntaxKind.QuestionToken) : undefined,
typeNode,
/*initializer*/ undefined);
return property;
/*initializer*/ undefined));
break;
case SyntaxKind.MethodSignature:
case SyntaxKind.MethodDeclaration:
// The signature for the implementation appears as an entry in `signatures` iff
@@ -94,81 +57,71 @@ namespace ts.codefix {
// correspondence of declarations and signatures.
const signatures = checker.getSignaturesOfType(type, SignatureKind.Call);
if (!some(signatures)) {
return undefined;
break;
}
if (declarations.length === 1) {
Debug.assert(signatures.length === 1);
const signature = signatures[0];
return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody());
outputMethod(signature, modifiers, name, createStubbedMethodBody());
break;
}
const signatureDeclarations: MethodDeclaration[] = [];
for (const signature of signatures) {
const methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration);
if (methodDeclaration) {
signatureDeclarations.push(methodDeclaration);
}
// Need to ensure nodes are fresh each time so they can have different positions.
outputMethod(signature, getSynthesizedDeepClones(modifiers), getSynthesizedDeepClone(name));
}
if (declarations.length > signatures.length) {
const signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1] as SignatureDeclaration);
const methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody());
if (methodDeclaration) {
signatureDeclarations.push(methodDeclaration);
}
outputMethod(signature, modifiers, name, createStubbedMethodBody());
}
else {
Debug.assert(declarations.length === signatures.length);
const methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers);
signatureDeclarations.push(methodImplementingSignatures);
out(createMethodImplementingSignatures(signatures, name, optional, modifiers));
}
return signatureDeclarations;
default:
return undefined;
break;
}
function signatureToMethodDeclaration(signature: Signature, enclosingDeclaration: Node, body?: Block) {
const signatureDeclaration = <MethodDeclaration>checker.signatureToSignatureDeclaration(signature, SyntaxKind.MethodDeclaration, enclosingDeclaration, NodeBuilderFlags.SuppressAnyReturnType);
if (signatureDeclaration) {
signatureDeclaration.decorators = undefined;
signatureDeclaration.modifiers = modifiers;
signatureDeclaration.name = name;
signatureDeclaration.questionToken = optional ? createToken(SyntaxKind.QuestionToken) : undefined;
signatureDeclaration.body = body;
}
return signatureDeclaration;
function outputMethod(signature: Signature, modifiers: NodeArray<Modifier>, name: PropertyName, body?: Block): void {
const method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body);
if (method) out(method);
}
}
export function createMethodFromCallExpression(callExpression: CallExpression, methodName: string, includeTypeScriptSyntax: boolean, makeStatic: boolean): MethodDeclaration {
const parameters = createDummyParameters(callExpression.arguments.length, /*names*/ undefined, /*minArgumentCount*/ undefined, includeTypeScriptSyntax);
let typeParameters: TypeParameterDeclaration[];
if (includeTypeScriptSyntax) {
const typeArgCount = length(callExpression.typeArguments);
for (let i = 0; i < typeArgCount; i++) {
const name = typeArgCount < 8 ? String.fromCharCode(CharacterCodes.T + i) : `T${i}`;
const typeParameter = createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined);
(typeParameters ? typeParameters : typeParameters = []).push(typeParameter);
}
function signatureToMethodDeclaration(checker: TypeChecker, signature: Signature, enclosingDeclaration: ClassLikeDeclaration, modifiers: NodeArray<Modifier>, name: PropertyName, optional: boolean, body: Block | undefined) {
const signatureDeclaration = <MethodDeclaration>checker.signatureToSignatureDeclaration(signature, SyntaxKind.MethodDeclaration, enclosingDeclaration, NodeBuilderFlags.SuppressAnyReturnType);
if (!signatureDeclaration) {
return undefined;
}
const newMethod = createMethod(
signatureDeclaration.decorators = undefined;
signatureDeclaration.modifiers = modifiers;
signatureDeclaration.name = name;
signatureDeclaration.questionToken = optional ? createToken(SyntaxKind.QuestionToken) : undefined;
signatureDeclaration.body = body;
return signatureDeclaration;
}
function getSynthesizedDeepClones<T extends Node>(nodes: NodeArray<T> | undefined): NodeArray<T> | undefined {
return nodes && createNodeArray(nodes.map(getSynthesizedDeepClone));
}
export function createMethodFromCallExpression({ typeArguments, arguments: args }: CallExpression, methodName: string, inJs: boolean, makeStatic: boolean): MethodDeclaration {
return createMethod(
/*decorators*/ undefined,
/*modifiers*/ makeStatic ? [createToken(SyntaxKind.StaticKeyword)] : undefined,
/*asteriskToken*/ undefined,
methodName,
/*questionToken*/ undefined,
typeParameters,
parameters,
/*type*/ includeTypeScriptSyntax ? createKeywordTypeNode(SyntaxKind.AnyKeyword) : undefined,
createStubbedMethodBody()
);
return newMethod;
/*typeParameters*/ inJs ? undefined : map(typeArguments, (_, i) =>
createTypeParameterDeclaration(CharacterCodes.T + typeArguments.length - 1 <= CharacterCodes.Z ? String.fromCharCode(CharacterCodes.T + i) : `T${i}`)),
/*parameters*/ createDummyParameters(args.length, /*names*/ undefined, /*minArgumentCount*/ undefined, inJs),
/*type*/ inJs ? undefined : createKeywordTypeNode(SyntaxKind.AnyKeyword),
createStubbedMethodBody());
}
function createDummyParameters(argCount: number, names: string[] | undefined, minArgumentCount: number | undefined, addAnyType: boolean) {
function createDummyParameters(argCount: number, names: string[] | undefined, minArgumentCount: number | undefined, inJs: boolean): ParameterDeclaration[] {
const parameters: ParameterDeclaration[] = [];
for (let i = 0; i < argCount; i++) {
const newParameter = createParameter(
@@ -177,11 +130,10 @@ namespace ts.codefix {
/*dotDotDotToken*/ undefined,
/*name*/ names && names[i] || `arg${i}`,
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? createToken(SyntaxKind.QuestionToken) : undefined,
/*type*/ addAnyType ? createKeywordTypeNode(SyntaxKind.AnyKeyword) : undefined,
/*type*/ inJs ? undefined : createKeywordTypeNode(SyntaxKind.AnyKeyword),
/*initializer*/ undefined);
parameters.push(newParameter);
}
return parameters;
}
@@ -205,7 +157,7 @@ namespace ts.codefix {
const maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0);
const maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(symbol => symbol.name);
const parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*addAnyType*/ true);
const parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*inJs*/ false);
if (someSigHasRestParameter) {
const anyArrayType = createArrayTypeNode(createKeywordTypeNode(SyntaxKind.AnyKeyword));
@@ -229,7 +181,7 @@ namespace ts.codefix {
/*returnType*/ undefined);
}
export function createStubbedMethod(
function createStubbedMethod(
modifiers: ReadonlyArray<Modifier>,
name: PropertyName,
optional: boolean,
@@ -258,7 +210,7 @@ namespace ts.codefix {
/*multiline*/ true);
}
function createVisibilityModifier(flags: ModifierFlags) {
function createVisibilityModifier(flags: ModifierFlags): Modifier | undefined {
if (flags & ModifierFlags.Public) {
return createToken(SyntaxKind.PublicKeyword);
}
+99 -78
View File
@@ -9,14 +9,17 @@ namespace ts.codefix {
Diagnostics.Cannot_find_namespace_0.code,
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code
],
getCodeActions: getImportCodeActions
getCodeActions: getImportCodeActions,
// TODO: GH#20315
fixIds: [],
getAllCodeActions: notImplemented,
});
type ImportCodeActionKind = "CodeChange" | "InsertingIntoExistingImport" | "NewImport";
// Map from module Id to an array of import declarations in that module.
type ImportDeclarationMap = AnyImportSyntax[][];
interface ImportCodeAction extends CodeAction {
interface ImportCodeAction extends CodeFixAction {
kind: ImportCodeActionKind;
moduleSpecifier?: string;
}
@@ -27,11 +30,12 @@ namespace ts.codefix {
}
interface SymbolAndTokenContext extends SymbolContext {
symbolToken: Node | undefined;
symbolToken: Identifier | undefined;
}
interface ImportCodeFixContext extends SymbolAndTokenContext {
host: LanguageServiceHost;
program: Program;
checker: TypeChecker;
compilerOptions: CompilerOptions;
getCanonicalFileName: GetCanonicalFileName;
@@ -154,6 +158,8 @@ namespace ts.codefix {
return {
description: formatMessage.apply(undefined, [undefined, description].concat(<any[]>diagnosticArgs)),
changes,
// TODO: GH#20315
fixId: undefined,
kind,
moduleSpecifier
};
@@ -161,15 +167,18 @@ namespace ts.codefix {
function convertToImportCodeFixContext(context: CodeFixContext): ImportCodeFixContext {
const useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false;
const checker = context.program.getTypeChecker();
const symbolToken = getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false);
const { program } = context;
const checker = program.getTypeChecker();
// This will always be an Identifier, since the diagnostics we fix only fail on identifiers.
const symbolToken = cast(getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false), isIdentifier);
return {
host: context.host,
newLineCharacter: context.newLineCharacter,
formatContext: context.formatContext,
sourceFile: context.sourceFile,
program,
checker,
compilerOptions: context.program.getCompilerOptions(),
compilerOptions: program.getCompilerOptions(),
cachedImportDeclarations: [],
getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames),
symbolName: symbolToken.getText(),
@@ -205,14 +214,17 @@ namespace ts.codefix {
for (const declaration of declarations) {
const namespace = getNamespaceImportName(declaration);
if (namespace) {
actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken));
const moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace));
if (moduleSymbol && moduleSymbol.exports.has(escapeLeadingUnderscores(context.symbolName))) {
actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken));
}
}
}
}
return [...actions, ...getCodeActionsForAddImport(moduleSymbols, context, declarations)];
}
function getNamespaceImportName(declaration: AnyImportSyntax): Identifier {
function getNamespaceImportName(declaration: AnyImportSyntax): Identifier | undefined {
if (declaration.kind === SyntaxKind.ImportDeclaration) {
const namedBindings = declaration.importClause && isImportClause(declaration.importClause) && declaration.importClause.namedBindings;
return namedBindings && namedBindings.kind === SyntaxKind.NamespaceImport ? namedBindings.name : undefined;
@@ -249,7 +261,7 @@ namespace ts.codefix {
}
function getCodeActionForNewImport(context: SymbolContext & { kind: ImportKind }, moduleSpecifier: string): ImportCodeAction {
const { kind, sourceFile, newLineCharacter, symbolName } = context;
const { kind, sourceFile, symbolName } = context;
const lastImportDeclaration = findLast(sourceFile.statements, isAnyImportSyntax);
const moduleSpecifierWithoutQuotes = stripQuotes(moduleSpecifier);
@@ -268,10 +280,10 @@ namespace ts.codefix {
const changes = ChangeTracker.with(context, changeTracker => {
if (lastImportDeclaration) {
changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: newLineCharacter });
changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl);
}
else {
changeTracker.insertNodeAt(sourceFile, getSourceFileImportLocation(sourceFile), importDecl, { suffix: `${newLineCharacter}${newLineCharacter}` });
changeTracker.insertNodeAtTopOfFile(sourceFile, importDecl, /*blankLineBetween*/ true);
}
});
@@ -309,6 +321,7 @@ namespace ts.codefix {
}
export function getModuleSpecifiersForNewImport(
program: Program,
sourceFile: SourceFile,
moduleSymbols: ReadonlyArray<Symbol>,
options: CompilerOptions,
@@ -316,68 +329,79 @@ namespace ts.codefix {
host: LanguageServiceHost,
): string[] {
const { baseUrl, paths, rootDirs } = options;
const choicesForEachExportingModule = mapIterator(arrayIterator(moduleSymbols), moduleSymbol => {
const moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName;
const sourceDirectory = getDirectoryPath(sourceFile.fileName);
const global = tryGetModuleNameFromAmbientModule(moduleSymbol)
|| tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName)
|| tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory)
|| rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName);
if (global) {
return [global];
}
const relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options);
if (!baseUrl) {
return [relativePath];
}
const relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName);
if (!relativeToBaseUrl) {
return [relativePath];
}
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options);
if (paths) {
const fromPaths = tryGetModuleNameFromPaths(removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
if (fromPaths) {
return [fromPaths];
const choicesForEachExportingModule = flatMap(moduleSymbols, moduleSymbol =>
getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(moduleFileName => {
const sourceDirectory = getDirectoryPath(sourceFile.fileName);
const global = tryGetModuleNameFromAmbientModule(moduleSymbol)
|| tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName)
|| tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory)
|| rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName);
if (global) {
return [global];
}
}
/*
Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl.
const relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options);
if (!baseUrl) {
return [relativePath];
}
Suppose we have:
baseUrl = /base
sourceDirectory = /base/a/b
moduleFileName = /base/foo/bar
Then:
relativePath = ../../foo/bar
getRelativePathNParents(relativePath) = 2
pathFromSourceToBaseUrl = ../../
getRelativePathNParents(pathFromSourceToBaseUrl) = 2
2 < 2 = false
In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar".
const relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName);
if (!relativeToBaseUrl) {
return [relativePath];
}
Suppose we have:
baseUrl = /base
sourceDirectory = /base/foo/a
moduleFileName = /base/foo/bar
Then:
relativePath = ../a
getRelativePathNParents(relativePath) = 1
pathFromSourceToBaseUrl = ../../
getRelativePathNParents(pathFromSourceToBaseUrl) = 2
1 < 2 = true
In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a".
*/
const pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName);
const relativeFirst = getRelativePathNParents(pathFromSourceToBaseUrl) < getRelativePathNParents(relativePath);
return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath];
});
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options);
if (paths) {
const fromPaths = tryGetModuleNameFromPaths(removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
if (fromPaths) {
return [fromPaths];
}
}
/*
Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl.
Suppose we have:
baseUrl = /base
sourceDirectory = /base/a/b
moduleFileName = /base/foo/bar
Then:
relativePath = ../../foo/bar
getRelativePathNParents(relativePath) = 2
pathFromSourceToBaseUrl = ../../
getRelativePathNParents(pathFromSourceToBaseUrl) = 2
2 < 2 = false
In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar".
Suppose we have:
baseUrl = /base
sourceDirectory = /base/foo/a
moduleFileName = /base/foo/bar
Then:
relativePath = ../a
getRelativePathNParents(relativePath) = 1
pathFromSourceToBaseUrl = ../../
getRelativePathNParents(pathFromSourceToBaseUrl) = 2
1 < 2 = true
In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a".
*/
const pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName);
const relativeFirst = getRelativePathNParents(pathFromSourceToBaseUrl) < getRelativePathNParents(relativePath);
return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath];
}));
// Only return results for the re-export with the shortest possible path (and also give the other path even if that's long.)
return best(choicesForEachExportingModule, (a, b) => a[0].length < b[0].length);
return best(arrayIterator(choicesForEachExportingModule), (a, b) => a[0].length < b[0].length);
}
/**
* Looks for a existing imports that use symlinks to this module.
* Only if no symlink is available, the real path will be used.
*/
function getAllModulePaths(program: Program, { fileName }: SourceFile): ReadonlyArray<string> {
const symlinks = mapDefined(program.getSourceFiles(), sf =>
sf.resolvedModules && firstDefinedIterator(sf.resolvedModules.values(), res =>
res && res.resolvedFileName === fileName ? res.originalPath : undefined));
return symlinks.length === 0 ? [fileName] : symlinks;
}
function getRelativePathNParents(relativePath: string): number {
@@ -613,7 +637,7 @@ namespace ts.codefix {
}
const existingDeclaration = firstDefined(declarations, moduleSpecifierFromAnyImport);
const moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host);
const moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.program, ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host);
return moduleSpecifiers.map(spec => getCodeActionForNewImport(ctx, spec));
}
@@ -663,7 +687,7 @@ namespace ts.codefix {
}
}
function getCodeActionForUseExistingNamespaceImport(namespacePrefix: string, context: SymbolContext, symbolToken: Node): ImportCodeAction {
function getCodeActionForUseExistingNamespaceImport(namespacePrefix: string, context: SymbolContext, symbolToken: Identifier): ImportCodeAction {
const { symbolName, sourceFile } = context;
/**
@@ -676,13 +700,10 @@ namespace ts.codefix {
* namespace instead of altering the import declaration. For example, "foo" would
* become "ns.foo"
*/
return createCodeAction(
Diagnostics.Change_0_to_1,
[symbolName, `${namespacePrefix}.${symbolName}`],
ChangeTracker.with(context, tracker =>
tracker.replaceNode(sourceFile, symbolToken, createPropertyAccess(createIdentifier(namespacePrefix), symbolName))),
"CodeChange",
/*moduleSpecifier*/ undefined);
// Prefix the node instead of it replacing it, because this may be used for import completions and we don't want the text changes to overlap with the identifier being completed.
const changes = ChangeTracker.with(context, tracker =>
tracker.changeIdentifierToPropertyAccess(sourceFile, namespacePrefix, symbolToken));
return createCodeAction(Diagnostics.Change_0_to_1, [symbolName, `${namespacePrefix}.${symbolName}`], changes, "CodeChange", /*moduleSpecifier*/ undefined);
}
function getImportCodeActions(context: CodeFixContext): ImportCodeAction[] {
@@ -746,7 +767,7 @@ namespace ts.codefix {
forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, moduleSymbol => {
cancellationToken.throwIfCancellationRequested();
// check the default export
const defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol);
const defaultExport = checker.tryGetMemberInModuleExports(InternalSymbolName.Default, moduleSymbol);
if (defaultExport) {
const localSymbol = getLocalSymbolForExportDefault(defaultExport);
if ((localSymbol && localSymbol.escapedName === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName)
+248 -246
View File
@@ -1,270 +1,268 @@
/* @internal */
namespace ts.codefix {
const fixId = "inferFromUsage";
const errorCodes = [
// Variable declarations
Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,
// Variable uses
Diagnostics.Variable_0_implicitly_has_an_1_type.code,
// Parameter declarations
Diagnostics.Parameter_0_implicitly_has_an_1_type.code,
Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code,
// Get Accessor declarations
Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,
Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,
// Set Accessor declarations
Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,
// Property declarations
Diagnostics.Member_0_implicitly_has_an_1_type.code,
];
registerCodeFix({
errorCodes: [
// Variable declarations
Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,
errorCodes,
getCodeActions({ sourceFile, program, span: { start }, errorCode, cancellationToken }) {
if (isSourceFileJavaScript(sourceFile)) {
return undefined; // TODO: GH#20113
}
// Variable uses
Diagnostics.Variable_0_implicitly_has_an_1_type.code,
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
const fix = getFix(sourceFile, token, errorCode, program, cancellationToken);
if (!fix) return undefined;
// Parameter declarations
Diagnostics.Parameter_0_implicitly_has_an_1_type.code,
Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code,
// Get Accessor declarations
Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,
Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,
// Set Accessor declarations
Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,
// Property declarations
Diagnostics.Member_0_implicitly_has_an_1_type.code,
],
getCodeActions: getActionsForAddExplicitTypeAnnotation
const { declaration, textChanges } = fix;
const name = getNameOfDeclaration(declaration);
const description = formatStringFromArgs(getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]);
return [{ description, changes: [{ fileName: sourceFile.fileName, textChanges }], fixId }];
},
fixIds: [fixId],
getAllCodeActions(context) {
const { sourceFile, program, cancellationToken } = context;
const seenFunctions = createMap<true>();
return codeFixAllWithTextChanges(context, errorCodes, (changes, err) => {
const fix = getFix(sourceFile, getTokenAtPosition(err.file!, err.start!, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions);
if (fix) changes.push(...fix.textChanges);
});
},
});
function getActionsForAddExplicitTypeAnnotation({ sourceFile, program, span: { start }, errorCode, cancellationToken }: CodeFixContext): CodeAction[] | undefined {
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
let writer: StringSymbolWriter;
function getDiagnostic(errorCode: number, token: Node): DiagnosticMessage {
switch (errorCode) {
case Diagnostics.Parameter_0_implicitly_has_an_1_type.code:
return isSetAccessor(getContainingFunction(token)) ? Diagnostics.Infer_type_of_0_from_usage : Diagnostics.Infer_parameter_types_from_usage;
case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:
return Diagnostics.Infer_parameter_types_from_usage;
default:
return Diagnostics.Infer_type_of_0_from_usage;
}
}
if (isInJavaScriptFile(token)) {
interface Fix {
readonly declaration: Declaration;
readonly textChanges: TextChange[];
}
function getFix(sourceFile: SourceFile, token: Node, errorCode: number, program: Program, cancellationToken: CancellationToken, seenFunctions?: Map<true>): Fix | undefined {
if (!isAllowedTokenKind(token.kind)) {
return undefined;
}
switch (token.kind) {
switch (errorCode) {
// Variable and Property declarations
case Diagnostics.Member_0_implicitly_has_an_1_type.code:
case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:
return getCodeActionForVariableDeclaration(<PropertyDeclaration | PropertySignature | VariableDeclaration>token.parent, sourceFile, program, cancellationToken);
case Diagnostics.Variable_0_implicitly_has_an_1_type.code: {
const symbol = program.getTypeChecker().getSymbolAtLocation(token);
return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(<VariableDeclaration>symbol.valueDeclaration, sourceFile, program, cancellationToken);
}
}
const containingFunction = getContainingFunction(token);
if (containingFunction === undefined) {
return undefined;
}
switch (errorCode) {
// Parameter declarations
case Diagnostics.Parameter_0_implicitly_has_an_1_type.code:
if (isSetAccessor(containingFunction)) {
return getCodeActionForSetAccessor(containingFunction, sourceFile, program, cancellationToken);
}
// falls through
case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:
return !seenFunctions || addToSeen(seenFunctions, getNodeId(containingFunction))
? getCodeActionForParameters(<ParameterDeclaration>token.parent, containingFunction, sourceFile, program, cancellationToken)
: undefined;
// Get Accessor declarations
case Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:
case Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:
return isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined;
// Set Accessor declarations
case Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:
return isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined;
default:
throw Debug.fail(String(errorCode));
}
}
function isAllowedTokenKind(kind: SyntaxKind): boolean {
switch (kind) {
case SyntaxKind.Identifier:
case SyntaxKind.DotDotDotToken:
case SyntaxKind.PublicKeyword:
case SyntaxKind.PrivateKeyword:
case SyntaxKind.ProtectedKeyword:
case SyntaxKind.ReadonlyKeyword:
// Allowed
break;
return true;
default:
return undefined;
return false;
}
}
const containingFunction = getContainingFunction(token);
const checker = program.getTypeChecker();
function getCodeActionForVariableDeclaration(declaration: VariableDeclaration | PropertyDeclaration | PropertySignature, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): Fix | undefined {
if (!isIdentifier(declaration.name)) return undefined;
const type = inferTypeForVariableFromUsage(declaration.name, sourceFile, program, cancellationToken);
return makeFix(declaration, declaration.name.getEnd(), type, program);
}
switch (errorCode) {
// Variable and Property declarations
case Diagnostics.Member_0_implicitly_has_an_1_type.code:
case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:
return getCodeActionForVariableDeclaration(<PropertyDeclaration | PropertySignature | VariableDeclaration>token.parent);
case Diagnostics.Variable_0_implicitly_has_an_1_type.code:
return getCodeActionForVariableUsage(<Identifier>token);
// Parameter declarations
case Diagnostics.Parameter_0_implicitly_has_an_1_type.code:
if (isSetAccessor(containingFunction)) {
return getCodeActionForSetAccessor(containingFunction);
}
// falls through
case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:
return getCodeActionForParameters(<ParameterDeclaration>token.parent);
// Get Accessor declarations
case Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:
case Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:
return isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction) : undefined;
// Set Accessor declarations
case Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:
return isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction) : undefined;
function isApplicableFunctionForInference(declaration: FunctionLike): declaration is MethodDeclaration | FunctionDeclaration | ConstructorDeclaration {
switch (declaration.kind) {
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.Constructor:
return true;
case SyntaxKind.FunctionExpression:
return !!(declaration as FunctionExpression).name;
}
return false;
}
return undefined;
function getCodeActionForVariableDeclaration(declaration: VariableDeclaration | PropertyDeclaration | PropertySignature) {
if (!isIdentifier(declaration.name)) {
return undefined;
}
const type = inferTypeForVariableFromUsage(declaration.name);
const typeString = type && typeToString(type, declaration);
if (!typeString) {
return undefined;
}
return createCodeActions(declaration.name.getText(), declaration.name.getEnd(), `: ${typeString}`);
}
function getCodeActionForVariableUsage(token: Identifier) {
const symbol = checker.getSymbolAtLocation(token);
return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(<VariableDeclaration>symbol.valueDeclaration);
}
function isApplicableFunctionForInference(declaration: FunctionLike): declaration is MethodDeclaration | FunctionDeclaration | ConstructorDeclaration {
switch (declaration.kind) {
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.Constructor:
return true;
case SyntaxKind.FunctionExpression:
return !!(declaration as FunctionExpression).name;
}
return false;
}
function getCodeActionForParameters(parameterDeclaration: ParameterDeclaration): CodeAction[] {
if (!isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) {
return undefined;
}
const types = inferTypeForParametersFromUsage(containingFunction) ||
map(containingFunction.parameters, p => isIdentifier(p.name) && inferTypeForVariableFromUsage(p.name));
if (!types) {
return undefined;
}
const textChanges: TextChange[] = zipWith(containingFunction.parameters, types, (parameter, type) => {
if (type && !parameter.type && !parameter.initializer) {
const typeString = typeToString(type, containingFunction);
return typeString ? {
span: { start: parameter.end, length: 0 },
newText: `: ${typeString}`
} : undefined;
}
}).filter(c => !!c);
return textChanges.length ? [{
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Infer_parameter_types_from_usage), [parameterDeclaration.name.getText()]),
changes: [{
fileName: sourceFile.fileName,
textChanges
}]
}] : undefined;
}
function getCodeActionForSetAccessor(setAccessorDeclaration: SetAccessorDeclaration) {
const setAccessorParameter = setAccessorDeclaration.parameters[0];
if (!setAccessorParameter || !isIdentifier(setAccessorDeclaration.name) || !isIdentifier(setAccessorParameter.name)) {
return undefined;
}
const type = inferTypeForVariableFromUsage(setAccessorDeclaration.name) ||
inferTypeForVariableFromUsage(setAccessorParameter.name);
const typeString = type && typeToString(type, containingFunction);
if (!typeString) {
return undefined;
}
return createCodeActions(setAccessorDeclaration.name.getText(), setAccessorParameter.name.getEnd(), `: ${typeString}`);
}
function getCodeActionForGetAccessor(getAccessorDeclaration: GetAccessorDeclaration) {
if (!isIdentifier(getAccessorDeclaration.name)) {
return undefined;
}
const type = inferTypeForVariableFromUsage(getAccessorDeclaration.name);
const typeString = type && typeToString(type, containingFunction);
if (!typeString) {
return undefined;
}
const closeParenToken = getFirstChildOfKind(getAccessorDeclaration, sourceFile, SyntaxKind.CloseParenToken);
return createCodeActions(getAccessorDeclaration.name.getText(), closeParenToken.getEnd(), `: ${typeString}`);
}
function createCodeActions(name: string, start: number, typeString: string) {
return [{
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Infer_type_of_0_from_usage), [name]),
changes: [{
fileName: sourceFile.fileName,
textChanges: [{
span: { start, length: 0 },
newText: typeString
}]
}]
}];
}
function getReferences(token: PropertyName | Token<SyntaxKind.ConstructorKeyword>) {
const references = FindAllReferences.findReferencedSymbols(
program,
cancellationToken,
program.getSourceFiles(),
token.getSourceFile(),
token.getStart());
Debug.assert(!!references, "Found no references!");
Debug.assert(references.length === 1, "Found more references than expected");
return map(references[0].references, r => <Identifier>getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false));
}
function inferTypeForVariableFromUsage(token: Identifier) {
return InferFromReference.inferTypeFromReferences(getReferences(token), checker, cancellationToken);
}
function inferTypeForParametersFromUsage(containingFunction: FunctionLikeDeclaration) {
switch (containingFunction.kind) {
case SyntaxKind.Constructor:
case SyntaxKind.FunctionExpression:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.MethodDeclaration:
const isConstructor = containingFunction.kind === SyntaxKind.Constructor;
const searchToken = isConstructor ?
<Token<SyntaxKind.ConstructorKeyword>>getFirstChildOfKind(containingFunction, sourceFile, SyntaxKind.ConstructorKeyword) :
containingFunction.name;
if (searchToken) {
return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken), containingFunction, checker, cancellationToken);
}
}
}
function getTypeAccessiblityWriter() {
if (!writer) {
let str = "";
let typeIsAccessible = true;
const writeText: (text: string) => void = text => str += text;
writer = {
string: () => typeIsAccessible ? str : undefined,
writeKeyword: writeText,
writeOperator: writeText,
writePunctuation: writeText,
writeSpace: writeText,
writeStringLiteral: writeText,
writeParameter: writeText,
writeProperty: writeText,
writeSymbol: writeText,
writeLine: () => str += " ",
increaseIndent: noop,
decreaseIndent: noop,
clear: () => { str = ""; typeIsAccessible = true; },
trackSymbol: (symbol, declaration, meaning) => {
if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== SymbolAccessibility.Accessible) {
typeIsAccessible = false;
}
},
reportInaccessibleThisError: () => { typeIsAccessible = false; },
reportPrivateInBaseOfClassExpression: () => { typeIsAccessible = false; },
reportInaccessibleUniqueSymbolError: () => { typeIsAccessible = false; }
};
}
writer.clear();
return writer;
}
function typeToString(type: Type, enclosingDeclaration: Declaration) {
const writer = getTypeAccessiblityWriter();
checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration);
return writer.string();
}
function getFirstChildOfKind(node: Node, sourcefile: SourceFile, kind: SyntaxKind) {
for (const child of node.getChildren(sourcefile)) {
if (child.kind === kind) return child;
}
function getCodeActionForParameters(parameterDeclaration: ParameterDeclaration, containingFunction: FunctionLike, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): Fix | undefined {
if (!isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) {
return undefined;
}
const types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) ||
containingFunction.parameters.map(p => isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, sourceFile, program, cancellationToken) : undefined);
if (!types) return undefined;
// We didn't actually find a set of type inference positions matching each parameter position
if (containingFunction.parameters.length !== types.length) {
return undefined;
}
const textChanges = arrayFrom(mapDefinedIterator(zipToIterator(containingFunction.parameters, types), ([parameter, type]) =>
type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined));
return textChanges.length ? { declaration: parameterDeclaration, textChanges } : undefined;
}
function getCodeActionForSetAccessor(setAccessorDeclaration: SetAccessorDeclaration, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): Fix | undefined {
const setAccessorParameter = setAccessorDeclaration.parameters[0];
if (!setAccessorParameter || !isIdentifier(setAccessorDeclaration.name) || !isIdentifier(setAccessorParameter.name)) {
return undefined;
}
const type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, sourceFile, program, cancellationToken) ||
inferTypeForVariableFromUsage(setAccessorParameter.name, sourceFile, program, cancellationToken);
return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program);
}
function getCodeActionForGetAccessor(getAccessorDeclaration: GetAccessorDeclaration, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): Fix | undefined {
if (!isIdentifier(getAccessorDeclaration.name)) {
return undefined;
}
const type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, sourceFile, program, cancellationToken);
const closeParenToken = findChildOfKind(getAccessorDeclaration, SyntaxKind.CloseParenToken, sourceFile);
return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program);
}
function makeFix(declaration: Declaration, start: number, type: Type | undefined, program: Program): Fix | undefined {
return type && { declaration, textChanges: [makeChange(declaration, start, type, program)] };
}
function makeChange(declaration: Declaration, start: number, type: Type | undefined, program: Program): TextChange | undefined {
const typeString = type && typeToString(type, declaration, program.getTypeChecker());
return typeString === undefined ? undefined : { span: createTextSpan(start, 0), newText: `: ${typeString}` };
}
function getReferences(token: PropertyName | Token<SyntaxKind.ConstructorKeyword>, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): Identifier[] {
const references = FindAllReferences.findReferencedSymbols(
program,
cancellationToken,
program.getSourceFiles(),
sourceFile,
token.getStart(sourceFile));
if (!references || references.length !== 1) {
return [];
}
return references[0].references.map(r => <Identifier>getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false));
}
function inferTypeForVariableFromUsage(token: Identifier, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): Type | undefined {
return InferFromReference.inferTypeFromReferences(getReferences(token, sourceFile, program, cancellationToken), program.getTypeChecker(), cancellationToken);
}
function inferTypeForParametersFromUsage(containingFunction: FunctionLikeDeclaration, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): (Type | undefined)[] | undefined {
switch (containingFunction.kind) {
case SyntaxKind.Constructor:
case SyntaxKind.FunctionExpression:
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.MethodDeclaration:
const isConstructor = containingFunction.kind === SyntaxKind.Constructor;
const searchToken = isConstructor ?
findChildOfKind<Token<SyntaxKind.ConstructorKeyword>>(containingFunction, SyntaxKind.ConstructorKeyword, sourceFile) :
containingFunction.name;
if (searchToken) {
return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, sourceFile, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken);
}
}
}
function getTypeAccessiblityWriter(checker: TypeChecker): StringSymbolWriter {
let str = "";
let typeIsAccessible = true;
const writeText: (text: string) => void = text => str += text;
return {
string: () => typeIsAccessible ? str : undefined,
writeKeyword: writeText,
writeOperator: writeText,
writePunctuation: writeText,
writeSpace: writeText,
writeStringLiteral: writeText,
writeParameter: writeText,
writeProperty: writeText,
writeSymbol: writeText,
writeLine: () => writeText(" "),
increaseIndent: noop,
decreaseIndent: noop,
clear: () => { str = ""; typeIsAccessible = true; },
trackSymbol: (symbol, declaration, meaning) => {
if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== SymbolAccessibility.Accessible) {
typeIsAccessible = false;
}
},
reportInaccessibleThisError: () => { typeIsAccessible = false; },
reportPrivateInBaseOfClassExpression: () => { typeIsAccessible = false; },
reportInaccessibleUniqueSymbolError: () => { typeIsAccessible = false; }
};
}
function typeToString(type: Type, enclosingDeclaration: Declaration, checker: TypeChecker): string {
const writer = getTypeAccessiblityWriter(checker);
checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration);
return writer.string();
}
namespace InferFromReference {
@@ -295,6 +293,10 @@ namespace ts.codefix {
}
export function inferTypeForParametersFromReferences(references: Identifier[], declaration: FunctionLikeDeclaration, checker: TypeChecker, cancellationToken: CancellationToken): (Type | undefined)[] | undefined {
if (references.length === 0) {
return undefined;
}
if (declaration.parameters) {
const usageContext: UsageContext = {};
for (const reference of references) {
@@ -319,7 +321,7 @@ namespace ts.codefix {
}
}
if (types.length) {
const type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true));
const type = checker.getWidenedType(checker.getUnionType(types, UnionReduction.Subtype));
paramTypes[parameterIndex] = isRestParameter ? checker.createArrayType(type) : type;
}
}
@@ -556,12 +558,12 @@ namespace ts.codefix {
return checker.getStringType();
}
else if (usageContext.candidateTypes) {
return checker.getWidenedType(checker.getUnionType(map(usageContext.candidateTypes, t => checker.getBaseTypeOfLiteralType(t)), /*subtypeReduction*/ true));
return checker.getWidenedType(checker.getUnionType(map(usageContext.candidateTypes, t => checker.getBaseTypeOfLiteralType(t)), UnionReduction.Subtype));
}
else if (usageContext.properties && hasCallContext(usageContext.properties.get("then" as __String))) {
const paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then" as __String).callContexts, /*isRestParameter*/ false, checker);
const types = paramType.getCallSignatures().map(c => c.getReturnType());
return checker.createPromiseType(types.length ? checker.getUnionType(types, /*subtypeReduction*/ true) : checker.getAnyType());
return checker.createPromiseType(types.length ? checker.getUnionType(types, UnionReduction.Subtype) : checker.getAnyType());
}
else if (usageContext.properties && hasCallContext(usageContext.properties.get("push" as __String))) {
return checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push" as __String).callContexts, /*isRestParameter*/ false, checker));
@@ -624,7 +626,7 @@ namespace ts.codefix {
}
if (types.length) {
const type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true));
const type = checker.getWidenedType(checker.getUnionType(types, UnionReduction.Subtype));
return isRestParameter ? checker.createArrayType(type) : type;
}
return undefined;
+70 -22
View File
@@ -39,6 +39,12 @@ namespace ts.Completions {
return getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log);
}
const contextToken = findPrecedingToken(position, sourceFile);
if (contextToken && isBreakOrContinueStatement(contextToken.parent)
&& (contextToken.kind === SyntaxKind.BreakKeyword || contextToken.kind === SyntaxKind.ContinueKeyword || contextToken.kind === SyntaxKind.Identifier)) {
return getLabelCompletionAtPosition(contextToken.parent);
}
const completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, options, compilerOptions.target);
if (!completionData) {
return undefined;
@@ -223,9 +229,16 @@ namespace ts.Completions {
return uniques;
}
function getLabelCompletionAtPosition(node: BreakOrContinueStatement): CompletionInfo | undefined {
const entries = getLabelStatementCompletions(node);
if (entries.length) {
return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries };
}
}
function getStringLiteralCompletionEntries(sourceFile: SourceFile, position: number, typeChecker: TypeChecker, compilerOptions: CompilerOptions, host: LanguageServiceHost, log: Log): CompletionInfo | undefined {
const node = findPrecedingToken(position, sourceFile);
if (!node || node.kind !== SyntaxKind.StringLiteral) {
if (!node || (node.kind !== SyntaxKind.StringLiteral && node.kind !== SyntaxKind.NoSubstitutionTemplateLiteral)) {
return undefined;
}
@@ -290,7 +303,7 @@ namespace ts.Completions {
// Get completion for string literal from string literal type
// i.e. var x: "hi" | "hello" = "/*completion position*/"
return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(<StringLiteral>node), typeChecker);
return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(<LiteralExpression>node), typeChecker);
}
}
@@ -358,6 +371,32 @@ namespace ts.Completions {
return undefined;
}
function getLabelStatementCompletions(node: Node): CompletionEntry[] {
const entries: CompletionEntry[] = [];
const uniques = createMap<true>();
let current = node;
while (current) {
if (isFunctionLike(current)) {
break;
}
if (isLabeledStatement(current)) {
const name = current.label.text;
if (!uniques.has(name)) {
uniques.set(name, true);
entries.push({
name,
kindModifiers: ScriptElementKindModifier.none,
kind: ScriptElementKind.label,
sortText: "0"
});
}
}
current = current.parent;
}
return entries;
}
function addStringLiteralCompletionsFromType(type: Type, result: Push<CompletionEntry>, typeChecker: TypeChecker, uniques = createMap<true>()): void {
if (type && type.flags & TypeFlags.TypeParameter) {
type = typeChecker.getBaseConstraintOfType(type);
@@ -392,13 +431,13 @@ namespace ts.Completions {
position: number,
{ name, source }: CompletionEntryIdentifier,
allSourceFiles: ReadonlyArray<SourceFile>,
): { type: "symbol", symbol: Symbol, location: Node, symbolToOriginInfoMap: SymbolOriginInfoMap } | { type: "request", request: Request } | { type: "none" } {
): { type: "symbol", symbol: Symbol, location: Node, symbolToOriginInfoMap: SymbolOriginInfoMap, previousToken: Node } | { type: "request", request: Request } | { type: "none" } {
const completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true }, compilerOptions.target);
if (!completionData) {
return { type: "none" };
}
const { symbols, location, allowStringLiteral, symbolToOriginInfoMap, request } = completionData;
const { symbols, location, allowStringLiteral, symbolToOriginInfoMap, request, previousToken } = completionData;
if (request) {
return { type: "request", request };
}
@@ -412,11 +451,13 @@ namespace ts.Completions {
return getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral, origin) === name
&& getSourceFromOrigin(origin) === source;
});
return symbol ? { type: "symbol", symbol, location, symbolToOriginInfoMap } : { type: "none" };
return symbol ? { type: "symbol", symbol, location, symbolToOriginInfoMap, previousToken } : { type: "none" };
}
function getSymbolName(symbol: Symbol, origin: SymbolOriginInfo | undefined, target: ScriptTarget): string {
return origin && origin.isDefaultExport && symbol.name === "default" ? codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) : symbol.name;
return origin && origin.isDefaultExport && symbol.escapedName === InternalSymbolName.Default
? codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target)
: symbol.name;
}
export interface CompletionEntryIdentifier {
@@ -425,7 +466,7 @@ namespace ts.Completions {
}
export function getCompletionEntryDetails(
typeChecker: TypeChecker,
program: Program,
log: (message: string) => void,
compilerOptions: CompilerOptions,
sourceFile: SourceFile,
@@ -436,6 +477,7 @@ namespace ts.Completions {
formatContext: formatting.FormatContext,
getCanonicalFileName: GetCanonicalFileName,
): CompletionEntryDetails {
const typeChecker = program.getTypeChecker();
const { name } = entryId;
// Compute all the completion symbols again.
const symbolCompletion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles);
@@ -454,8 +496,8 @@ namespace ts.Completions {
}
}
case "symbol": {
const { symbol, location, symbolToOriginInfoMap } = symbolCompletion;
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, typeChecker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles);
const { symbol, location, symbolToOriginInfoMap, previousToken } = symbolCompletion;
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, typeChecker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles);
const kindModifiers = SymbolDisplay.getSymbolModifiers(symbol);
const { displayParts, documentation, symbolKind, tags } = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, SemanticMeaning.All);
return { name, kindModifiers, kind: symbolKind, displayParts, documentation, tags, codeActions, source: sourceDisplay };
@@ -482,10 +524,12 @@ namespace ts.Completions {
function getCompletionEntryCodeActionsAndSourceDisplay(
symbolToOriginInfoMap: SymbolOriginInfoMap,
symbol: Symbol,
program: Program,
checker: TypeChecker,
host: LanguageServiceHost,
compilerOptions: CompilerOptions,
sourceFile: SourceFile,
previousToken: Node,
formatContext: formatting.FormatContext,
getCanonicalFileName: GetCanonicalFileName,
allSourceFiles: ReadonlyArray<SourceFile>,
@@ -500,9 +544,10 @@ namespace ts.Completions {
const moduleSymbols = getAllReExportingModules(exportedSymbol, checker, allSourceFiles);
Debug.assert(contains(moduleSymbols, moduleSymbol));
const sourceDisplay = [textPart(first(codefix.getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))];
const sourceDisplay = [textPart(first(codefix.getModuleSpecifiersForNewImport(program, sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))];
const codeActions = codefix.getCodeActionForImport(moduleSymbols, {
host,
program,
checker,
newLineCharacter: host.getNewLine(),
compilerOptions,
@@ -510,9 +555,9 @@ namespace ts.Completions {
formatContext,
symbolName: getSymbolName(symbol, symbolOriginInfo, compilerOptions.target),
getCanonicalFileName,
symbolToken: undefined,
symbolToken: tryCast(previousToken, isIdentifier),
kind: isDefaultExport ? codefix.ImportKind.Default : codefix.ImportKind.Named,
});
}).slice(0, 1); // Only take the first code action
return { sourceDisplay, codeActions };
}
@@ -553,6 +598,7 @@ namespace ts.Completions {
keywordFilters: KeywordCompletionFilters;
symbolToOriginInfoMap: SymbolOriginInfoMap;
recommendedCompletion: Symbol | undefined;
previousToken: Node;
}
type Request = { kind: "JsDocTagName" } | { kind: "JsDocTag" } | { kind: "JsDocParameterName", tag: JSDocParameterTag };
@@ -665,6 +711,7 @@ namespace ts.Completions {
keywordFilters: KeywordCompletionFilters.None,
symbolToOriginInfoMap: undefined,
recommendedCompletion: undefined,
previousToken: undefined,
};
}
@@ -805,7 +852,7 @@ namespace ts.Completions {
log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
const recommendedCompletion = getRecommendedCompletion(previousToken, typeChecker);
return { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request, keywordFilters, symbolToOriginInfoMap, recommendedCompletion };
return { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request, keywordFilters, symbolToOriginInfoMap, recommendedCompletion, previousToken };
type JSDocTagWithTypeExpression = JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag;
@@ -874,9 +921,8 @@ namespace ts.Completions {
symbols.push(...getPropertiesForCompletion(type, typeChecker, /*isForAccess*/ true));
}
else {
// Filter private properties
for (const symbol of type.getApparentProperties()) {
if (typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
if (typeChecker.isValidPropertyAccessForCompletions(<PropertyAccessExpression>(node.parent), type, symbol)) {
symbols.push(symbol);
}
}
@@ -1076,7 +1122,7 @@ namespace ts.Completions {
continue;
}
const isDefaultExport = name === "default";
const isDefaultExport = name === InternalSymbolName.Default;
if (isDefaultExport) {
const localSymbol = getLocalSymbolForExportDefault(symbol);
if (localSymbol) {
@@ -1281,7 +1327,7 @@ namespace ts.Completions {
// through type declaration or inference.
// Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed -
// type of parameter will flow in from the contextual type of the function
let canGetType = rootDeclaration.initializer || rootDeclaration.type || rootDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement;
let canGetType = hasInitializer(rootDeclaration) || hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement;
if (!canGetType && rootDeclaration.kind === SyntaxKind.Parameter) {
if (isExpression(rootDeclaration.parent)) {
canGetType = !!typeChecker.getContextualType(<Expression>rootDeclaration.parent);
@@ -1717,7 +1763,10 @@ namespace ts.Completions {
return true;
}
return isDeclarationName(contextToken) && !isJsxAttribute(contextToken.parent);
return isDeclarationName(contextToken)
&& !isJsxAttribute(contextToken.parent)
// Don't block completions if we're in `class C /**/`, because we're *past* the end of the identifier and might want to complete `extends`.
&& !(isClassLike(contextToken.parent) && position > previousToken.end);
}
function isFunctionLikeButNotConstructor(kind: SyntaxKind) {
@@ -1756,10 +1805,10 @@ namespace ts.Completions {
}
if (existingImportsOrExports.size === 0) {
return filter(exportsOfModule, e => e.escapedName !== "default");
return filter(exportsOfModule, e => e.escapedName !== InternalSymbolName.Default);
}
return filter(exportsOfModule, e => e.escapedName !== "default" && !existingImportsOrExports.get(e.escapedName));
return filter(exportsOfModule, e => e.escapedName !== InternalSymbolName.Default && !existingImportsOrExports.get(e.escapedName));
}
/**
@@ -2075,8 +2124,7 @@ namespace ts.Completions {
/**
* Gets all properties on a type, but if that type is a union of several types,
* tries to only include those types which declare properties, not methods.
* This ensures that we don't try providing completions for all the methods on e.g. Array.
* excludes array-like types or callable/constructable types.
*/
function getPropertiesForCompletion(type: Type, checker: TypeChecker, isForAccess: boolean): Symbol[] {
if (!(type.flags & TypeFlags.Union)) {
+71 -22
View File
@@ -376,7 +376,7 @@ namespace ts.FindAllReferences.Core {
const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), symbol.declarations);
const result: SymbolAndEntries[] = [];
const state = new State(sourceFiles, /*isForConstructor*/ node.kind === SyntaxKind.ConstructorKeyword, checker, cancellationToken, searchMeaning, options, result);
const state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result);
if (node.kind === SyntaxKind.DefaultKeyword) {
addReference(node, symbol, node, state);
@@ -403,6 +403,21 @@ namespace ts.FindAllReferences.Core {
return result;
}
function getSpecialSearchKind(node: Node): SpecialSearchKind {
switch (node.kind) {
case SyntaxKind.ConstructorKeyword:
return SpecialSearchKind.Constructor;
case SyntaxKind.Identifier:
if (isClassLike(node.parent)) {
Debug.assert(node.parent.name === node);
return SpecialSearchKind.Class;
}
// falls through
default:
return SpecialSearchKind.None;
}
}
/** Handle a few special cases relating to export/import specifiers. */
function skipPastExportOrImportSpecifier(symbol: Symbol, node: Node, checker: TypeChecker): Symbol {
const { parent } = node;
@@ -439,6 +454,12 @@ namespace ts.FindAllReferences.Core {
includes(symbol: Symbol): boolean;
}
const enum SpecialSearchKind {
None,
Constructor,
Class,
}
/**
* Holds all state needed for the finding references.
* Unlike `Search`, there is only one `State`.
@@ -472,7 +493,7 @@ namespace ts.FindAllReferences.Core {
constructor(
readonly sourceFiles: ReadonlyArray<SourceFile>,
/** True if we're searching for constructor references. */
readonly isForConstructor: boolean,
readonly specialSearchKind: SpecialSearchKind,
readonly checker: TypeChecker,
readonly cancellationToken: CancellationToken,
readonly searchMeaning: SemanticMeaning,
@@ -845,11 +866,16 @@ namespace ts.FindAllReferences.Core {
return;
}
if (state.isForConstructor) {
findConstructorReferences(referenceLocation, sourceFile, search, state);
}
else {
addReference(referenceLocation, relatedSymbol, search.location, state);
switch (state.specialSearchKind) {
case SpecialSearchKind.None:
addReference(referenceLocation, relatedSymbol, search.location, state);
break;
case SpecialSearchKind.Constructor:
addConstructorReferences(referenceLocation, sourceFile, search, state);
break;
case SpecialSearchKind.Class:
addClassStaticThisReferences(referenceLocation, search, state);
break;
}
getImportOrExportReferences(referenceLocation, referenceSymbol, search, state);
@@ -961,27 +987,52 @@ namespace ts.FindAllReferences.Core {
}
/** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */
function findConstructorReferences(referenceLocation: Node, sourceFile: SourceFile, search: Search, state: State): void {
function addConstructorReferences(referenceLocation: Node, sourceFile: SourceFile, search: Search, state: State): void {
if (isNewExpressionTarget(referenceLocation)) {
addReference(referenceLocation, search.symbol, search.location, state);
}
const pusher = state.referenceAdder(search.symbol, search.location);
const pusher = () => state.referenceAdder(search.symbol, search.location);
if (isClassLike(referenceLocation.parent)) {
Debug.assert(referenceLocation.parent.name === referenceLocation);
// This is the class declaration containing the constructor.
findOwnConstructorReferences(search.symbol, sourceFile, pusher);
findOwnConstructorReferences(search.symbol, sourceFile, pusher());
}
else {
// If this class appears in `extends C`, then the extending class' "super" calls are references.
const classExtending = tryGetClassByExtendingIdentifier(referenceLocation);
if (classExtending && isClassLike(classExtending)) {
findSuperConstructorAccesses(classExtending, pusher);
if (classExtending) {
findSuperConstructorAccesses(classExtending, pusher());
}
}
}
function addClassStaticThisReferences(referenceLocation: Node, search: Search, state: State): void {
addReference(referenceLocation, search.symbol, search.location, state);
if (isClassLike(referenceLocation.parent)) {
Debug.assert(referenceLocation.parent.name === referenceLocation);
// This is the class declaration.
addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location));
}
}
function addStaticThisReferences(classLike: ClassLikeDeclaration, pusher: (node: Node) => void): void {
for (const member of classLike.members) {
if (!(isMethodOrAccessor(member) && hasModifier(member, ModifierFlags.Static))) {
continue;
}
member.body.forEachChild(function cb(node) {
if (node.kind === SyntaxKind.ThisKeyword) {
pusher(node);
}
else if (!isFunctionLike(node)) {
node.forEachChild(cb);
}
});
}
}
function getPropertyAccessExpressionFromRightHandSide(node: Node): PropertyAccessExpression {
return isRightSideOfPropertyAccess(node) && <PropertyAccessExpression>node.parent;
}
@@ -992,7 +1043,7 @@ namespace ts.FindAllReferences.Core {
*/
function findOwnConstructorReferences(classSymbol: Symbol, sourceFile: SourceFile, addNode: (node: Node) => void): void {
for (const decl of classSymbol.members.get(InternalSymbolName.Constructor).declarations) {
const ctrKeyword = ts.findChildOfKind(decl, ts.SyntaxKind.ConstructorKeyword, sourceFile)!;
const ctrKeyword = findChildOfKind(decl, ts.SyntaxKind.ConstructorKeyword, sourceFile)!;
Debug.assert(decl.kind === SyntaxKind.Constructor && !!ctrKeyword);
addNode(ctrKeyword);
}
@@ -1060,7 +1111,7 @@ namespace ts.FindAllReferences.Core {
const containingTypeReference = getContainingTypeReference(refNode);
if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) {
const parent = containingTypeReference.parent;
if (isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) {
if (hasType(parent) && parent.type === containingTypeReference && hasInitializer(parent) && isImplementationExpression(parent.initializer)) {
addReference(parent.initializer);
}
else if (isFunctionLike(parent) && parent.type === containingTypeReference && (parent as FunctionLikeDeclaration).body) {
@@ -1670,14 +1721,12 @@ namespace ts.FindAllReferences.Core {
if (!node) {
return false;
}
else if (isVariableLike(node)) {
if (node.initializer) {
return true;
}
else if (node.kind === SyntaxKind.VariableDeclaration) {
const parentStatement = getParentStatementOfVariableDeclaration(<VariableDeclaration>node);
return parentStatement && hasModifier(parentStatement, ModifierFlags.Ambient);
}
else if (isVariableLike(node) && hasInitializer(node)) {
return true;
}
else if (node.kind === SyntaxKind.VariableDeclaration) {
const parentStatement = getParentStatementOfVariableDeclaration(<VariableDeclaration>node);
return parentStatement && hasModifier(parentStatement, ModifierFlags.Ambient);
}
else if (isFunctionLike(node)) {
return !!(node as FunctionLikeDeclaration).body || hasModifier(node, ModifierFlags.Ambient);
+6 -5
View File
@@ -302,7 +302,7 @@ namespace ts.formatting {
rule("NoSpaceAfterTypeAssertion", SyntaxKind.GreaterThanToken, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], RuleAction.Delete),
];
// These rules are lower in priority than user-configurable
// These rules are lower in priority than user-configurable. Rules earlier in this list have priority over rules later in the list.
const lowPriorityCommonRules = [
// Space after keyword but not before ; or : or ?
rule("NoSpaceBeforeSemicolon", anyToken, SyntaxKind.SemicolonToken, [isNonJsxSameLineTokenContext], RuleAction.Delete),
@@ -312,10 +312,6 @@ namespace ts.formatting {
rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, SyntaxKind.OpenBraceToken, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], RuleAction.Space, RuleFlags.CanDeleteNewLines),
rule("NoSpaceBeforeComma", anyToken, SyntaxKind.CommaToken, [isNonJsxSameLineTokenContext], RuleAction.Delete),
// No space before and after indexer
rule("NoSpaceBeforeOpenBracket", anyTokenExcept(SyntaxKind.AsyncKeyword), SyntaxKind.OpenBracketToken, [isNonJsxSameLineTokenContext], RuleAction.Delete),
rule("NoSpaceAfterCloseBracket", SyntaxKind.CloseBracketToken, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], RuleAction.Delete),
rule("SpaceAfterSemicolon", SyntaxKind.SemicolonToken, anyToken, [isNonJsxSameLineTokenContext], RuleAction.Space),
// Add a space between statements. All keywords except (do,else,case) has open/close parens after them.
// So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any]
@@ -327,6 +323,11 @@ namespace ts.formatting {
RuleAction.Space),
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
rule("SpaceAfterTryFinally", [SyntaxKind.TryKeyword, SyntaxKind.FinallyKeyword], SyntaxKind.OpenBraceToken, [isNonJsxSameLineTokenContext], RuleAction.Space),
// No space before and after indexer `x[]`
rule("NoSpaceBeforeOpenBracket", anyTokenExcept(SyntaxKind.AsyncKeyword), SyntaxKind.OpenBracketToken, [isNonJsxSameLineTokenContext], RuleAction.Delete),
rule("NoSpaceAfterCloseBracket", SyntaxKind.CloseBracketToken, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], RuleAction.Delete),
rule("SpaceAfterSemicolon", SyntaxKind.SemicolonToken, anyToken, [isNonJsxSameLineTokenContext], RuleAction.Space),
];
return [
+3 -3
View File
@@ -290,7 +290,7 @@ namespace ts.FindAllReferences {
function isNameMatch(name: __String): boolean {
// Use name of "default" even in `export =` case because we may have allowSyntheticDefaultImports
return name === exportSymbol.escapedName || exportKind !== ExportKind.Named && name === "default";
return name === exportSymbol.escapedName || exportKind !== ExportKind.Named && name === InternalSymbolName.Default;
}
}
@@ -534,7 +534,7 @@ namespace ts.FindAllReferences {
// If `importedName` is undefined, do continue searching as the export is anonymous.
// (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.)
const importedName = symbolName(importedSymbol);
if (importedName === undefined || importedName === "default" || importedName === symbol.escapedName) {
if (importedName === undefined || importedName === InternalSymbolName.Default || importedName === symbol.escapedName) {
return { kind: ImportExport.Import, symbol: importedSymbol, ...isImport };
}
}
@@ -604,7 +604,7 @@ namespace ts.FindAllReferences {
}
function symbolName(symbol: Symbol): __String | undefined {
if (symbol.escapedName !== "default") {
if (symbol.escapedName !== InternalSymbolName.Default) {
return symbol.escapedName;
}
+45 -24
View File
@@ -1,6 +1,5 @@
/* @internal */
namespace ts.JsDoc {
const singleLineTemplate = { newText: "/** */", caretOffset: 3 };
const jsDocTagNames = [
"augments",
"author",
@@ -197,9 +196,16 @@ namespace ts.JsDoc {
/**
* Checks if position points to a valid position to add JSDoc comments, and if so,
* returns the appropriate template. Otherwise returns an empty string.
* Invalid positions are
* - within comments, strings (including template literals and regex), and JSXText
* - within a token
* Valid positions are
* - outside of comments, statements, and expressions, and
* - preceding a:
* - function/constructor/method declaration
* - class declarations
* - variable statements
* - namespace declarations
* - interface declarations
* - method signatures
* - type alias declarations
*
* Hosts should ideally check that:
* - The line is all whitespace up to 'position' before performing the insertion.
@@ -225,19 +231,17 @@ namespace ts.JsDoc {
const commentOwnerInfo = getCommentOwnerInfo(tokenAtPos);
if (!commentOwnerInfo) {
// if climbing the tree did not find a declaration with parameters, complete to a single line comment
return singleLineTemplate;
return undefined;
}
const { commentOwner, parameters } = commentOwnerInfo;
if (commentOwner.kind === SyntaxKind.JsxText) {
if (commentOwner.getStart() < position) {
return undefined;
}
if (commentOwner.getStart() < position || parameters.length === 0) {
// if climbing the tree found a declaration with parameters but the request was made inside it
// or if there are no parameters, complete to a single line comment
return singleLineTemplate;
if (!parameters || parameters.length === 0) {
// if there are no parameters, just complete to a single line JSDoc comment
const singleLineResult = "/** */";
return { newText: singleLineResult, caretOffset: 3 };
}
const posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position);
@@ -247,11 +251,19 @@ namespace ts.JsDoc {
const indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, () => " ");
const isJavaScriptFile = hasJavaScriptFileExtension(sourceFile.fileName);
const docParams = parameters.map(({name}, i) => {
const nameText = isIdentifier(name) ? name.text : `param${i}`;
const type = isJavaScriptFile ? "{any} " : "";
return `${indentationStr} * @param ${type}${nameText}${newLine}`;
}).join("");
let docParams = "";
for (let i = 0; i < parameters.length; i++) {
const currentName = parameters[i].name;
const paramName = currentName.kind === SyntaxKind.Identifier ?
(<Identifier>currentName).escapedText :
"param" + i;
if (isJavaScriptFile) {
docParams += `${indentationStr} * @param {any} ${paramName}${newLine}`;
}
else {
docParams += `${indentationStr} * @param ${paramName}${newLine}`;
}
}
// A doc comment consists of the following
// * The opening comment line
@@ -273,7 +285,7 @@ namespace ts.JsDoc {
interface CommentOwnerInfo {
readonly commentOwner: Node;
readonly parameters: ReadonlyArray<ParameterDeclaration>;
readonly parameters?: ReadonlyArray<ParameterDeclaration>;
}
function getCommentOwnerInfo(tokenAtPos: Node): CommentOwnerInfo | undefined {
for (let commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) {
@@ -285,18 +297,32 @@ namespace ts.JsDoc {
const { parameters } = commentOwner as FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature;
return { commentOwner, parameters };
case SyntaxKind.ClassDeclaration:
case SyntaxKind.InterfaceDeclaration:
case SyntaxKind.PropertySignature:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.EnumMember:
case SyntaxKind.TypeAliasDeclaration:
return { commentOwner };
case SyntaxKind.VariableStatement: {
const varStatement = <VariableStatement>commentOwner;
const varDeclarations = varStatement.declarationList.declarations;
const parameters = varDeclarations.length === 1 && varDeclarations[0].initializer
? getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer)
: undefined;
return parameters ? { commentOwner, parameters } : undefined;
return { commentOwner, parameters };
}
case SyntaxKind.SourceFile:
return undefined;
case SyntaxKind.ModuleDeclaration:
// If in walking up the tree, we hit a a nested namespace declaration,
// then we must be somewhere within a dotted namespace name; however we don't
// want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'.
return commentOwner.parent.kind === SyntaxKind.ModuleDeclaration ? undefined : { commentOwner };
case SyntaxKind.BinaryExpression: {
const be = commentOwner as BinaryExpression;
if (getSpecialPropertyAssignmentKind(be) === ts.SpecialPropertyAssignmentKind.None) {
@@ -305,11 +331,6 @@ namespace ts.JsDoc {
const parameters = isFunctionLike(be.right) ? be.right.parameters : emptyArray;
return { commentOwner, parameters };
}
case SyntaxKind.JsxText: {
const parameters: ReadonlyArray<ParameterDeclaration> = emptyArray;
return { commentOwner, parameters };
}
}
}
}
+2 -2
View File
@@ -33,8 +33,8 @@ namespace ts {
}
export function getApplicableRefactors(context: RefactorContext): ApplicableRefactorInfo[] {
return flatMapIter(refactors.values(), refactor =>
context.cancellationToken && context.cancellationToken.isCancellationRequested() ? undefined : refactor.getAvailableActions(context));
return arrayFrom(flatMapIterator(refactors.values(), refactor =>
context.cancellationToken && context.cancellationToken.isCancellationRequested() ? undefined : refactor.getAvailableActions(context)));
}
export function getEditsForRefactor(context: RefactorContext, refactorName: string, actionName: string): RefactorEditInfo | undefined {
@@ -50,7 +50,6 @@ namespace ts.refactor.convertFunctionToES6Class {
const { file: sourceFile } = context;
const ctorSymbol = getConstructorSymbol(context);
const newLine = context.formatContext.options.newLineCharacter;
const deletedNodes: Node[] = [];
const deletes: (() => any)[] = [];
@@ -88,7 +87,7 @@ namespace ts.refactor.convertFunctionToES6Class {
}
// Because the preceding node could be touched, we need to insert nodes before delete nodes.
changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine });
changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration);
for (const deleteCallback of deletes) {
deleteCallback();
}
+20 -29
View File
@@ -658,11 +658,10 @@ namespace ts.refactor.extractSymbol {
case SyntaxKind.Constructor:
return "constructor";
case SyntaxKind.FunctionExpression:
return scope.name
? `function expression '${scope.name.text}'`
: "anonymous function expression";
case SyntaxKind.FunctionDeclaration:
return `function '${scope.name.text}'`;
return scope.name
? `function '${scope.name.text}'`
: "anonymous function";
case SyntaxKind.ArrowFunction:
return "arrow function";
case SyntaxKind.MethodDeclaration:
@@ -811,13 +810,10 @@ namespace ts.refactor.extractSymbol {
const minInsertionPos = (isReadonlyArray(range.range) ? last(range.range) : range.range).end;
const nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope);
if (nodeToInsertBefore) {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, { suffix: context.newLineCharacter + context.newLineCharacter });
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, /*blankLineBetween*/ true);
}
else {
changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, {
prefix: isLineBreak(file.text.charCodeAt(scope.getLastToken().pos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter,
suffix: context.newLineCharacter
});
changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction);
}
const newNodes: Node[] = [];
@@ -960,10 +956,12 @@ namespace ts.refactor.extractSymbol {
}
}
const replacementRange = isReadonlyArray(range.range)
? { pos: first(range.range).getStart(), end: last(range.range).end }
: { pos: range.range.getStart(), end: range.range.end };
changeTracker.replaceRangeWithNodes(context.file, replacementRange, newNodes, { nodeSeparator: context.newLineCharacter });
if (isReadonlyArray(range.range)) {
changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes);
}
else {
changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes);
}
const edits = changeTracker.getChanges();
const renameRange = isReadonlyArray(range.range) ? first(range.range) : range.range;
@@ -1006,7 +1004,7 @@ namespace ts.refactor.extractSymbol {
const localNameText = getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file.text);
const isJS = isInJavaScriptFile(scope);
const variableType = isJS
const variableType = isJS || !checker.isContextSensitive(node)
? undefined
: checker.typeToTypeNode(checker.getContextualType(node), scope, NodeBuilderFlags.NoTruncation);
@@ -1041,7 +1039,7 @@ namespace ts.refactor.extractSymbol {
// Declare
const maxInsertionPos = node.pos;
const nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope);
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, { suffix: context.newLineCharacter + context.newLineCharacter });
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true);
// Consume
changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference);
@@ -1056,8 +1054,8 @@ namespace ts.refactor.extractSymbol {
const oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope);
if (oldVariableDeclaration) {
// Declare
// CONSIDER: could detect that each is on a separate line
changeTracker.insertNodeAt(context.file, oldVariableDeclaration.getStart(), newVariableDeclaration, { suffix: ", " });
// CONSIDER: could detect that each is on a separate line (See `extractConstant_VariableList_MultipleLines` in `extractConstants.ts`)
changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration);
// Consume
const localReference = createIdentifier(localNameText);
@@ -1079,17 +1077,10 @@ namespace ts.refactor.extractSymbol {
// Declare
const nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope);
if (nodeToInsertBefore.pos === 0) {
// If we're at the beginning of the file, we need to take care not to insert before header comments
// (e.g. copyright, triple-slash references). Fortunately, this problem has already been solved
// for imports.
const insertionPos = getSourceFileImportLocation(file);
changeTracker.insertNodeAt(context.file, insertionPos, newVariableStatement, {
prefix: insertionPos === 0 ? undefined : context.newLineCharacter,
suffix: isLineBreak(file.text.charCodeAt(insertionPos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter
});
changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement, /*blankLineBetween*/ false);
}
else {
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, { suffix: context.newLineCharacter + context.newLineCharacter });
changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false);
}
// Consume
@@ -1286,12 +1277,12 @@ namespace ts.refactor.extractSymbol {
* If `scope` contains a function after `minPos`, then return the first such function.
* Otherwise, return `undefined`.
*/
function getNodeToInsertFunctionBefore(minPos: number, scope: Scope): Node | undefined {
function getNodeToInsertFunctionBefore(minPos: number, scope: Scope): Statement | ClassElement | undefined {
return find<Statement | ClassElement>(getStatementsOrClassElements(scope), child =>
child.pos >= minPos && isFunctionLikeDeclaration(child) && !isConstructorDeclaration(child));
}
function getNodeToInsertPropertyBefore(maxPos: number, scope: ClassLikeDeclaration): Node {
function getNodeToInsertPropertyBefore(maxPos: number, scope: ClassLikeDeclaration): ClassElement {
const members = scope.members;
Debug.assert(members.length > 0); // There must be at least one child, since we extracted from one.
@@ -1317,7 +1308,7 @@ namespace ts.refactor.extractSymbol {
return prevMember;
}
function getNodeToInsertConstantBefore(node: Node, scope: Scope): Node {
function getNodeToInsertConstantBefore(node: Node, scope: Scope): Statement {
Debug.assert(!isClassLike(scope));
let prevScope: Scope | undefined = undefined;
+15 -2
View File
@@ -488,6 +488,7 @@ namespace ts {
parameters: Symbol[];
thisParameter: Symbol;
resolvedReturnType: Type;
resolvedTypePredicate: TypePredicate | undefined;
minTypeArgumentCount: number;
minArgumentCount: number;
hasRestParameter: boolean;
@@ -1268,6 +1269,7 @@ namespace ts {
}
return host.readFile && host.readFile(fileName);
},
realpath: host.realpath && (path => host.realpath(path)),
directoryExists: directoryName => {
return directoryProbablyExists(directoryName, host);
},
@@ -1446,7 +1448,7 @@ namespace ts {
function getCompletionEntryDetails(fileName: string, position: number, name: string, formattingOptions?: FormatCodeSettings, source?: string): CompletionEntryDetails {
synchronizeHostData();
return Completions.getCompletionEntryDetails(
program.getTypeChecker(),
program,
log,
program.getCompilerOptions(),
getValidSourceFile(fileName),
@@ -1881,7 +1883,7 @@ namespace ts {
return [];
}
function getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[] {
function getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray<number>, formatOptions: FormatCodeSettings): ReadonlyArray<CodeFixAction> {
synchronizeHostData();
const sourceFile = getValidSourceFile(fileName);
const span = createTextSpanFromBounds(start, end);
@@ -1894,6 +1896,16 @@ namespace ts {
});
}
function getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings): CombinedCodeActions {
synchronizeHostData();
Debug.assert(scope.type === "file");
const sourceFile = getValidSourceFile(scope.fileName);
const newLineCharacter = getNewLineOrDefaultFromHost(host);
const formatContext = formatting.getFormatContext(formatOptions);
return codefix.getAllFixes({ fixId, sourceFile, program, newLineCharacter, host, cancellationToken, formatContext });
}
function applyCodeActionCommand(action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
function applyCodeActionCommand(action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
function applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
@@ -2188,6 +2200,7 @@ namespace ts {
isValidBraceCompletionAtPosition,
getSpanOfEnclosingComment,
getCodeFixesAtPosition,
getCombinedCodeFix,
applyCodeActionCommand,
getEmitOutput,
getNonBoundSourceFile,
+6 -4
View File
@@ -141,7 +141,8 @@ namespace ts {
getEncodedSemanticClassifications(fileName: string, start: number, length: number): string;
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): string;
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/, source: string | undefined): string;
// tslint:disable-next-line type-operator-spacing (false positive)
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/ | undefined, source: string | undefined): string;
getQuickInfoAtPosition(fileName: string, position: number): string;
@@ -330,7 +331,7 @@ namespace ts {
// if shimHost is a COM object then property check will become method call with no arguments.
// 'in' does not have this effect.
if ("getModuleResolutionsForFile" in this.shimHost) {
this.resolveModuleNames = (moduleNames: string[], containingFile: string) => {
this.resolveModuleNames = (moduleNames: string[], containingFile: string): ResolvedModuleFull[] => {
const resolutionsInFile = <MapLike<string>>JSON.parse(this.shimHost.getModuleResolutionsForFile(containingFile));
return map(moduleNames, name => {
const result = getProperty(resolutionsInFile, name);
@@ -906,11 +907,12 @@ namespace ts {
}
/** Get a string based representation of a completion list entry details */
public getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/, source: string | undefined) {
// tslint:disable-next-line type-operator-spacing (false positive)
public getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/ | undefined, source: string | undefined) {
return this.forwardJSONCall(
`getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`,
() => {
const localOptions: ts.FormatCodeOptions = JSON.parse(options);
const localOptions: ts.FormatCodeOptions = options === undefined ? undefined : JSON.parse(options);
return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source);
}
);
+1 -1
View File
@@ -496,7 +496,7 @@ namespace ts.SymbolDisplay {
addNewLineIfDisplayPartsExist();
if (symbolKind) {
pushTypePart(symbolKind);
if (!some(symbol.declarations, d => isArrowFunction(d) || (isFunctionExpression(d) || isClassExpression(d)) && !d.name)) {
if (symbol && !some(symbol.declarations, d => isArrowFunction(d) || (isFunctionExpression(d) || isClassExpression(d)) && !d.name)) {
displayParts.push(spacePart());
addFullSymbolName(symbol);
}
+172 -33
View File
@@ -117,7 +117,7 @@ namespace ts.textChanges {
readonly options?: never;
}
export interface ChangeMultipleNodesOptions extends ChangeNodeOptions {
interface ChangeMultipleNodesOptions extends ChangeNodeOptions {
nodeSeparator: string;
}
interface ReplaceWithMultipleNodes extends BaseChange {
@@ -192,8 +192,11 @@ namespace ts.textChanges {
}
export class ChangeTracker {
private changes: Change[] = [];
private readonly changes: Change[] = [];
private readonly newLineCharacter: string;
private readonly deletedNodesInLists: true[] = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`.
// Map from class id to nodes to insert at the start
private readonly nodesInsertedAtClassStarts = createMap<{ sourceFile: SourceFile, cls: ClassLikeDeclaration, members: ClassElement[] }>();
public static fromContext(context: TextChangesContext): ChangeTracker {
return new ChangeTracker(context.newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed, context.formatContext);
@@ -220,14 +223,14 @@ namespace ts.textChanges {
public deleteNode(sourceFile: SourceFile, node: Node, options: ConfigurableStartEnd = {}) {
const startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart);
const endPosition = getAdjustedEndPosition(sourceFile, node, options);
this.changes.push({ kind: ChangeKind.Remove, sourceFile, range: { pos: startPosition, end: endPosition } });
this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });
return this;
}
public deleteNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, options: ConfigurableStartEnd = {}) {
const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart);
const endPosition = getAdjustedEndPosition(sourceFile, endNode, options);
this.changes.push({ kind: ChangeKind.Remove, sourceFile, range: { pos: startPosition, end: endPosition } });
this.deleteRange(sourceFile, { pos: startPosition, end: endPosition });
return this;
}
@@ -245,6 +248,9 @@ namespace ts.textChanges {
this.deleteNode(sourceFile, node);
return this;
}
const id = getNodeId(node);
Debug.assert(!this.deletedNodesInLists[id], "Deleting a node twice");
this.deletedNodesInLists[id] = true;
if (index !== containingList.length - 1) {
const nextToken = getTokenAtPosition(sourceFile, node.end, /*includeJsDocComment*/ false);
if (nextToken && isSeparator(node, nextToken)) {
@@ -258,9 +264,17 @@ namespace ts.textChanges {
}
}
else {
const previousToken = getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false);
if (previousToken && isSeparator(node, previousToken)) {
this.deleteNodeRange(sourceFile, previousToken, node);
const prev = containingList[index - 1];
if (this.deletedNodesInLists[getNodeId(prev)]) {
const pos = skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true);
const end = getAdjustedEndPosition(sourceFile, node, {});
this.deleteRange(sourceFile, { pos, end });
}
else {
const previousToken = getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false);
if (previousToken && isSeparator(node, previousToken)) {
this.deleteNodeRange(sourceFile, previousToken, node);
}
}
}
return this;
@@ -305,40 +319,99 @@ namespace ts.textChanges {
return this;
}
public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray<Node>, options: ChangeMultipleNodesOptions) {
const startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start);
const endPosition = getAdjustedEndPosition(sourceFile, oldNode, options);
return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options);
public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray<Node>): void {
this.replaceWithMultiple(sourceFile, oldNode.getStart(sourceFile), oldNode.getEnd(), newNodes, { nodeSeparator: this.newLineCharacter });
}
public replaceNodesWithNodes(sourceFile: SourceFile, oldNodes: ReadonlyArray<Node>, newNodes: ReadonlyArray<Node>, options: ChangeMultipleNodesOptions) {
const startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start);
const endPosition = getAdjustedEndPosition(sourceFile, lastOrUndefined(oldNodes), options);
return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options);
public replaceNodesWithNodes(sourceFile: SourceFile, oldNodes: ReadonlyArray<Node>, newNodes: ReadonlyArray<Node>): void {
this.replaceWithMultiple(sourceFile, first(oldNodes).getStart(sourceFile), last(oldNodes).getEnd(), newNodes, { nodeSeparator: this.newLineCharacter });
}
public replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray<Node>, options: ChangeMultipleNodesOptions) {
return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options);
}
public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray<Node>, options: ChangeMultipleNodesOptions) {
const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start);
const endPosition = getAdjustedEndPosition(sourceFile, endNode, options);
return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options);
}
public insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options: InsertNodeOptions = {}) {
private insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options: InsertNodeOptions = {}) {
this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, options, node: newNode, range: { pos, end: pos } });
return this;
}
public insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, options: InsertNodeOptions & ConfigurableStart = {}) {
const startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start);
return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options);
public insertNodeAtTopOfFile(sourceFile: SourceFile, newNode: Statement, blankLineBetween: boolean): void {
const pos = getInsertionPositionAtSourceFileTop(sourceFile);
this.insertNodeAt(sourceFile, pos, newNode, {
prefix: pos === 0 ? undefined : this.newLineCharacter,
suffix: (isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : ""),
});
}
public insertNodeAfter(sourceFile: SourceFile, after: Node, newNode: Node, options: InsertNodeOptions & ConfigurableEnd = {}) {
if ((isStatementButNotDeclaration(after)) ||
public insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, blankLineBetween = false) {
const startPosition = getAdjustedStartPosition(sourceFile, before, {}, Position.Start);
return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween));
}
public changeIdentifierToPropertyAccess(sourceFile: SourceFile, prefix: string, node: Identifier): void {
const startPosition = getAdjustedStartPosition(sourceFile, node, {}, Position.Start);
this.replaceWithSingle(sourceFile, startPosition, startPosition, createPropertyAccess(createIdentifier(prefix), ""), {});
}
private getOptionsForInsertNodeBefore(before: Node, doubleNewlines: boolean): ChangeNodeOptions {
if (isStatement(before) || isClassElement(before)) {
return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter };
}
else if (isVariableDeclaration(before)) { // insert `x = 1, ` into `const x = 1, y = 2;
return { suffix: ", " };
}
throw Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it
}
public insertNodeAtConstructorStart(sourceFile: SourceFile, ctr: ConstructorDeclaration, newStatement: Statement): void {
const firstStatement = firstOrUndefined(ctr.body.statements);
if (!firstStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, [newStatement, ...ctr.body.statements]);
}
else {
this.insertNodeBefore(sourceFile, firstStatement, newStatement);
}
}
public insertNodeAtConstructorEnd(sourceFile: SourceFile, ctr: ConstructorDeclaration, newStatement: Statement): void {
const lastStatement = lastOrUndefined(ctr.body.statements);
if (!lastStatement || !ctr.body.multiLine) {
this.replaceConstructorBody(sourceFile, ctr, [...ctr.body.statements, newStatement]);
}
else {
this.insertNodeAfter(sourceFile, lastStatement, newStatement);
}
}
private replaceConstructorBody(sourceFile: SourceFile, ctr: ConstructorDeclaration, statements: ReadonlyArray<Statement>): void {
this.replaceNode(sourceFile, ctr.body, createBlock(statements, /*multiLine*/ true), { useNonAdjustedEndPosition: true });
}
public insertNodeAtEndOfScope(sourceFile: SourceFile, scope: Node, newNode: Node): void {
const startPosition = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start);
this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, {
prefix: isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter,
suffix: this.newLineCharacter
});
}
public insertNodeAtClassStart(sourceFile: SourceFile, cls: ClassLikeDeclaration, newElement: ClassElement): void {
const firstMember = firstOrUndefined(cls.members);
if (!firstMember) {
const id = getNodeId(cls).toString();
const newMembers = this.nodesInsertedAtClassStarts.get(id);
if (newMembers) {
Debug.assert(newMembers.sourceFile === sourceFile && newMembers.cls === cls);
newMembers.members.push(newElement);
}
else {
this.nodesInsertedAtClassStarts.set(id, { sourceFile, cls, members: [newElement] });
}
}
else {
this.insertNodeBefore(sourceFile, firstMember, newElement);
}
}
public insertNodeAfter(sourceFile: SourceFile, after: Node, newNode: Node): this {
if (isStatementButNotDeclaration(after) ||
after.kind === SyntaxKind.PropertyDeclaration ||
after.kind === SyntaxKind.PropertySignature ||
after.kind === SyntaxKind.MethodSignature) {
@@ -354,8 +427,21 @@ namespace ts.textChanges {
});
}
}
const endPosition = getAdjustedEndPosition(sourceFile, after, options);
return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options);
const endPosition = getAdjustedEndPosition(sourceFile, after, {});
return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, this.getInsertNodeAfterOptions(after));
}
private getInsertNodeAfterOptions(node: Node): InsertNodeOptions {
if (isClassDeclaration(node) || isModuleDeclaration(node)) {
return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
}
else if (isStatement(node) || isClassElement(node) || isTypeElement(node)) {
return { suffix: this.newLineCharacter };
}
else if (isVariableDeclaration(node)) {
return { prefix: ", " };
}
throw Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it
}
/**
@@ -502,7 +588,18 @@ namespace ts.textChanges {
return this;
}
private finishInsertNodeAtClassStart(): void {
this.nodesInsertedAtClassStarts.forEach(({ sourceFile, cls, members }) => {
const newCls = cls.kind === SyntaxKind.ClassDeclaration
? updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members)
: updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members);
this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true });
});
}
public getChanges(): FileTextChanges[] {
this.finishInsertNodeAtClassStart();
const changesPerFile = createMap<Change[]>();
// group changes per file
for (const c of this.changes) {
@@ -751,4 +848,46 @@ namespace ts.textChanges {
this.lastNonTriviaPosition = 0;
}
}
function getInsertionPositionAtSourceFileTop({ text }: SourceFile): number {
const shebang = getShebang(text);
let position = 0;
if (shebang !== undefined) {
position = shebang.length;
advancePastLineBreak();
}
// For a source file, it is possible there are detached comments we should not skip
let ranges = getLeadingCommentRanges(text, position);
if (!ranges) return position;
// However we should still skip a pinned comment at the top
if (ranges.length && ranges[0].kind === SyntaxKind.MultiLineCommentTrivia && isPinnedComment(text, ranges[0])) {
position = ranges[0].end;
advancePastLineBreak();
ranges = ranges.slice(1);
}
// As well as any triple slash references
for (const range of ranges) {
if (range.kind === SyntaxKind.SingleLineCommentTrivia && isRecognizedTripleSlashComment(text, range.pos, range.end)) {
position = range.end;
advancePastLineBreak();
continue;
}
break;
}
return position;
function advancePastLineBreak() {
if (position < text.length) {
const charCode = text.charCodeAt(position);
if (isLineBreak(charCode)) {
position++;
if (position < text.length && charCode === CharacterCodes.carriageReturn && text.charCodeAt(position) === CharacterCodes.lineFeed) {
position++;
}
}
}
}
}
}
+27 -1
View File
@@ -181,6 +181,7 @@ namespace ts {
*/
readDirectory?(path: string, extensions?: ReadonlyArray<string>, exclude?: ReadonlyArray<string>, include?: ReadonlyArray<string>, depth?: number): string[];
readFile?(path: string, encoding?: string): string | undefined;
realpath?(path: string): string;
fileExists?(path: string): boolean;
/*
@@ -294,7 +295,11 @@ namespace ts {
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
// TODO: GH#20538 return `ReadonlyArray<CodeFixAction>`
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray<number>, formatOptions: FormatCodeSettings): ReadonlyArray<CodeAction>;
// TODO: GH#20538
/* @internal */
getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings): CombinedCodeActions;
applyCodeActionCommand(action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
applyCodeActionCommand(action: CodeActionCommand[]): Promise<ApplyCodeActionCommandResult[]>;
applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[]): Promise<ApplyCodeActionCommandResult | ApplyCodeActionCommandResult[]>;
@@ -322,6 +327,10 @@ namespace ts {
dispose(): void;
}
// TODO: GH#20538
/* @internal */
export interface CombinedCodeFixScope { type: "file"; fileName: string; }
export interface GetCompletionsAtPositionOptions {
includeExternalModuleExports: boolean;
}
@@ -409,6 +418,23 @@ namespace ts {
commands?: CodeActionCommand[];
}
// TODO: GH#20538
/* @internal */
export interface CodeFixAction extends CodeAction {
/**
* 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.
*/
fixId?: {};
}
// TODO: GH#20538
/* @internal */
export interface CombinedCodeActions {
changes: ReadonlyArray<FileTextChanges>;
commands: ReadonlyArray<CodeActionCommand> | undefined;
}
// Publicly, this type is just `{}`. Internally it is a union of all the actions we use.
// See `commands?: {}[]` in protocol.ts
export type CodeActionCommand = InstallPackageAction;
+22 -61
View File
@@ -445,7 +445,7 @@ namespace ts {
return position < candidate.end || !isCompletedNode(candidate, sourceFile);
}
export function isCompletedNode(n: Node, sourceFile: SourceFile): boolean {
function isCompletedNode(n: Node, sourceFile: SourceFile): boolean {
if (nodeIsMissing(n)) {
return false;
}
@@ -512,7 +512,7 @@ namespace ts {
case SyntaxKind.ExpressionStatement:
return isCompletedNode((<ExpressionStatement>n).expression, sourceFile) ||
hasChildOfKind(n, SyntaxKind.SemicolonToken);
hasChildOfKind(n, SyntaxKind.SemicolonToken, sourceFile);
case SyntaxKind.ArrayLiteralExpression:
case SyntaxKind.ArrayBindingPattern:
@@ -540,11 +540,9 @@ namespace ts {
return isCompletedNode((<IterationStatement>n).statement, sourceFile);
case SyntaxKind.DoStatement:
// rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')';
const hasWhileKeyword = findChildOfKind(n, SyntaxKind.WhileKeyword, sourceFile);
if (hasWhileKeyword) {
return nodeEndsWith(n, SyntaxKind.CloseParenToken, sourceFile);
}
return isCompletedNode((<DoStatement>n).statement, sourceFile);
return hasChildOfKind(n, SyntaxKind.WhileKeyword, sourceFile)
? nodeEndsWith(n, SyntaxKind.CloseParenToken, sourceFile)
: isCompletedNode((<DoStatement>n).statement, sourceFile);
case SyntaxKind.TypeQuery:
return isCompletedNode((<TypeQueryNode>n).exprName, sourceFile);
@@ -619,12 +617,12 @@ namespace ts {
};
}
export function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFile): boolean {
export function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile: SourceFile): boolean {
return !!findChildOfKind(n, kind, sourceFile);
}
export function findChildOfKind(n: Node, kind: SyntaxKind, sourceFile?: SourceFileLike): Node | undefined {
return forEach(n.getChildren(sourceFile), c => c.kind === kind && c);
export function findChildOfKind<T extends Node>(n: Node, kind: T["kind"], sourceFile: SourceFileLike): T | undefined {
return find(n.getChildren(sourceFile), (c): c is T => c.kind === kind);
}
export function findContainingList(node: Node): SyntaxList | undefined {
@@ -1099,6 +1097,20 @@ namespace ts {
return !seen[id] && (seen[id] = true);
};
}
/** Add a value to a set, and return true if it wasn't already present. */
export function addToSeen(seen: Map<true>, key: string | number): boolean {
key = String(key);
if (seen.has(key)) {
return false;
}
seen.set(key, true);
return true;
}
export function singleElementArray<T>(t: T | undefined): T[] {
return t === undefined ? undefined : [t];
}
}
// Display-part writer helpers
@@ -1320,57 +1332,6 @@ namespace ts {
return position;
}
export function getOpenBrace(constructor: ConstructorDeclaration, sourceFile: SourceFile) {
// First token is the open curly, this is where we want to put the 'super' call.
return constructor.body.getFirstToken(sourceFile);
}
export function getOpenBraceOfClassLike(declaration: ClassLikeDeclaration, sourceFile: SourceFile) {
return getTokenAtPosition(sourceFile, declaration.members.pos - 1, /*includeJsDocComment*/ false);
}
export function getSourceFileImportLocation({ text }: SourceFile) {
const shebang = getShebang(text);
let position = 0;
if (shebang !== undefined) {
position = shebang.length;
advancePastLineBreak();
}
// For a source file, it is possible there are detached comments we should not skip
let ranges = getLeadingCommentRanges(text, position);
if (!ranges) return position;
// However we should still skip a pinned comment at the top
if (ranges.length && ranges[0].kind === SyntaxKind.MultiLineCommentTrivia && isPinnedComment(text, ranges[0])) {
position = ranges[0].end;
advancePastLineBreak();
ranges = ranges.slice(1);
}
// As well as any triple slash references
for (const range of ranges) {
if (range.kind === SyntaxKind.SingleLineCommentTrivia && isRecognizedTripleSlashComment(text, range.pos, range.end)) {
position = range.end;
advancePastLineBreak();
continue;
}
break;
}
return position;
function advancePastLineBreak() {
if (position < text.length) {
const charCode = text.charCodeAt(position);
if (isLineBreak(charCode)) {
position++;
if (position < text.length && charCode === CharacterCodes.carriageReturn && text.charCodeAt(position) === CharacterCodes.lineFeed) {
position++;
}
}
}
}
}
/**
* Creates a deep, memberwise clone of a node with no source map location.
*