mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge remote-tracking branch 'origin/master' into release-4.1
This commit is contained in:
+94
-7
@@ -174,14 +174,15 @@ namespace ts {
|
||||
const binder = createBinder();
|
||||
|
||||
export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
|
||||
tracing.begin(tracing.Phase.Bind, "bindSourceFile", { path: file.path });
|
||||
const tracingData: tracing.EventData = [tracing.Phase.Bind, "bindSourceFile", { path: file.path }];
|
||||
tracing.begin(...tracingData);
|
||||
performance.mark("beforeBind");
|
||||
perfLogger.logStartBindFile("" + file.fileName);
|
||||
binder(file, options);
|
||||
perfLogger.logStopBindFile();
|
||||
performance.mark("afterBind");
|
||||
performance.measure("Bind", "beforeBind", "afterBind");
|
||||
tracing.end();
|
||||
tracing.end(...tracingData);
|
||||
}
|
||||
|
||||
function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
|
||||
@@ -217,6 +218,9 @@ namespace ts {
|
||||
// or if compiler options contain alwaysStrict.
|
||||
let inStrictMode: boolean;
|
||||
|
||||
// If we are binding an assignment pattern, we will bind certain expressions differently.
|
||||
let inAssignmentPattern = false;
|
||||
|
||||
let symbolCount = 0;
|
||||
|
||||
let Symbol: new (flags: SymbolFlags, name: __String) => Symbol;
|
||||
@@ -274,6 +278,7 @@ namespace ts {
|
||||
currentExceptionTarget = undefined;
|
||||
activeLabelList = undefined;
|
||||
hasExplicitReturn = false;
|
||||
inAssignmentPattern = false;
|
||||
emitFlags = NodeFlags.None;
|
||||
}
|
||||
|
||||
@@ -586,6 +591,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
function jsdocTreatAsExported(node: Node) {
|
||||
if (node.parent && isModuleDeclaration(node)) {
|
||||
node = node.parent;
|
||||
}
|
||||
if (!isJSDocTypeAlias(node)) return false;
|
||||
// jsdoc typedef handling is a bit of a doozy, but to summarize, treat the typedef as exported if:
|
||||
// 1. It has an explicit name (since by default typedefs are always directly exported, either at the top level or in a container), or
|
||||
@@ -729,9 +737,14 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bindChildren(node: Node): void {
|
||||
const saveInAssignmentPattern = inAssignmentPattern;
|
||||
// Most nodes aren't valid in an assignment pattern, so we clear the value here
|
||||
// and set it before we descend into nodes that could actually be part of an assignment pattern.
|
||||
inAssignmentPattern = false;
|
||||
if (checkUnreachable(node)) {
|
||||
bindEachChild(node);
|
||||
bindJSDoc(node);
|
||||
inAssignmentPattern = saveInAssignmentPattern;
|
||||
return;
|
||||
}
|
||||
if (node.kind >= SyntaxKind.FirstStatement && node.kind <= SyntaxKind.LastStatement && !options.allowUnreachableCode) {
|
||||
@@ -787,6 +800,13 @@ namespace ts {
|
||||
bindPostfixUnaryExpressionFlow(<PostfixUnaryExpression>node);
|
||||
break;
|
||||
case SyntaxKind.BinaryExpression:
|
||||
if (isDestructuringAssignment(node)) {
|
||||
// Carry over whether we are in an assignment pattern to
|
||||
// binary expressions that could actually be an initializer
|
||||
inAssignmentPattern = saveInAssignmentPattern;
|
||||
bindDestructuringAssignmentFlow(node);
|
||||
return;
|
||||
}
|
||||
bindBinaryExpressionFlow(<BinaryExpression>node);
|
||||
break;
|
||||
case SyntaxKind.DeleteExpression:
|
||||
@@ -823,11 +843,23 @@ namespace ts {
|
||||
case SyntaxKind.ModuleBlock:
|
||||
bindEachFunctionsFirst((node as Block).statements);
|
||||
break;
|
||||
case SyntaxKind.BindingElement:
|
||||
bindBindingElementFlow(<BindingElement>node);
|
||||
break;
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
case SyntaxKind.SpreadElement:
|
||||
// Carry over whether we are in an assignment pattern of Object and Array literals
|
||||
// as well as their children that are valid assignment targets.
|
||||
inAssignmentPattern = saveInAssignmentPattern;
|
||||
// falls through
|
||||
default:
|
||||
bindEachChild(node);
|
||||
break;
|
||||
}
|
||||
bindJSDoc(node);
|
||||
inAssignmentPattern = saveInAssignmentPattern;
|
||||
}
|
||||
|
||||
function isNarrowingExpression(expr: Expression): boolean {
|
||||
@@ -841,7 +873,8 @@ namespace ts {
|
||||
case SyntaxKind.CallExpression:
|
||||
return hasNarrowableArgument(<CallExpression>expr);
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return isNarrowingExpression((<ParenthesizedExpression>expr).expression);
|
||||
case SyntaxKind.NonNullExpression:
|
||||
return isNarrowingExpression((<ParenthesizedExpression | NonNullExpression>expr).expression);
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return isNarrowingBinaryExpression(<BinaryExpression>expr);
|
||||
case SyntaxKind.PrefixUnaryExpression:
|
||||
@@ -855,6 +888,7 @@ namespace ts {
|
||||
function isNarrowableReference(expr: Expression): boolean {
|
||||
return expr.kind === SyntaxKind.Identifier || expr.kind === SyntaxKind.PrivateIdentifier || expr.kind === SyntaxKind.ThisKeyword || expr.kind === SyntaxKind.SuperKeyword ||
|
||||
(isPropertyAccessExpression(expr) || isNonNullExpression(expr) || isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) ||
|
||||
isBinaryExpression(expr) && expr.operatorToken.kind === SyntaxKind.CommaToken && isNarrowableReference(expr.right) ||
|
||||
isElementAccessExpression(expr) && isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression) ||
|
||||
isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
||||
}
|
||||
@@ -1331,10 +1365,14 @@ namespace ts {
|
||||
|
||||
function bindExpressionStatement(node: ExpressionStatement): void {
|
||||
bind(node.expression);
|
||||
// A top level call expression with a dotted function name and at least one argument
|
||||
maybeBindExpressionFlowIfCall(node.expression);
|
||||
}
|
||||
|
||||
function maybeBindExpressionFlowIfCall(node: Expression) {
|
||||
// A top level or LHS of comma expression call expression with a dotted function name and at least one argument
|
||||
// is potentially an assertion and is therefore included in the control flow.
|
||||
if (node.expression.kind === SyntaxKind.CallExpression) {
|
||||
const call = <CallExpression>node.expression;
|
||||
if (node.kind === SyntaxKind.CallExpression) {
|
||||
const call = <CallExpression>node;
|
||||
if (isDottedName(call.expression) && call.expression.kind !== SyntaxKind.SuperKeyword) {
|
||||
currentFlow = createFlowCall(currentFlow, call);
|
||||
}
|
||||
@@ -1445,6 +1483,24 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function bindDestructuringAssignmentFlow(node: DestructuringAssignment) {
|
||||
if (inAssignmentPattern) {
|
||||
inAssignmentPattern = false;
|
||||
bind(node.operatorToken);
|
||||
bind(node.right);
|
||||
inAssignmentPattern = true;
|
||||
bind(node.left);
|
||||
}
|
||||
else {
|
||||
inAssignmentPattern = true;
|
||||
bind(node.left);
|
||||
inAssignmentPattern = false;
|
||||
bind(node.operatorToken);
|
||||
bind(node.right);
|
||||
}
|
||||
bindAssignmentTargetFlow(node.left);
|
||||
}
|
||||
|
||||
const enum BindBinaryExpressionFlowState {
|
||||
BindThenBindChildren,
|
||||
MaybeBindLeft,
|
||||
@@ -1505,6 +1561,9 @@ namespace ts {
|
||||
break;
|
||||
}
|
||||
case BindBinaryExpressionFlowState.BindToken: {
|
||||
if (node.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
maybeBindExpressionFlowIfCall(node.left);
|
||||
}
|
||||
advanceState(BindBinaryExpressionFlowState.BindRight);
|
||||
maybeBind(node.operatorToken);
|
||||
break;
|
||||
@@ -1558,7 +1617,7 @@ namespace ts {
|
||||
* If `node` is a BinaryExpression, adds it to the local work stack, otherwise recursively binds it
|
||||
*/
|
||||
function maybeBind(node: Node) {
|
||||
if (node && isBinaryExpression(node)) {
|
||||
if (node && isBinaryExpression(node) && !isDestructuringAssignment(node)) {
|
||||
stackIndex++;
|
||||
workStacks.expr[stackIndex] = node;
|
||||
workStacks.state[stackIndex] = BindBinaryExpressionFlowState.BindThenBindChildren;
|
||||
@@ -1613,6 +1672,25 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function bindBindingElementFlow(node: BindingElement) {
|
||||
if (isBindingPattern(node.name)) {
|
||||
// When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per:
|
||||
// - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization
|
||||
// - `BindingElement: BindingPattern Initializer?`
|
||||
// - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization
|
||||
// - `BindingElement: BindingPattern Initializer?`
|
||||
bindEach(node.decorators);
|
||||
bindEach(node.modifiers);
|
||||
bind(node.dotDotDotToken);
|
||||
bind(node.propertyName);
|
||||
bind(node.initializer);
|
||||
bind(node.name);
|
||||
}
|
||||
else {
|
||||
bindEachChild(node);
|
||||
}
|
||||
}
|
||||
|
||||
function bindJSDocTypeAlias(node: JSDocTypedefTag | JSDocCallbackTag | JSDocEnumTag) {
|
||||
setParent(node.tagName, node);
|
||||
if (node.kind !== SyntaxKind.JSDocEnumTag && node.fullName) {
|
||||
@@ -2828,6 +2906,11 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isObjectLiteralExpression(assignedExpression) && every(assignedExpression.properties, isShorthandPropertyAssignment)) {
|
||||
forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias);
|
||||
return;
|
||||
}
|
||||
|
||||
// 'module.exports = expr' assignment
|
||||
const flags = exportAssignmentIsAlias(node)
|
||||
? SymbolFlags.Alias // An export= with an EntityNameExpression or a ClassExpression exports all meanings of that identifier or class
|
||||
@@ -2836,6 +2919,10 @@ namespace ts {
|
||||
setValueDeclaration(symbol, node);
|
||||
}
|
||||
|
||||
function bindExportAssignedObjectMemberAlias(node: ShorthandPropertyAssignment) {
|
||||
declareSymbol(file.symbol.exports!, file.symbol, node, SymbolFlags.Alias | SymbolFlags.Assignment, SymbolFlags.None);
|
||||
}
|
||||
|
||||
function bindThisPropertyAssignment(node: BindablePropertyAssignmentExpression | PropertyAccessExpression | LiteralLikeElementAccessExpression) {
|
||||
Debug.assert(isInJSFile(node));
|
||||
// private identifiers *must* be declared (even in JS files)
|
||||
|
||||
+57
-30
@@ -274,7 +274,7 @@ namespace ts {
|
||||
result.relatedInformation = relatedInformation ?
|
||||
relatedInformation.length ?
|
||||
relatedInformation.map(r => convertToDiagnosticRelatedInformation(r, newProgram, toPath)) :
|
||||
emptyArray :
|
||||
[] :
|
||||
undefined;
|
||||
return result;
|
||||
});
|
||||
@@ -493,10 +493,10 @@ namespace ts {
|
||||
return !state.semanticDiagnosticsFromOldState.size;
|
||||
}
|
||||
|
||||
function isChangedSignagure(state: BuilderProgramState, path: Path) {
|
||||
function isChangedSignature(state: BuilderProgramState, path: Path) {
|
||||
const newSignature = Debug.checkDefined(state.currentAffectedFilesSignatures).get(path);
|
||||
const oldSignagure = Debug.checkDefined(state.fileInfos.get(path)).signature;
|
||||
return newSignature !== oldSignagure;
|
||||
const oldSignature = Debug.checkDefined(state.fileInfos.get(path)).signature;
|
||||
return newSignature !== oldSignature;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -509,7 +509,7 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isChangedSignagure(state, affectedFile.resolvedPath)) return;
|
||||
if (!isChangedSignature(state, affectedFile.resolvedPath)) return;
|
||||
|
||||
// Since isolated modules dont change js files, files affected by change in signature is itself
|
||||
// But we need to cleanup semantic diagnostics and queue dts emit for affected files
|
||||
@@ -522,7 +522,7 @@ namespace ts {
|
||||
if (!seenFileNamesMap.has(currentPath)) {
|
||||
seenFileNamesMap.set(currentPath, true);
|
||||
const result = fn(state, currentPath);
|
||||
if (result && isChangedSignagure(state, currentPath)) {
|
||||
if (result && isChangedSignature(state, currentPath)) {
|
||||
const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath)!;
|
||||
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
||||
}
|
||||
@@ -824,7 +824,7 @@ namespace ts {
|
||||
result.relatedInformation = relatedInformation ?
|
||||
relatedInformation.length ?
|
||||
relatedInformation.map(r => convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo)) :
|
||||
emptyArray :
|
||||
[] :
|
||||
undefined;
|
||||
return result;
|
||||
});
|
||||
@@ -900,7 +900,7 @@ namespace ts {
|
||||
/**
|
||||
* Computing hash to for signature verification
|
||||
*/
|
||||
const computeHash = host.createHash || generateDjb2Hash;
|
||||
const computeHash = maybeBind(host, host.createHash);
|
||||
let state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState);
|
||||
let backupState: BuilderProgramState | undefined;
|
||||
newProgram.getProgramBuildInfo = () => getProgramBuildInfo(state, getCanonicalFileName);
|
||||
@@ -1019,31 +1019,57 @@ namespace ts {
|
||||
* in that order would be used to write the files
|
||||
*/
|
||||
function emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult {
|
||||
let restorePendingEmitOnHandlingNoEmitSuccess = false;
|
||||
let savedAffectedFilesPendingEmit;
|
||||
let savedAffectedFilesPendingEmitKind;
|
||||
let savedAffectedFilesPendingEmitIndex;
|
||||
// Backup and restore affected pendings emit state for non emit Builder if noEmitOnError is enabled and emitBuildInfo could be written in case there are errors
|
||||
// This ensures pending files to emit is updated in tsbuildinfo
|
||||
// Note that when there are no errors, emit proceeds as if everything is emitted as it is callers reponsibility to write the files to disk if at all (because its builder that doesnt track files to emit)
|
||||
if (kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram &&
|
||||
!targetSourceFile &&
|
||||
!outFile(state.compilerOptions) &&
|
||||
!state.compilerOptions.noEmit &&
|
||||
state.compilerOptions.noEmitOnError) {
|
||||
restorePendingEmitOnHandlingNoEmitSuccess = true;
|
||||
savedAffectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
|
||||
savedAffectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new Map(state.affectedFilesPendingEmitKind);
|
||||
savedAffectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
|
||||
}
|
||||
|
||||
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
|
||||
assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
|
||||
const result = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
|
||||
if (result) return result;
|
||||
if (!targetSourceFile) {
|
||||
// Emit and report any errors we ran into.
|
||||
let sourceMaps: SourceMapEmitResult[] = [];
|
||||
let emitSkipped = false;
|
||||
let diagnostics: Diagnostic[] | undefined;
|
||||
let emittedFiles: string[] = [];
|
||||
}
|
||||
const result = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile, cancellationToken);
|
||||
if (result) return result;
|
||||
|
||||
let affectedEmitResult: AffectedFileResult<EmitResult>;
|
||||
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
|
||||
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
||||
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
||||
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
||||
sourceMaps = addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
|
||||
}
|
||||
return {
|
||||
emitSkipped,
|
||||
diagnostics: diagnostics || emptyArray,
|
||||
emittedFiles,
|
||||
sourceMaps
|
||||
};
|
||||
if (restorePendingEmitOnHandlingNoEmitSuccess) {
|
||||
state.affectedFilesPendingEmit = savedAffectedFilesPendingEmit;
|
||||
state.affectedFilesPendingEmitKind = savedAffectedFilesPendingEmitKind;
|
||||
state.affectedFilesPendingEmitIndex = savedAffectedFilesPendingEmitIndex;
|
||||
}
|
||||
|
||||
// Emit only affected files if using builder for emit
|
||||
if (!targetSourceFile && kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
|
||||
// Emit and report any errors we ran into.
|
||||
let sourceMaps: SourceMapEmitResult[] = [];
|
||||
let emitSkipped = false;
|
||||
let diagnostics: Diagnostic[] | undefined;
|
||||
let emittedFiles: string[] = [];
|
||||
|
||||
let affectedEmitResult: AffectedFileResult<EmitResult>;
|
||||
while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
|
||||
emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
|
||||
diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
|
||||
emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
|
||||
sourceMaps = addRange(sourceMaps, affectedEmitResult.result.sourceMaps);
|
||||
}
|
||||
return {
|
||||
emitSkipped,
|
||||
diagnostics: diagnostics || emptyArray,
|
||||
emittedFiles,
|
||||
sourceMaps
|
||||
};
|
||||
}
|
||||
return Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
|
||||
}
|
||||
@@ -1069,7 +1095,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
// Add file to affected file pending emit to handle for later emit time
|
||||
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) {
|
||||
// Apart for emit builder do this for tsbuildinfo, do this for non emit builder when noEmit is set as tsbuildinfo is written and reused between emitters
|
||||
if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) {
|
||||
addToAffectedFilesPendingEmit(state, (affected as SourceFile).resolvedPath, BuilderFileEmit.Full);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace ts {
|
||||
/**
|
||||
* Compute the hash to store the shape of the file
|
||||
*/
|
||||
export type ComputeHash = (data: string) => string;
|
||||
export type ComputeHash = ((data: string) => string) | undefined;
|
||||
|
||||
/**
|
||||
* Exported modules to from declaration emit being computed.
|
||||
@@ -337,7 +337,7 @@ namespace ts {
|
||||
emitOutput.outputFiles.length > 0 ? emitOutput.outputFiles[0] : undefined;
|
||||
if (firstDts) {
|
||||
Debug.assert(fileExtensionIs(firstDts.name, Extension.Dts), "File extension for signature expected to be dts", () => `Found: ${getAnyExtensionFromPath(firstDts.name)} for ${firstDts.name}:: All output files: ${JSON.stringify(emitOutput.outputFiles.map(f => f.name))}`);
|
||||
latestSignature = computeHash(firstDts.text);
|
||||
latestSignature = (computeHash || generateDjb2Hash)(firstDts.text);
|
||||
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
||||
updateExportedModules(sourceFile, emitOutput.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
||||
}
|
||||
@@ -521,7 +521,7 @@ namespace ts {
|
||||
/**
|
||||
* When program emits modular code, gets the files affected by the sourceFile whose shape has changed
|
||||
*/
|
||||
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state: BuilderState, programOfThisState: Program, sourceFileWithUpdatedShape: SourceFile, cacheToUpdateSignature: ESMap<Path, string>, cancellationToken: CancellationToken | undefined, computeHash: ComputeHash | undefined, exportedModulesMapCache: ComputingExportedModulesMap | undefined) {
|
||||
function getFilesAffectedByUpdatedShapeWhenModuleEmit(state: BuilderState, programOfThisState: Program, sourceFileWithUpdatedShape: SourceFile, cacheToUpdateSignature: ESMap<Path, string>, cancellationToken: CancellationToken | undefined, computeHash: ComputeHash, exportedModulesMapCache: ComputingExportedModulesMap | undefined) {
|
||||
if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) {
|
||||
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
|
||||
}
|
||||
@@ -544,13 +544,12 @@ namespace ts {
|
||||
if (!seenFileNamesMap.has(currentPath)) {
|
||||
const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath)!;
|
||||
seenFileNamesMap.set(currentPath, currentSourceFile);
|
||||
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash!, exportedModulesMapCache)) { // TODO: GH#18217
|
||||
if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash, exportedModulesMapCache)) {
|
||||
queue.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return array of values that needs emit
|
||||
// Return array of values that needs emit
|
||||
return arrayFrom(mapDefinedIterator(seenFileNamesMap.values(), value => value));
|
||||
}
|
||||
|
||||
+799
-308
File diff suppressed because it is too large
Load Diff
@@ -73,7 +73,8 @@ namespace ts {
|
||||
["esnext.intl", "lib.esnext.intl.d.ts"],
|
||||
["esnext.bigint", "lib.es2020.bigint.d.ts"],
|
||||
["esnext.string", "lib.esnext.string.d.ts"],
|
||||
["esnext.promise", "lib.esnext.promise.d.ts"]
|
||||
["esnext.promise", "lib.esnext.promise.d.ts"],
|
||||
["esnext.weakref", "lib.esnext.weakref.d.ts"]
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -380,6 +381,8 @@ namespace ts {
|
||||
name: "jsx",
|
||||
type: jsxOptionMap,
|
||||
affectsSourceFile: true,
|
||||
affectsEmit: true,
|
||||
affectsModuleResolution: true,
|
||||
paramType: Diagnostics.KIND,
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Basic_Options,
|
||||
@@ -800,6 +803,9 @@ namespace ts {
|
||||
{
|
||||
name: "jsxImportSource",
|
||||
type: "string",
|
||||
affectsSemanticDiagnostics: true,
|
||||
affectsEmit: true,
|
||||
affectsModuleResolution: true,
|
||||
category: Diagnostics.Advanced_Options,
|
||||
description: Diagnostics.Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react
|
||||
},
|
||||
@@ -1132,7 +1138,11 @@ namespace ts {
|
||||
name: "exclude",
|
||||
type: "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "disableFilenameBasedTypeAcquisition",
|
||||
type: "boolean",
|
||||
},
|
||||
];
|
||||
|
||||
/* @internal */
|
||||
@@ -1572,7 +1582,7 @@ namespace ts {
|
||||
*/
|
||||
export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile {
|
||||
const textOrDiagnostic = tryReadFile(fileName, readFile);
|
||||
return isString(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : <TsConfigSourceFile>{ parseDiagnostics: [textOrDiagnostic] };
|
||||
return isString(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : <TsConfigSourceFile>{ fileName, parseDiagnostics: [textOrDiagnostic] };
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
|
||||
@@ -1195,7 +1195,7 @@ namespace ts {
|
||||
* @param keyComparer A callback used to compare two keys in a sorted array.
|
||||
* @param offset An offset into `array` at which to start the search.
|
||||
*/
|
||||
export function binarySearchKey<T, U>(array: readonly T[], key: U, keySelector: (v: T) => U, keyComparer: Comparer<U>, offset?: number): number {
|
||||
export function binarySearchKey<T, U>(array: readonly T[], key: U, keySelector: (v: T, i: number) => U, keyComparer: Comparer<U>, offset?: number): number {
|
||||
if (!some(array)) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1204,7 +1204,7 @@ namespace ts {
|
||||
let high = array.length - 1;
|
||||
while (low <= high) {
|
||||
const middle = low + ((high - low) >> 1);
|
||||
const midKey = keySelector(array[middle]);
|
||||
const midKey = keySelector(array[middle], middle);
|
||||
switch (keyComparer(midKey, key)) {
|
||||
case Comparison.LessThan:
|
||||
low = middle + 1;
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"category": "Error",
|
||||
"code": 1030
|
||||
},
|
||||
"'{0}' modifier cannot appear on a class element.": {
|
||||
"'{0}' modifier cannot appear on class elements of this kind.": {
|
||||
"category": "Error",
|
||||
"code": 1031
|
||||
},
|
||||
@@ -851,10 +851,6 @@
|
||||
"category": "Error",
|
||||
"code": 1257
|
||||
},
|
||||
"Definite assignment assertions can only be used along with a type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 1258
|
||||
},
|
||||
"Module '{0}' can only be default-imported using the '{1}' flag": {
|
||||
"category": "Error",
|
||||
"code": 1259
|
||||
@@ -871,6 +867,14 @@
|
||||
"category": "Error",
|
||||
"code": 1262
|
||||
},
|
||||
"Declarations with initializers cannot also have definite assignment assertions.": {
|
||||
"category": "Error",
|
||||
"code": 1263
|
||||
},
|
||||
"Declarations with definite assignment assertions must also have type annotations.": {
|
||||
"category": "Error",
|
||||
"code": 1264
|
||||
},
|
||||
|
||||
"'with' statements are not allowed in an async function block.": {
|
||||
"category": "Error",
|
||||
@@ -1000,7 +1004,7 @@
|
||||
"category": "Error",
|
||||
"code": 1342
|
||||
},
|
||||
"The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'.": {
|
||||
"The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.": {
|
||||
"category": "Error",
|
||||
"code": 1343
|
||||
},
|
||||
@@ -2193,6 +2197,10 @@
|
||||
"category": "Error",
|
||||
"code": 2549
|
||||
},
|
||||
"Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.": {
|
||||
"category": "Error",
|
||||
"code": 2550
|
||||
},
|
||||
"Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?": {
|
||||
"category": "Error",
|
||||
"code": 2551
|
||||
@@ -2297,19 +2305,19 @@
|
||||
"category": "Error",
|
||||
"code": 2578
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.": {
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.": {
|
||||
"category": "Error",
|
||||
"code": 2580
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.": {
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.": {
|
||||
"category": "Error",
|
||||
"code": 2581
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.": {
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.": {
|
||||
"category": "Error",
|
||||
"code": 2582
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.": {
|
||||
"Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.": {
|
||||
"category": "Error",
|
||||
"code": 2583
|
||||
},
|
||||
@@ -2341,15 +2349,15 @@
|
||||
"category": "Error",
|
||||
"code": 2590
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.": {
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.": {
|
||||
"category": "Error",
|
||||
"code": 2591
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.": {
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.": {
|
||||
"category": "Error",
|
||||
"code": 2592
|
||||
},
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.": {
|
||||
"Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.": {
|
||||
"category": "Error",
|
||||
"code": 2593
|
||||
},
|
||||
@@ -3035,7 +3043,7 @@
|
||||
"category": "Error",
|
||||
"code": 2792
|
||||
},
|
||||
"Template literal type argument '{0}' is not literal type or a generic type.": {
|
||||
"The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.": {
|
||||
"category": "Error",
|
||||
"code": 2793
|
||||
},
|
||||
@@ -3043,6 +3051,14 @@
|
||||
"category": "Error",
|
||||
"code": 2794
|
||||
},
|
||||
"The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.": {
|
||||
"category": "Error",
|
||||
"code": 2795
|
||||
},
|
||||
"It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.": {
|
||||
"category": "Error",
|
||||
"code": 2796
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
@@ -4703,6 +4719,10 @@
|
||||
"code": 6385,
|
||||
"reportsDeprecated": true
|
||||
},
|
||||
"Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.": {
|
||||
"category": "Message",
|
||||
"code": 6386
|
||||
},
|
||||
|
||||
"The expected type comes from property '{0}' which is declared here on type '{1}'": {
|
||||
"category": "Message",
|
||||
@@ -4840,7 +4860,7 @@
|
||||
"category": "Error",
|
||||
"code": 7034
|
||||
},
|
||||
"Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`": {
|
||||
"Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`": {
|
||||
"category": "Error",
|
||||
"code": 7035
|
||||
},
|
||||
|
||||
+27
-24
@@ -300,17 +300,17 @@ namespace ts {
|
||||
sourceFiles: sourceFileOrBundle.sourceFiles.map(file => relativeToBuildInfo(getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())))
|
||||
};
|
||||
}
|
||||
tracing.begin(tracing.Phase.Emit, "emitJsFileOrBundle", { jsFilePath });
|
||||
tracing.push(tracing.Phase.Emit, "emitJsFileOrBundle", { jsFilePath });
|
||||
emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo);
|
||||
tracing.end();
|
||||
tracing.pop();
|
||||
|
||||
tracing.begin(tracing.Phase.Emit, "emitDeclarationFileOrBundle", { declarationFilePath });
|
||||
tracing.push(tracing.Phase.Emit, "emitDeclarationFileOrBundle", { declarationFilePath });
|
||||
emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo);
|
||||
tracing.end();
|
||||
tracing.pop();
|
||||
|
||||
tracing.begin(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath });
|
||||
tracing.push(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath });
|
||||
emitBuildInfo(bundleBuildInfo, buildInfoPath);
|
||||
tracing.end();
|
||||
tracing.pop();
|
||||
|
||||
if (!emitSkipped && emittedFilesList) {
|
||||
if (!emitOnlyDtsFiles) {
|
||||
@@ -606,18 +606,19 @@ namespace ts {
|
||||
if (getRootLength(sourceMapDir) === 0) {
|
||||
// The relative paths are relative to the common directory
|
||||
sourceMapDir = combinePaths(host.getCommonSourceDirectory(), sourceMapDir);
|
||||
return getRelativePathToDirectoryOrUrl(
|
||||
getDirectoryPath(normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath
|
||||
combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap
|
||||
host.getCurrentDirectory(),
|
||||
host.getCanonicalFileName,
|
||||
/*isAbsolutePathAnUrl*/ true);
|
||||
return encodeURI(
|
||||
getRelativePathToDirectoryOrUrl(
|
||||
getDirectoryPath(normalizePath(filePath)), // get the relative sourceMapDir path based on jsFilePath
|
||||
combinePaths(sourceMapDir, sourceMapFile), // this is where user expects to see sourceMap
|
||||
host.getCurrentDirectory(),
|
||||
host.getCanonicalFileName,
|
||||
/*isAbsolutePathAnUrl*/ true));
|
||||
}
|
||||
else {
|
||||
return combinePaths(sourceMapDir, sourceMapFile);
|
||||
return encodeURI(combinePaths(sourceMapDir, sourceMapFile));
|
||||
}
|
||||
}
|
||||
return sourceMapFile;
|
||||
return encodeURI(sourceMapFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2023,15 +2024,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
function emitTemplateTypeSpan(node: TemplateLiteralTypeSpan) {
|
||||
const keyword = node.casing === TemplateCasing.Uppercase ? "uppercase" :
|
||||
node.casing === TemplateCasing.Lowercase ? "lowercase" :
|
||||
node.casing === TemplateCasing.Capitalize ? "capitalize" :
|
||||
node.casing === TemplateCasing.Uncapitalize ? "uncapitalize" :
|
||||
undefined;
|
||||
if (keyword) {
|
||||
writeKeyword(keyword);
|
||||
writeSpace();
|
||||
}
|
||||
emit(node.type);
|
||||
emit(node.literal);
|
||||
}
|
||||
@@ -5144,7 +5136,12 @@ namespace ts {
|
||||
hasWrittenComment = false;
|
||||
|
||||
if (isEmittedNode) {
|
||||
forEachLeadingCommentToEmit(pos, emitLeadingComment);
|
||||
if (pos === 0 && currentSourceFile?.isDeclarationFile) {
|
||||
forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment);
|
||||
}
|
||||
else {
|
||||
forEachLeadingCommentToEmit(pos, emitLeadingComment);
|
||||
}
|
||||
}
|
||||
else if (pos === 0) {
|
||||
// If the node will not be emitted in JS, remove all the comments(normal, pinned and ///) associated with the node,
|
||||
@@ -5165,6 +5162,12 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitNonTripleSlashLeadingComment(commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) {
|
||||
if (!isTripleSlashComment(commentPos, commentEnd)) {
|
||||
emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos);
|
||||
}
|
||||
}
|
||||
|
||||
function shouldWriteComment(text: string, pos: number) {
|
||||
if (printerOptions.onlyPrintJsDocStyle) {
|
||||
return (isJSDocLikeText(text, pos) || isPinnedComment(text, pos));
|
||||
|
||||
@@ -1605,9 +1605,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
// @api
|
||||
function createTemplateLiteralTypeSpan(casing: TemplateCasing, type: TypeNode, literal: TemplateMiddle | TemplateTail) {
|
||||
function createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail) {
|
||||
const node = createBaseNode<TemplateLiteralTypeSpan>(SyntaxKind.TemplateLiteralTypeSpan);
|
||||
node.casing = casing;
|
||||
node.type = type;
|
||||
node.literal = literal;
|
||||
node.transformFlags = TransformFlags.ContainsTypeScript;
|
||||
@@ -1615,11 +1614,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
// @api
|
||||
function updateTemplateLiteralTypeSpan(casing: TemplateCasing, node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail) {
|
||||
return node.casing !== casing
|
||||
|| node.type !== type
|
||||
function updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail) {
|
||||
return node.type !== type
|
||||
|| node.literal !== literal
|
||||
? update(createTemplateLiteralTypeSpan(casing, type, literal), node)
|
||||
? update(createTemplateLiteralTypeSpan(type, literal), node)
|
||||
: node;
|
||||
}
|
||||
|
||||
@@ -2665,12 +2663,14 @@ namespace ts {
|
||||
node.transformFlags |=
|
||||
TransformFlags.ContainsES2015 |
|
||||
TransformFlags.ContainsES2018 |
|
||||
TransformFlags.ContainsDestructuringAssignment;
|
||||
TransformFlags.ContainsDestructuringAssignment |
|
||||
propagateAssignmentPatternFlags(node.left);
|
||||
}
|
||||
else if (isArrayLiteralExpression(node.left)) {
|
||||
node.transformFlags |=
|
||||
TransformFlags.ContainsES2015 |
|
||||
TransformFlags.ContainsDestructuringAssignment;
|
||||
TransformFlags.ContainsDestructuringAssignment |
|
||||
propagateAssignmentPatternFlags(node.left);
|
||||
}
|
||||
}
|
||||
else if (operatorKind === SyntaxKind.AsteriskAsteriskToken || operatorKind === SyntaxKind.AsteriskAsteriskEqualsToken) {
|
||||
@@ -2682,6 +2682,27 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
function propagateAssignmentPatternFlags(node: AssignmentPattern): TransformFlags {
|
||||
if (node.transformFlags & TransformFlags.ContainsObjectRestOrSpread) return TransformFlags.ContainsObjectRestOrSpread;
|
||||
if (node.transformFlags & TransformFlags.ContainsES2018) {
|
||||
// check for nested spread assignments, otherwise '{ x: { a, ...b } = foo } = c'
|
||||
// will not be correctly interpreted by the ES2018 transformer
|
||||
for (const element of getElementsOfBindingOrAssignmentPattern(node)) {
|
||||
const target = getTargetOfBindingOrAssignmentElement(element);
|
||||
if (target && isAssignmentPattern(target)) {
|
||||
if (target.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
|
||||
return TransformFlags.ContainsObjectRestOrSpread;
|
||||
}
|
||||
if (target.transformFlags & TransformFlags.ContainsES2018) {
|
||||
const flags = propagateAssignmentPatternFlags(target);
|
||||
if (flags) return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TransformFlags.None;
|
||||
}
|
||||
|
||||
// @api
|
||||
function updateBinaryExpression(node: BinaryExpression, left: Expression, operator: BinaryOperatorToken, right: Expression) {
|
||||
return node.left !== left
|
||||
|
||||
@@ -233,6 +233,14 @@ namespace ts {
|
||||
return node.kind === SyntaxKind.ImportType;
|
||||
}
|
||||
|
||||
export function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan {
|
||||
return node.kind === SyntaxKind.TemplateLiteralTypeSpan;
|
||||
}
|
||||
|
||||
export function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode {
|
||||
return node.kind === SyntaxKind.TemplateLiteralType;
|
||||
}
|
||||
|
||||
// Binding patterns
|
||||
|
||||
export function isObjectBindingPattern(node: Node): node is ObjectBindingPattern {
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function createJsxFactoryExpression(factory: NodeFactory, jsxFactoryEntity: EntityName | undefined, reactNamespace: string, parent: JsxOpeningLikeElement | JsxOpeningFragment): Expression {
|
||||
export function createJsxFactoryExpression(factory: NodeFactory, jsxFactoryEntity: EntityName | undefined, reactNamespace: string, parent: JsxOpeningLikeElement | JsxOpeningFragment): Expression {
|
||||
return jsxFactoryEntity ?
|
||||
createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent) :
|
||||
factory.createPropertyAccessExpression(
|
||||
@@ -64,7 +64,7 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
export function createExpressionForJsxElement(factory: NodeFactory, jsxFactoryEntity: EntityName | undefined, reactNamespace: string, tagName: Expression, props: Expression | undefined, children: readonly Expression[] | undefined, parentElement: JsxOpeningLikeElement, location: TextRange): LeftHandSideExpression {
|
||||
export function createExpressionForJsxElement(factory: NodeFactory, callee: Expression, tagName: Expression, props: Expression | undefined, children: readonly Expression[] | undefined, location: TextRange): LeftHandSideExpression {
|
||||
const argumentsList = [tagName];
|
||||
if (props) {
|
||||
argumentsList.push(props);
|
||||
@@ -88,7 +88,7 @@ namespace ts {
|
||||
|
||||
return setTextRange(
|
||||
factory.createCallExpression(
|
||||
createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement),
|
||||
callee,
|
||||
/*typeArguments*/ undefined,
|
||||
argumentsList
|
||||
),
|
||||
|
||||
@@ -174,7 +174,10 @@ namespace ts.moduleSpecifiers {
|
||||
const bundledPkgReference = bundledPackageName ? combinePaths(bundledPackageName, relativeToBaseUrl) : relativeToBaseUrl;
|
||||
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(bundledPkgReference, ending, compilerOptions);
|
||||
const fromPaths = paths && tryGetModuleNameFromPaths(removeFileExtension(bundledPkgReference), importRelativeToBaseUrl, paths);
|
||||
const nonRelative = fromPaths === undefined ? importRelativeToBaseUrl : fromPaths;
|
||||
const nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
|
||||
if (!nonRelative) {
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
if (relativePreference === RelativePreference.NonRelative) {
|
||||
return nonRelative;
|
||||
@@ -232,7 +235,7 @@ namespace ts.moduleSpecifiers {
|
||||
: discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd);
|
||||
|
||||
const symlinkedDirectories = links.getSymlinkedDirectories();
|
||||
const compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? compareStringsCaseSensitive : compareStringsCaseInsensitive;
|
||||
const useCaseSensitiveFileNames = !host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames();
|
||||
const result = symlinkedDirectories && forEachEntry(symlinkedDirectories, (resolved, path) => {
|
||||
if (resolved === false) return undefined;
|
||||
if (startsWithDirectory(importingFileName, resolved.realPath, getCanonicalFileName)) {
|
||||
@@ -240,7 +243,7 @@ namespace ts.moduleSpecifiers {
|
||||
}
|
||||
|
||||
return forEach(targets, target => {
|
||||
if (compareStrings(target.slice(0, resolved.real.length), resolved.real) !== Comparison.EqualTo) {
|
||||
if (!containsPath(resolved.real, target, !useCaseSensitiveFileNames)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+4
-12
@@ -614,7 +614,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes = false, scriptKind?: ScriptKind): SourceFile {
|
||||
tracing.begin(tracing.Phase.Parse, "createSourceFile", { path: fileName });
|
||||
const tracingData: tracing.EventData = [tracing.Phase.Parse, "createSourceFile", { path: fileName }];
|
||||
tracing.begin(...tracingData);
|
||||
performance.mark("beforeParse");
|
||||
let result: SourceFile;
|
||||
|
||||
@@ -629,7 +630,7 @@ namespace ts {
|
||||
|
||||
performance.mark("afterParse");
|
||||
performance.measure("Parse", "beforeParse", "afterParse");
|
||||
tracing.end();
|
||||
tracing.end(...tracingData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2618,7 +2619,6 @@ namespace ts {
|
||||
const pos = getNodePos();
|
||||
return finishNode(
|
||||
factory.createTemplateLiteralTypeSpan(
|
||||
parseTemplateCasing(),
|
||||
parseType(),
|
||||
parseLiteralOfTemplateSpan(/*isTaggedTemplate*/ false)
|
||||
),
|
||||
@@ -2626,14 +2626,6 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
function parseTemplateCasing(): TemplateCasing {
|
||||
return parseOptional(SyntaxKind.UppercaseKeyword) ? TemplateCasing.Uppercase :
|
||||
parseOptional(SyntaxKind.LowercaseKeyword) ? TemplateCasing.Lowercase :
|
||||
parseOptional(SyntaxKind.CapitalizeKeyword) ? TemplateCasing.Capitalize :
|
||||
parseOptional(SyntaxKind.UncapitalizeKeyword) ? TemplateCasing.Uncapitalize :
|
||||
TemplateCasing.None;
|
||||
}
|
||||
|
||||
function parseLiteralOfTemplateSpan(isTaggedTemplate: boolean) {
|
||||
if (token() === SyntaxKind.CloseBraceToken) {
|
||||
reScanTemplateToken(isTaggedTemplate);
|
||||
@@ -6751,7 +6743,7 @@ namespace ts {
|
||||
const name = parseIdentifier();
|
||||
const typeParameters = parseTypeParameters();
|
||||
parseExpected(SyntaxKind.EqualsToken);
|
||||
const type = parseType();
|
||||
const type = token() === SyntaxKind.IntrinsicKeyword && tryParse(parseKeywordAndNoDot) || parseType();
|
||||
parseSemicolon();
|
||||
const node = factory.createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type);
|
||||
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
||||
|
||||
+40
-31
@@ -1,16 +1,11 @@
|
||||
/*@internal*/
|
||||
/** Performance measurements for the compiler. */
|
||||
namespace ts.performance {
|
||||
declare const onProfilerEvent: { (markName: string): void; profiler: boolean; };
|
||||
|
||||
// NOTE: cannot use ts.noop as core.ts loads after this
|
||||
const profilerEvent: (markName: string) => void = typeof onProfilerEvent === "function" && onProfilerEvent.profiler === true ? onProfilerEvent : () => { /*empty*/ };
|
||||
|
||||
let enabled = false;
|
||||
let profilerStart = 0;
|
||||
let counts: ESMap<string, number>;
|
||||
let marks: ESMap<string, number>;
|
||||
let measures: ESMap<string, number>;
|
||||
let perfHooks: PerformanceHooks | undefined;
|
||||
let perfObserver: PerformanceObserver | undefined;
|
||||
// when set, indicates the implementation of `Performance` to use for user timing.
|
||||
// when unset, indicates user timing is unavailable or disabled.
|
||||
let performanceImpl: Performance | undefined;
|
||||
|
||||
export interface Timer {
|
||||
enter(): void;
|
||||
@@ -46,6 +41,8 @@ namespace ts.performance {
|
||||
}
|
||||
|
||||
export const nullTimer: Timer = { enter: noop, exit: noop };
|
||||
const counts = new Map<string, number>();
|
||||
const durations = new Map<string, number>();
|
||||
|
||||
/**
|
||||
* Marks a performance event.
|
||||
@@ -53,11 +50,7 @@ namespace ts.performance {
|
||||
* @param markName The name of the mark.
|
||||
*/
|
||||
export function mark(markName: string) {
|
||||
if (enabled) {
|
||||
marks.set(markName, timestamp());
|
||||
counts.set(markName, (counts.get(markName) || 0) + 1);
|
||||
profilerEvent(markName);
|
||||
}
|
||||
performanceImpl?.mark(markName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,11 +63,7 @@ namespace ts.performance {
|
||||
* used.
|
||||
*/
|
||||
export function measure(measureName: string, startMarkName?: string, endMarkName?: string) {
|
||||
if (enabled) {
|
||||
const end = endMarkName && marks.get(endMarkName) || timestamp();
|
||||
const start = startMarkName && marks.get(startMarkName) || profilerStart;
|
||||
measures.set(measureName, (measures.get(measureName) || 0) + (end - start));
|
||||
}
|
||||
performanceImpl?.measure(measureName, startMarkName, endMarkName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +72,7 @@ namespace ts.performance {
|
||||
* @param markName The name of the mark.
|
||||
*/
|
||||
export function getCount(markName: string) {
|
||||
return counts && counts.get(markName) || 0;
|
||||
return counts.get(markName) || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +81,7 @@ namespace ts.performance {
|
||||
* @param measureName The name of the measure whose durations should be accumulated.
|
||||
*/
|
||||
export function getDuration(measureName: string) {
|
||||
return measures && measures.get(measureName) || 0;
|
||||
return durations.get(measureName) || 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,22 +90,42 @@ namespace ts.performance {
|
||||
* @param cb The action to perform for each measure
|
||||
*/
|
||||
export function forEachMeasure(cb: (measureName: string, duration: number) => void) {
|
||||
measures.forEach((measure, key) => {
|
||||
cb(key, measure);
|
||||
});
|
||||
durations.forEach((duration, measureName) => cb(measureName, duration));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the performance API is enabled.
|
||||
*/
|
||||
export function isEnabled() {
|
||||
return !!performanceImpl;
|
||||
}
|
||||
|
||||
/** Enables (and resets) performance measurements for the compiler. */
|
||||
export function enable() {
|
||||
counts = new Map<string, number>();
|
||||
marks = new Map<string, number>();
|
||||
measures = new Map<string, number>();
|
||||
enabled = true;
|
||||
profilerStart = timestamp();
|
||||
if (!performanceImpl) {
|
||||
perfHooks ||= tryGetNativePerformanceHooks();
|
||||
if (!perfHooks) return false;
|
||||
perfObserver ||= new perfHooks.PerformanceObserver(updateStatisticsFromList);
|
||||
perfObserver.observe({ entryTypes: ["mark", "measure"] });
|
||||
performanceImpl = perfHooks.performance;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Disables performance measurements for the compiler. */
|
||||
export function disable() {
|
||||
enabled = false;
|
||||
perfObserver?.disconnect();
|
||||
performanceImpl = undefined;
|
||||
counts.clear();
|
||||
durations.clear();
|
||||
}
|
||||
|
||||
function updateStatisticsFromList(list: PerformanceObserverEntryList) {
|
||||
for (const mark of list.getEntriesByType("mark")) {
|
||||
counts.set(mark.name, (counts.get(mark.name) || 0) + 1);
|
||||
}
|
||||
for (const measure of list.getEntriesByType("measure")) {
|
||||
durations.set(measure.name, (durations.get(measure.name) || 0) + measure.duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/*@internal*/
|
||||
namespace ts {
|
||||
// The following definitions provide the minimum compatible support for the Web Performance User Timings API
|
||||
// between browsers and NodeJS:
|
||||
|
||||
export interface PerformanceHooks {
|
||||
performance: Performance;
|
||||
PerformanceObserver: PerformanceObserverConstructor;
|
||||
}
|
||||
|
||||
export interface Performance {
|
||||
mark(name: string): void;
|
||||
measure(name: string, startMark?: string, endMark?: string): void;
|
||||
now(): number;
|
||||
timeOrigin: number;
|
||||
}
|
||||
|
||||
export interface PerformanceEntry {
|
||||
name: string;
|
||||
entryType: string;
|
||||
startTime: number;
|
||||
duration: number;
|
||||
}
|
||||
|
||||
export interface PerformanceObserverEntryList {
|
||||
getEntries(): PerformanceEntryList;
|
||||
getEntriesByName(name: string, type?: string): PerformanceEntryList;
|
||||
getEntriesByType(type: string): PerformanceEntryList;
|
||||
}
|
||||
|
||||
export interface PerformanceObserver {
|
||||
disconnect(): void;
|
||||
observe(options: { entryTypes: readonly string[] }): void;
|
||||
}
|
||||
|
||||
export type PerformanceObserverConstructor = new (callback: (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void) => PerformanceObserver;
|
||||
export type PerformanceEntryList = PerformanceEntry[];
|
||||
|
||||
// Browser globals for the Web Performance User Timings API
|
||||
declare const performance: Performance | undefined;
|
||||
declare const PerformanceObserver: PerformanceObserverConstructor | undefined;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
function hasRequiredAPI(performance: Performance | undefined, PerformanceObserver: PerformanceObserverConstructor | undefined) {
|
||||
return typeof performance === "object" &&
|
||||
typeof performance.timeOrigin === "number" &&
|
||||
typeof performance.mark === "function" &&
|
||||
typeof performance.measure === "function" &&
|
||||
typeof performance.now === "function" &&
|
||||
typeof PerformanceObserver === "function";
|
||||
}
|
||||
|
||||
function tryGetWebPerformanceHooks(): PerformanceHooks | undefined {
|
||||
if (typeof performance === "object" &&
|
||||
typeof PerformanceObserver === "function" &&
|
||||
hasRequiredAPI(performance, PerformanceObserver)) {
|
||||
return {
|
||||
performance,
|
||||
PerformanceObserver
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function tryGetNodePerformanceHooks(): PerformanceHooks | undefined {
|
||||
if (typeof module === "object" && typeof require === "function") {
|
||||
try {
|
||||
const { performance, PerformanceObserver } = require("perf_hooks") as typeof import("perf_hooks");
|
||||
if (hasRequiredAPI(performance, PerformanceObserver)) {
|
||||
// There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not
|
||||
// match the Web Performance API specification. Node's implementation did not allow
|
||||
// optional `start` and `end` arguments for `performance.measure`.
|
||||
// See https://github.com/nodejs/node/pull/32651 for more information.
|
||||
const version = new Version(process.versions.node);
|
||||
const range = new VersionRange("<12.16.3 || 13 <13.13");
|
||||
if (range.test(version)) {
|
||||
return {
|
||||
performance: {
|
||||
get timeOrigin() { return performance.timeOrigin; },
|
||||
now() { return performance.now(); },
|
||||
mark(name) { return performance.mark(name); },
|
||||
measure(name, start = "nodeStart", end?) {
|
||||
if (end === undefined) {
|
||||
end = "__performance.measure-fix__";
|
||||
performance.mark(end);
|
||||
}
|
||||
performance.measure(name, start, end);
|
||||
if (end === "__performance.measure-fix__") {
|
||||
performance.clearMarks("__performance.measure-fix__");
|
||||
}
|
||||
}
|
||||
},
|
||||
PerformanceObserver
|
||||
};
|
||||
}
|
||||
return {
|
||||
performance,
|
||||
PerformanceObserver
|
||||
};
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// ignore errors
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Unlike with the native Map/Set 'tryGet' functions in corePublic.ts, we eagerly evaluate these
|
||||
// since we will need them for `timestamp`, below.
|
||||
const nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks();
|
||||
const nativePerformance = nativePerformanceHooks?.performance;
|
||||
|
||||
export function tryGetNativePerformanceHooks() {
|
||||
return nativePerformanceHooks;
|
||||
}
|
||||
|
||||
/** Gets a timestamp with (at least) ms resolution */
|
||||
export const timestamp =
|
||||
nativePerformance ? () => nativePerformance.now() :
|
||||
Date.now ? Date.now :
|
||||
() => +(new Date());
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/*@internal*/
|
||||
namespace ts {
|
||||
declare const performance: { now?(): number } | undefined;
|
||||
/** Gets a timestamp with (at least) ms resolution */
|
||||
export const timestamp = typeof performance !== "undefined" && performance.now ? () => performance.now!() : Date.now ? Date.now : () => +(new Date());
|
||||
}
|
||||
+235
-150
@@ -73,6 +73,7 @@ namespace ts {
|
||||
export function createCompilerHostWorker(options: CompilerOptions, setParentNodes?: boolean, system = sys): CompilerHost {
|
||||
const existingDirectories = new Map<string, boolean>();
|
||||
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
||||
const computeHash = maybeBind(system, system.createHash) || generateDjb2Hash;
|
||||
function getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile | undefined {
|
||||
let text: string | undefined;
|
||||
try {
|
||||
@@ -128,7 +129,7 @@ namespace ts {
|
||||
|
||||
let outputFingerprints: ESMap<string, OutputFingerprint>;
|
||||
function writeFileWorker(fileName: string, data: string, writeByteOrderMark: boolean) {
|
||||
if (!isWatchSet(options) || !system.createHash || !system.getModifiedTime) {
|
||||
if (!isWatchSet(options) || !system.getModifiedTime) {
|
||||
system.writeFile(fileName, data, writeByteOrderMark);
|
||||
return;
|
||||
}
|
||||
@@ -137,7 +138,7 @@ namespace ts {
|
||||
outputFingerprints = new Map<string, OutputFingerprint>();
|
||||
}
|
||||
|
||||
const hash = system.createHash(data);
|
||||
const hash = computeHash(data);
|
||||
const mtimeBefore = system.getModifiedTime(fileName);
|
||||
|
||||
if (mtimeBefore) {
|
||||
@@ -529,6 +530,51 @@ namespace ts {
|
||||
return resolutions;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function forEachResolvedProjectReference<T>(
|
||||
resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined,
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference, parent: ResolvedProjectReference | undefined) => T | undefined
|
||||
): T | undefined {
|
||||
return forEachProjectReference(/*projectReferences*/ undefined, resolvedProjectReferences, (resolvedRef, parent) => resolvedRef && cb(resolvedRef, parent));
|
||||
}
|
||||
|
||||
function forEachProjectReference<T>(
|
||||
projectReferences: readonly ProjectReference[] | undefined,
|
||||
resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined,
|
||||
cbResolvedRef: (resolvedRef: ResolvedProjectReference | undefined, parent: ResolvedProjectReference | undefined, index: number) => T | undefined,
|
||||
cbRef?: (projectReferences: readonly ProjectReference[] | undefined, parent: ResolvedProjectReference | undefined) => T | undefined
|
||||
): T | undefined {
|
||||
let seenResolvedRefs: Set<Path> | undefined;
|
||||
|
||||
return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined);
|
||||
|
||||
function worker(
|
||||
projectReferences: readonly ProjectReference[] | undefined,
|
||||
resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined,
|
||||
parent: ResolvedProjectReference | undefined,
|
||||
): T | undefined {
|
||||
|
||||
// Visit project references first
|
||||
if (cbRef) {
|
||||
const result = cbRef(projectReferences, parent);
|
||||
if (result) { return result; }
|
||||
}
|
||||
|
||||
return forEach(resolvedProjectReferences, (resolvedRef, index) => {
|
||||
if (resolvedRef && seenResolvedRefs?.has(resolvedRef.sourceFile.path)) {
|
||||
// ignore recursives
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const result = cbResolvedRef(resolvedRef, parent, index);
|
||||
if (result || !resolvedRef) return result;
|
||||
|
||||
(seenResolvedRefs ||= new Set()).add(resolvedRef.sourceFile.path);
|
||||
return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export const inferredTypesContainingFile = "__inferred type names__.ts";
|
||||
|
||||
@@ -734,7 +780,8 @@ namespace ts {
|
||||
// Track source files that are source files found by searching under node_modules, as these shouldn't be compiled.
|
||||
const sourceFilesFoundSearchingNodeModules = new Map<string, boolean>();
|
||||
|
||||
tracing.begin(tracing.Phase.Program, "createProgram", {});
|
||||
const tracingData: tracing.EventData = [tracing.Phase.Program, "createProgram"];
|
||||
tracing.begin(...tracingData);
|
||||
performance.mark("beforeProgram");
|
||||
|
||||
const host = createProgramOptions.host || createCompilerHost(options);
|
||||
@@ -820,12 +867,16 @@ namespace ts {
|
||||
forEachResolvedProjectReference
|
||||
});
|
||||
|
||||
tracing.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
|
||||
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
||||
tracing.pop();
|
||||
// We set `structuralIsReused` to `undefined` because `tryReuseStructureFromOldProgram` calls `tryReuseStructureFromOldProgram` which checks
|
||||
// `structuralIsReused`, which would be a TDZ violation if it was not set in advance to `undefined`.
|
||||
let structuralIsReused: StructureIsReused | undefined;
|
||||
structuralIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const
|
||||
if (structuralIsReused !== StructureIsReused.Completely) {
|
||||
let structureIsReused: StructureIsReused;
|
||||
tracing.push(tracing.Phase.Program, "tryReuseStructureFromOldProgram", {});
|
||||
structureIsReused = tryReuseStructureFromOldProgram(); // eslint-disable-line prefer-const
|
||||
tracing.pop();
|
||||
if (structureIsReused !== StructureIsReused.Completely) {
|
||||
processingDefaultLibFiles = [];
|
||||
processingOtherFiles = [];
|
||||
|
||||
@@ -860,12 +911,15 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
tracing.push(tracing.Phase.Program, "processRootFiles", { count: rootNames.length });
|
||||
forEach(rootNames, name => processRootFile(name, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false));
|
||||
tracing.pop();
|
||||
|
||||
// load type declarations specified via 'types' argument or implicitly from types/ and node_modules/@types folders
|
||||
const typeReferences: string[] = rootNames.length ? getAutomaticTypeDirectiveNames(options, host) : emptyArray;
|
||||
|
||||
if (typeReferences.length) {
|
||||
tracing.push(tracing.Phase.Program, "processTypeReferences", { count: typeReferences.length });
|
||||
// This containingFilename needs to match with the one used in managed-side
|
||||
const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory();
|
||||
const containingFilename = combinePaths(containingDirectory, inferredTypesContainingFile);
|
||||
@@ -873,6 +927,7 @@ namespace ts {
|
||||
for (let i = 0; i < typeReferences.length; i++) {
|
||||
processTypeReferenceDirective(typeReferences[i], resolutions[i]);
|
||||
}
|
||||
tracing.pop();
|
||||
}
|
||||
|
||||
// Do not process the default library if:
|
||||
@@ -913,8 +968,8 @@ namespace ts {
|
||||
host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
|
||||
}
|
||||
}
|
||||
oldProgram.forEachResolvedProjectReference((resolvedProjectReference, resolvedProjectReferencePath) => {
|
||||
if (resolvedProjectReference && !getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) {
|
||||
oldProgram.forEachResolvedProjectReference(resolvedProjectReference => {
|
||||
if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {
|
||||
host.onReleaseOldSourceFile!(resolvedProjectReference.sourceFile, oldProgram!.getCompilerOptions(), /*hasSourceFileByPath*/ false);
|
||||
}
|
||||
});
|
||||
@@ -936,6 +991,7 @@ namespace ts {
|
||||
getOptionsDiagnostics,
|
||||
getGlobalDiagnostics,
|
||||
getSemanticDiagnostics,
|
||||
getCachedSemanticDiagnostics,
|
||||
getSuggestionDiagnostics,
|
||||
getDeclarationDiagnostics,
|
||||
getBindAndCheckDiagnostics,
|
||||
@@ -978,32 +1034,74 @@ namespace ts {
|
||||
getSymlinkCache,
|
||||
realpath: host.realpath?.bind(host),
|
||||
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
||||
structureIsReused,
|
||||
};
|
||||
|
||||
onProgramCreateComplete();
|
||||
verifyCompilerOptions();
|
||||
performance.mark("afterProgram");
|
||||
performance.measure("Program", "beforeProgram", "afterProgram");
|
||||
tracing.end();
|
||||
tracing.end(...tracingData);
|
||||
|
||||
return program;
|
||||
|
||||
function resolveModuleNamesWorker(moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference) {
|
||||
function resolveModuleNamesWorker(moduleNames: string[], containingFile: SourceFile, reusedNames: string[] | undefined): readonly ResolvedModuleFull[] {
|
||||
if (!moduleNames.length) return emptyArray;
|
||||
const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
|
||||
const redirectedReference = getRedirectReferenceForResolution(containingFile);
|
||||
tracing.push(tracing.Phase.Program, "resolveModuleNamesWorker", { containingFileName });
|
||||
performance.mark("beforeResolveModule");
|
||||
const result = actualResolveModuleNamesWorker(moduleNames, containingFile, reusedNames, redirectedReference);
|
||||
const result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference);
|
||||
performance.mark("afterResolveModule");
|
||||
performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
|
||||
tracing.pop();
|
||||
return result;
|
||||
}
|
||||
|
||||
function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference) {
|
||||
function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames: string[], containingFile: string | SourceFile): readonly (ResolvedTypeReferenceDirective | undefined)[] {
|
||||
if (!typeDirectiveNames.length) return [];
|
||||
const containingFileName = !isString(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
|
||||
const redirectedReference = !isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined;
|
||||
tracing.push(tracing.Phase.Program, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName });
|
||||
performance.mark("beforeResolveTypeReference");
|
||||
const result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, redirectedReference);
|
||||
const result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference);
|
||||
performance.mark("afterResolveTypeReference");
|
||||
performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference");
|
||||
tracing.pop();
|
||||
return result;
|
||||
}
|
||||
|
||||
function getRedirectReferenceForResolution(file: SourceFile) {
|
||||
const redirect = getResolvedProjectReferenceToRedirect(file.originalFileName);
|
||||
if (redirect || !fileExtensionIs(file.originalFileName, Extension.Dts)) return redirect;
|
||||
|
||||
// The originalFileName could not be actual source file name if file found was d.ts from referecned project
|
||||
// So in this case try to look up if this is output from referenced project, if it is use the redirected project in that case
|
||||
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.originalFileName, file.path);
|
||||
if (resultFromDts) return resultFromDts;
|
||||
|
||||
// If preserveSymlinks is true, module resolution wont jump the symlink
|
||||
// but the resolved real path may be the .d.ts from project reference
|
||||
// Note:: Currently we try the real path only if the
|
||||
// file is from node_modules to avoid having to run real path on all file paths
|
||||
if (!host.realpath || !options.preserveSymlinks || !stringContains(file.originalFileName, nodeModulesPathPart)) return undefined;
|
||||
const realDeclarationFileName = host.realpath(file.originalFileName);
|
||||
const realDeclarationPath = toPath(realDeclarationFileName);
|
||||
return realDeclarationPath === file.path ? undefined : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationFileName, realDeclarationPath);
|
||||
}
|
||||
|
||||
function getRedirectReferenceForResolutionFromSourceOfProject(fileName: string, filePath: Path) {
|
||||
const source = getSourceOfProjectReferenceRedirect(fileName);
|
||||
if (isString(source)) return getResolvedProjectReferenceToRedirect(source);
|
||||
if (!source) return undefined;
|
||||
// Output of .d.ts file so return resolved ref that matches the out file name
|
||||
return forEachResolvedProjectReference(resolvedRef => {
|
||||
const out = outFile(resolvedRef.commandLine.options);
|
||||
if (!out) return undefined;
|
||||
return toPath(out) === filePath ? resolvedRef : undefined;
|
||||
});
|
||||
}
|
||||
|
||||
function compareDefaultLibFiles(a: SourceFile, b: SourceFile) {
|
||||
return compareValues(getDefaultLibFilePriority(a), getDefaultLibFilePriority(b));
|
||||
}
|
||||
@@ -1067,14 +1165,14 @@ namespace ts {
|
||||
return classifiableNames;
|
||||
}
|
||||
|
||||
function resolveModuleNamesReusingOldState(moduleNames: string[], containingFile: string, file: SourceFile) {
|
||||
if (structuralIsReused === StructureIsReused.Not && !file.ambientModuleNames.length) {
|
||||
function resolveModuleNamesReusingOldState(moduleNames: string[], file: SourceFile): readonly ResolvedModuleFull[] {
|
||||
if (structureIsReused === StructureIsReused.Not && !file.ambientModuleNames.length) {
|
||||
// If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules,
|
||||
// the best we can do is fallback to the default logic.
|
||||
return resolveModuleNamesWorker(moduleNames, containingFile, /*reusedNames*/ undefined, getResolvedProjectReferenceToRedirect(file.originalFileName));
|
||||
return resolveModuleNamesWorker(moduleNames, file, /*reusedNames*/ undefined);
|
||||
}
|
||||
|
||||
const oldSourceFile = oldProgram && oldProgram.getSourceFile(containingFile);
|
||||
const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
||||
if (oldSourceFile !== file && file.resolvedModules) {
|
||||
// `file` was created for the new program.
|
||||
//
|
||||
@@ -1119,7 +1217,7 @@ namespace ts {
|
||||
const oldResolvedModule = getResolvedModule(oldSourceFile, moduleName);
|
||||
if (oldResolvedModule) {
|
||||
if (isTraceEnabled(options, host)) {
|
||||
trace(host, Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile);
|
||||
trace(host, Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, getNormalizedAbsolutePath(file.originalFileName, currentDirectory));
|
||||
}
|
||||
(result || (result = new Array(moduleNames.length)))[i] = oldResolvedModule;
|
||||
(reusedNames || (reusedNames = [])).push(moduleName);
|
||||
@@ -1134,7 +1232,7 @@ namespace ts {
|
||||
if (contains(file.ambientModuleNames, moduleName)) {
|
||||
resolvesToAmbientModuleInNonModifiedFile = true;
|
||||
if (isTraceEnabled(options, host)) {
|
||||
trace(host, Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, containingFile);
|
||||
trace(host, Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName, getNormalizedAbsolutePath(file.originalFileName, currentDirectory));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1151,7 +1249,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
const resolutions = unknownModuleNames && unknownModuleNames.length
|
||||
? resolveModuleNamesWorker(unknownModuleNames, containingFile, reusedNames, getResolvedProjectReferenceToRedirect(file.originalFileName))
|
||||
? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames)
|
||||
: emptyArray;
|
||||
|
||||
// Combine results of resolutions and predicted results
|
||||
@@ -1210,7 +1308,7 @@ namespace ts {
|
||||
return !forEachProjectReference(
|
||||
oldProgram!.getProjectReferences(),
|
||||
oldProgram!.getResolvedProjectReferences(),
|
||||
(oldResolvedRef, index, parent) => {
|
||||
(oldResolvedRef, parent, index) => {
|
||||
const newRef = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
|
||||
const newResolvedRef = parseProjectReferenceConfigFile(newRef);
|
||||
if (oldResolvedRef) {
|
||||
@@ -1239,22 +1337,22 @@ namespace ts {
|
||||
// if any of these properties has changed - structure cannot be reused
|
||||
const oldOptions = oldProgram.getCompilerOptions();
|
||||
if (changesAffectModuleResolution(oldOptions, options)) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
|
||||
// there is an old program, check if we can reuse its structure
|
||||
const oldRootNames = oldProgram.getRootFileNames();
|
||||
if (!arrayIsEqualTo(oldRootNames, rootNames)) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
|
||||
if (!arrayIsEqualTo(options.types, oldOptions.types)) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
|
||||
// Check if any referenced project tsconfig files are different
|
||||
if (!canReuseProjectReferences()) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
if (projectReferences) {
|
||||
resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile);
|
||||
@@ -1263,13 +1361,13 @@ namespace ts {
|
||||
// check if program source files has changed in the way that can affect structure of the program
|
||||
const newSourceFiles: SourceFile[] = [];
|
||||
const modifiedSourceFiles: { oldFile: SourceFile, newFile: SourceFile }[] = [];
|
||||
oldProgram.structureIsReused = StructureIsReused.Completely;
|
||||
structureIsReused = StructureIsReused.Completely;
|
||||
|
||||
// If the missing file paths are now present, it can change the progam structure,
|
||||
// and hence cant reuse the structure.
|
||||
// This is same as how we dont reuse the structure if one of the file from old program is now missing
|
||||
if (oldProgram.getMissingFilePaths().some(missingFilePath => host.fileExists(missingFilePath))) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
|
||||
const oldSourceFiles = oldProgram.getSourceFiles();
|
||||
@@ -1282,7 +1380,7 @@ namespace ts {
|
||||
: host.getSourceFile(oldSourceFile.fileName, options.target!, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
|
||||
|
||||
if (!newSourceFile) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
|
||||
Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`");
|
||||
@@ -1293,7 +1391,7 @@ namespace ts {
|
||||
// This lets us know if the unredirected file has changed. If it has we should break the redirect.
|
||||
if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) {
|
||||
// Underlying file has changed. Might not redirect anymore. Must rebuild program.
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
fileChanged = false;
|
||||
newSourceFile = oldSourceFile; // Use the redirect.
|
||||
@@ -1301,7 +1399,7 @@ namespace ts {
|
||||
else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) {
|
||||
// If a redirected-to source file changes, the redirect may be broken.
|
||||
if (newSourceFile !== oldSourceFile) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
fileChanged = false;
|
||||
}
|
||||
@@ -1322,7 +1420,7 @@ namespace ts {
|
||||
const prevKind = seenPackageNames.get(packageName);
|
||||
const newKind = fileChanged ? SeenPackageName.Modified : SeenPackageName.Exists;
|
||||
if ((prevKind !== undefined && newKind === SeenPackageName.Modified) || prevKind === SeenPackageName.Modified) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
seenPackageNames.set(packageName, newKind);
|
||||
}
|
||||
@@ -1332,39 +1430,39 @@ namespace ts {
|
||||
|
||||
if (!arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) {
|
||||
// 'lib' references has changed. Matches behavior in changesAffectModuleResolution
|
||||
return oldProgram.structureIsReused = StructureIsReused.Not;
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
|
||||
if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {
|
||||
// value of no-default-lib has changed
|
||||
// this will affect if default library is injected into the list of files
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
// check tripleslash references
|
||||
if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {
|
||||
// tripleslash references has changed
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
// check imports and module augmentations
|
||||
collectExternalModuleReferences(newSourceFile);
|
||||
if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {
|
||||
// imports has changed
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
|
||||
// moduleAugmentations has changed
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
if ((oldSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags) !== (newSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags)) {
|
||||
// dynamicImport has changed
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
|
||||
// 'types' references has changed
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
// tentatively approve the file
|
||||
@@ -1372,7 +1470,7 @@ namespace ts {
|
||||
}
|
||||
else if (hasInvalidatedResolution(oldSourceFile.path)) {
|
||||
// 'module/types' references could have changed
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
|
||||
// add file to the modified list so that we will resolve it later
|
||||
modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
|
||||
@@ -1382,8 +1480,8 @@ namespace ts {
|
||||
newSourceFiles.push(newSourceFile);
|
||||
}
|
||||
|
||||
if (oldProgram.structureIsReused !== StructureIsReused.Completely) {
|
||||
return oldProgram.structureIsReused;
|
||||
if (structureIsReused !== StructureIsReused.Completely) {
|
||||
return structureIsReused;
|
||||
}
|
||||
|
||||
const modifiedFiles = modifiedSourceFiles.map(f => f.oldFile);
|
||||
@@ -1396,40 +1494,37 @@ namespace ts {
|
||||
}
|
||||
// try to verify results of module resolution
|
||||
for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) {
|
||||
const newSourceFilePath = getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory);
|
||||
const moduleNames = getModuleNames(newSourceFile);
|
||||
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile);
|
||||
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
||||
// ensure that module resolution results are still correct
|
||||
const resolutionsChanged = hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo);
|
||||
if (resolutionsChanged) {
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
newSourceFile.resolvedModules = zipToMap(moduleNames, resolutions);
|
||||
}
|
||||
else {
|
||||
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
||||
}
|
||||
if (resolveTypeReferenceDirectiveNamesWorker) {
|
||||
// We lower-case all type references because npm automatically lowercases all packages. See GH#9824.
|
||||
const typesReferenceDirectives = map(newSourceFile.typeReferenceDirectives, ref => toFileNameLowerCase(ref.fileName));
|
||||
const resolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFilePath, getResolvedProjectReferenceToRedirect(newSourceFile.originalFileName));
|
||||
// ensure that types resolutions are still correct
|
||||
const resolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, resolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo);
|
||||
if (resolutionsChanged) {
|
||||
oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
newSourceFile.resolvedTypeReferenceDirectiveNames = zipToMap(typesReferenceDirectives, resolutions);
|
||||
}
|
||||
else {
|
||||
newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
|
||||
}
|
||||
// We lower-case all type references because npm automatically lowercases all packages. See GH#9824.
|
||||
const typesReferenceDirectives = map(newSourceFile.typeReferenceDirectives, ref => toFileNameLowerCase(ref.fileName));
|
||||
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
||||
// ensure that types resolutions are still correct
|
||||
const typeReferenceEesolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo);
|
||||
if (typeReferenceEesolutionsChanged) {
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
newSourceFile.resolvedTypeReferenceDirectiveNames = zipToMap(typesReferenceDirectives, typeReferenceResolutions);
|
||||
}
|
||||
else {
|
||||
newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
|
||||
}
|
||||
}
|
||||
|
||||
if (oldProgram.structureIsReused !== StructureIsReused.Completely) {
|
||||
return oldProgram.structureIsReused;
|
||||
if (structureIsReused !== StructureIsReused.Completely) {
|
||||
return structureIsReused;
|
||||
}
|
||||
|
||||
if (host.hasChangedAutomaticTypeDirectiveNames?.()) {
|
||||
return oldProgram.structureIsReused = StructureIsReused.SafeModules;
|
||||
return StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
missingFilePaths = oldProgram.getMissingFilePaths();
|
||||
@@ -1467,7 +1562,7 @@ namespace ts {
|
||||
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
|
||||
redirectTargetsMap = oldProgram.redirectTargetsMap;
|
||||
|
||||
return oldProgram.structureIsReused = StructureIsReused.Completely;
|
||||
return StructureIsReused.Completely;
|
||||
}
|
||||
|
||||
function getEmitHost(writeFileCallback?: WriteFileCallback): EmitHost {
|
||||
@@ -1508,7 +1603,8 @@ namespace ts {
|
||||
|
||||
function emitBuildInfo(writeFileCallback?: WriteFileCallback): EmitResult {
|
||||
Debug.assert(!outFile(options));
|
||||
tracing.begin(tracing.Phase.Emit, "emitBuildInfo", {});
|
||||
const tracingData: tracing.EventData = [tracing.Phase.Emit, "emitBuildInfo"];
|
||||
tracing.begin(...tracingData);
|
||||
performance.mark("beforeEmit");
|
||||
const emitResult = emitFiles(
|
||||
notImplementedResolver,
|
||||
@@ -1521,7 +1617,7 @@ namespace ts {
|
||||
|
||||
performance.mark("afterEmit");
|
||||
performance.measure("Emit", "beforeEmit", "afterEmit");
|
||||
tracing.end();
|
||||
tracing.end(...tracingData);
|
||||
return emitResult;
|
||||
}
|
||||
|
||||
@@ -1582,9 +1678,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
function emit(sourceFile?: SourceFile, writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, transformers?: CustomTransformers, forceDtsEmit?: boolean): EmitResult {
|
||||
tracing.begin(tracing.Phase.Emit, "emit", { path: sourceFile?.path });
|
||||
const tracingData: tracing.EventData = [tracing.Phase.Emit, "emit", { path: sourceFile?.path }];
|
||||
tracing.begin(...tracingData);
|
||||
const result = runWithCancellationToken(() => emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit));
|
||||
tracing.end();
|
||||
tracing.end(...tracingData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1656,6 +1753,12 @@ namespace ts {
|
||||
return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken);
|
||||
}
|
||||
|
||||
function getCachedSemanticDiagnostics(sourceFile?: SourceFile): readonly Diagnostic[] | undefined {
|
||||
return sourceFile
|
||||
? cachedBindAndCheckDiagnosticsForFile.perFile?.get(sourceFile.path)
|
||||
: cachedBindAndCheckDiagnosticsForFile.allDiagnostics;
|
||||
}
|
||||
|
||||
function getBindAndCheckDiagnostics(sourceFile: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[] {
|
||||
return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken);
|
||||
}
|
||||
@@ -2071,9 +2174,7 @@ namespace ts {
|
||||
if (!options.configFile) { return emptyArray; }
|
||||
let diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName);
|
||||
forEachResolvedProjectReference(resolvedRef => {
|
||||
if (resolvedRef) {
|
||||
diagnostics = concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));
|
||||
}
|
||||
diagnostics = concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName));
|
||||
});
|
||||
return diagnostics;
|
||||
}
|
||||
@@ -2100,6 +2201,19 @@ namespace ts {
|
||||
: b.kind === SyntaxKind.StringLiteral && a.text === b.text;
|
||||
}
|
||||
|
||||
function createSyntheticImport(text: string, file: SourceFile) {
|
||||
const externalHelpersModuleReference = factory.createStringLiteral(text);
|
||||
const importDecl = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference);
|
||||
addEmitFlags(importDecl, EmitFlags.NeverApplyImportHelper);
|
||||
setParent(externalHelpersModuleReference, importDecl);
|
||||
setParent(importDecl, file);
|
||||
// explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them
|
||||
// (which is required to build the dependency graph for incremental emit)
|
||||
(externalHelpersModuleReference as Mutable<Node>).flags &= ~NodeFlags.Synthesized;
|
||||
(importDecl as Mutable<Node>).flags &= ~NodeFlags.Synthesized;
|
||||
return externalHelpersModuleReference;
|
||||
}
|
||||
|
||||
function collectExternalModuleReferences(file: SourceFile): void {
|
||||
if (file.imports) {
|
||||
return;
|
||||
@@ -2115,16 +2229,17 @@ namespace ts {
|
||||
|
||||
// If we are importing helpers, we need to add a synthetic reference to resolve the
|
||||
// helpers library.
|
||||
if (options.importHelpers
|
||||
&& (options.isolatedModules || isExternalModuleFile)
|
||||
if ((options.isolatedModules || isExternalModuleFile)
|
||||
&& !file.isDeclarationFile) {
|
||||
// synthesize 'import "tslib"' declaration
|
||||
const externalHelpersModuleReference = factory.createStringLiteral(externalHelpersModuleNameText);
|
||||
const importDecl = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference);
|
||||
addEmitFlags(importDecl, EmitFlags.NeverApplyImportHelper);
|
||||
setParent(externalHelpersModuleReference, importDecl);
|
||||
setParent(importDecl, file);
|
||||
imports = [externalHelpersModuleReference];
|
||||
if (options.importHelpers) {
|
||||
// synthesize 'import "tslib"' declaration
|
||||
imports = [createSyntheticImport(externalHelpersModuleNameText, file)];
|
||||
}
|
||||
const jsxImport = getJSXRuntimeImport(getJSXImplicitImportBase(options, file), options);
|
||||
if (jsxImport) {
|
||||
// synthesize `import "base/jsx-runtime"` declaration
|
||||
(imports ||= []).push(createSyntheticImport(jsxImport, file));
|
||||
}
|
||||
}
|
||||
|
||||
for (const node of file.statements) {
|
||||
@@ -2337,6 +2452,17 @@ namespace ts {
|
||||
|
||||
// Get source file from normalized fileName
|
||||
function findSourceFile(fileName: string, path: Path, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, refFile: RefFile | undefined, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
tracing.push(tracing.Phase.Program, "findSourceFile", {
|
||||
fileName,
|
||||
isDefaultLib: isDefaultLib || undefined,
|
||||
refKind: refFile ? (RefFileKind as any)[refFile.kind] : undefined,
|
||||
});
|
||||
const result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, refFile, packageId);
|
||||
tracing.pop();
|
||||
return result;
|
||||
}
|
||||
|
||||
function findSourceFileWorker(fileName: string, path: Path, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, refFile: RefFile | undefined, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
if (useSourceOfProjectReferenceRedirect) {
|
||||
let source = getSourceOfProjectReferenceRedirect(fileName);
|
||||
// If preserveSymlinks is true, module resolution wont jump the symlink
|
||||
@@ -2553,12 +2679,11 @@ namespace ts {
|
||||
function getResolvedProjectReferenceToRedirect(fileName: string) {
|
||||
if (mapFromFileToProjectReferenceRedirects === undefined) {
|
||||
mapFromFileToProjectReferenceRedirects = new Map();
|
||||
forEachResolvedProjectReference((referencedProject, referenceProjectPath) => {
|
||||
forEachResolvedProjectReference(referencedProject => {
|
||||
// not input file from the referenced project, ignore
|
||||
if (referencedProject &&
|
||||
toPath(options.configFilePath!) !== referenceProjectPath) {
|
||||
if (toPath(options.configFilePath!) !== referencedProject.sourceFile.path) {
|
||||
referencedProject.commandLine.fileNames.forEach(f =>
|
||||
mapFromFileToProjectReferenceRedirects!.set(toPath(f), referenceProjectPath));
|
||||
mapFromFileToProjectReferenceRedirects!.set(toPath(f), referencedProject.sourceFile.path));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2568,13 +2693,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
function forEachResolvedProjectReference<T>(
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference | undefined, resolvedProjectReferencePath: Path) => T | undefined
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference) => T | undefined
|
||||
): T | undefined {
|
||||
return forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, index, parent) => {
|
||||
const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
|
||||
const resolvedRefPath = toPath(resolveProjectReferencePath(ref));
|
||||
return cb(resolvedRef, resolvedRefPath);
|
||||
});
|
||||
return ts.forEachResolvedProjectReference(resolvedProjectReferences, cb);
|
||||
}
|
||||
|
||||
function getSourceOfProjectReferenceRedirect(file: string) {
|
||||
@@ -2582,21 +2703,19 @@ namespace ts {
|
||||
if (mapFromToProjectReferenceRedirectSource === undefined) {
|
||||
mapFromToProjectReferenceRedirectSource = new Map();
|
||||
forEachResolvedProjectReference(resolvedRef => {
|
||||
if (resolvedRef) {
|
||||
const out = outFile(resolvedRef.commandLine.options);
|
||||
if (out) {
|
||||
// Dont know which source file it means so return true?
|
||||
const outputDts = changeExtension(out, Extension.Dts);
|
||||
mapFromToProjectReferenceRedirectSource!.set(toPath(outputDts), true);
|
||||
}
|
||||
else {
|
||||
forEach(resolvedRef.commandLine.fileNames, fileName => {
|
||||
if (!fileExtensionIs(fileName, Extension.Dts) && !fileExtensionIs(fileName, Extension.Json)) {
|
||||
const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames());
|
||||
mapFromToProjectReferenceRedirectSource!.set(toPath(outputDts), fileName);
|
||||
}
|
||||
});
|
||||
}
|
||||
const out = outFile(resolvedRef.commandLine.options);
|
||||
if (out) {
|
||||
// Dont know which source file it means so return true?
|
||||
const outputDts = changeExtension(out, Extension.Dts);
|
||||
mapFromToProjectReferenceRedirectSource!.set(toPath(outputDts), true);
|
||||
}
|
||||
else {
|
||||
forEach(resolvedRef.commandLine.fileNames, fileName => {
|
||||
if (!fileExtensionIs(fileName, Extension.Dts) && !fileExtensionIs(fileName, Extension.Json)) {
|
||||
const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, host.useCaseSensitiveFileNames());
|
||||
mapFromToProjectReferenceRedirectSource!.set(toPath(outputDts), fileName);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2607,49 +2726,6 @@ namespace ts {
|
||||
return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName);
|
||||
}
|
||||
|
||||
function forEachProjectReference<T>(
|
||||
projectReferences: readonly ProjectReference[] | undefined,
|
||||
resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined,
|
||||
cbResolvedRef: (resolvedRef: ResolvedProjectReference | undefined, index: number, parent: ResolvedProjectReference | undefined) => T | undefined,
|
||||
cbRef?: (projectReferences: readonly ProjectReference[] | undefined, parent: ResolvedProjectReference | undefined) => T | undefined
|
||||
): T | undefined {
|
||||
let seenResolvedRefs: ResolvedProjectReference[] | undefined;
|
||||
|
||||
return worker(projectReferences, resolvedProjectReferences, /*parent*/ undefined, cbResolvedRef, cbRef);
|
||||
|
||||
function worker(
|
||||
projectReferences: readonly ProjectReference[] | undefined,
|
||||
resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined,
|
||||
parent: ResolvedProjectReference | undefined,
|
||||
cbResolvedRef: (resolvedRef: ResolvedProjectReference | undefined, index: number, parent: ResolvedProjectReference | undefined) => T | undefined,
|
||||
cbRef?: (projectReferences: readonly ProjectReference[] | undefined, parent: ResolvedProjectReference | undefined) => T | undefined,
|
||||
): T | undefined {
|
||||
|
||||
// Visit project references first
|
||||
if (cbRef) {
|
||||
const result = cbRef(projectReferences, parent);
|
||||
if (result) { return result; }
|
||||
}
|
||||
|
||||
return forEach(resolvedProjectReferences, (resolvedRef, index) => {
|
||||
if (contains(seenResolvedRefs, resolvedRef)) {
|
||||
// ignore recursives
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const result = cbResolvedRef(resolvedRef, index, parent);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!resolvedRef) return undefined;
|
||||
|
||||
(seenResolvedRefs || (seenResolvedRefs = [])).push(resolvedRef);
|
||||
return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef, cbResolvedRef, cbRef);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getResolvedProjectReferenceByPath(projectReferencePath: Path): ResolvedProjectReference | undefined {
|
||||
if (!projectReferenceRedirects) {
|
||||
return undefined;
|
||||
@@ -2684,7 +2760,7 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName, getResolvedProjectReferenceToRedirect(file.originalFileName));
|
||||
const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file);
|
||||
|
||||
for (let i = 0; i < typeDirectives.length; i++) {
|
||||
const ref = file.typeReferenceDirectives[i];
|
||||
@@ -2711,6 +2787,16 @@ namespace ts {
|
||||
resolvedTypeReferenceDirective?: ResolvedTypeReferenceDirective,
|
||||
refFile?: RefFile
|
||||
): void {
|
||||
tracing.push(tracing.Phase.Program, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: refFile?.kind, refPath: refFile?.file.path });
|
||||
processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, refFile);
|
||||
tracing.pop();
|
||||
}
|
||||
|
||||
function processTypeReferenceDirectiveWorker(
|
||||
typeReferenceDirective: string,
|
||||
resolvedTypeReferenceDirective?: ResolvedTypeReferenceDirective,
|
||||
refFile?: RefFile
|
||||
): void {
|
||||
|
||||
// If we already found this library as a primary reference - nothing to do
|
||||
const previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective);
|
||||
@@ -2822,7 +2908,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 resolutions = resolveModuleNamesReusingOldState(moduleNames, getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file);
|
||||
const resolutions = resolveModuleNamesReusingOldState(moduleNames, file);
|
||||
Debug.assert(resolutions.length === moduleNames.length);
|
||||
for (let i = 0; i < moduleNames.length; i++) {
|
||||
const resolution = resolutions[i];
|
||||
@@ -3304,7 +3390,7 @@ namespace ts {
|
||||
|
||||
function verifyProjectReferences() {
|
||||
const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
|
||||
forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, index, parent) => {
|
||||
forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
|
||||
const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
|
||||
const parentFile = parent && parent.sourceFile as JsonSourceFile;
|
||||
if (!resolvedRef) {
|
||||
@@ -3502,7 +3588,7 @@ namespace ts {
|
||||
toPath(fileName: string): Path;
|
||||
getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined;
|
||||
getSourceOfProjectReferenceRedirect(fileName: string): SourceOfProjectReferenceRedirect | undefined;
|
||||
forEachResolvedProjectReference<T>(cb: (resolvedProjectReference: ResolvedProjectReference | undefined, resolvedProjectReferencePath: Path) => T | undefined): T | undefined;
|
||||
forEachResolvedProjectReference<T>(cb: (resolvedProjectReference: ResolvedProjectReference) => T | undefined): T | undefined;
|
||||
}
|
||||
|
||||
function updateHostForUseSourceOfProjectReferenceRedirect(host: HostForUseSourceOfProjectReferenceRedirect) {
|
||||
@@ -3532,7 +3618,6 @@ namespace ts {
|
||||
if (!setOfDeclarationDirectories) {
|
||||
setOfDeclarationDirectories = new Set();
|
||||
host.forEachResolvedProjectReference(ref => {
|
||||
if (!ref) return;
|
||||
const out = outFile(ref.commandLine.options);
|
||||
if (out) {
|
||||
setOfDeclarationDirectories!.add(getDirectoryPath(host.toPath(out)));
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace ts {
|
||||
infer: SyntaxKind.InferKeyword,
|
||||
instanceof: SyntaxKind.InstanceOfKeyword,
|
||||
interface: SyntaxKind.InterfaceKeyword,
|
||||
intrinsic: SyntaxKind.IntrinsicKeyword,
|
||||
is: SyntaxKind.IsKeyword,
|
||||
keyof: SyntaxKind.KeyOfKeyword,
|
||||
let: SyntaxKind.LetKeyword,
|
||||
@@ -151,10 +152,6 @@ namespace ts {
|
||||
yield: SyntaxKind.YieldKeyword,
|
||||
async: SyntaxKind.AsyncKeyword,
|
||||
await: SyntaxKind.AwaitKeyword,
|
||||
uppercase: SyntaxKind.UppercaseKeyword,
|
||||
lowercase: SyntaxKind.LowercaseKeyword,
|
||||
capitalize: SyntaxKind.CapitalizeKeyword,
|
||||
uncapitalize: SyntaxKind.UncapitalizeKeyword,
|
||||
of: SyntaxKind.OfKeyword,
|
||||
};
|
||||
|
||||
|
||||
+48
-31
@@ -46,7 +46,15 @@ namespace ts.tracing {
|
||||
});
|
||||
|
||||
traceFd = fs.openSync(tracePath, "w");
|
||||
fs.writeSync(traceFd, `[\n`);
|
||||
|
||||
// Start with a prefix that contains some metadata that the devtools profiler expects (also avoids a warning on import)
|
||||
const meta = { cat: "__metadata", ph: "M", ts: 1000 * timestamp(), pid: 1, tid: 1 };
|
||||
fs.writeSync(traceFd,
|
||||
"[\n"
|
||||
+ [{ name: "process_name", args: { name: "tsc" }, ...meta },
|
||||
{ name: "thread_name", args: { name: "Main" }, ...meta },
|
||||
{ name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }]
|
||||
.map(v => JSON.stringify(v)).join(",\n"));
|
||||
}
|
||||
|
||||
/** Stops tracing for the in-progress project and dumps the type catalog (unless the `fs` module is unavailable). */
|
||||
@@ -58,11 +66,7 @@ namespace ts.tracing {
|
||||
|
||||
Debug.assert(fs);
|
||||
|
||||
// This both indicates that the trace is untruncated and conveniently
|
||||
// ensures that the last array element won't have a trailing comma.
|
||||
fs.writeSync(traceFd, `{"pid":1,"tid":1,"ph":"i","ts":${1000 * timestamp()},"name":"done","s":"g"}\n`);
|
||||
fs.writeSync(traceFd, `]\n`);
|
||||
|
||||
fs.writeSync(traceFd, `\n]\n`);
|
||||
fs.closeSync(traceFd);
|
||||
traceFd = undefined;
|
||||
|
||||
@@ -88,38 +92,51 @@ namespace ts.tracing {
|
||||
Emit = "emit",
|
||||
}
|
||||
|
||||
export function begin(phase: Phase, name: string, args: object) {
|
||||
if (!traceFd) {
|
||||
return;
|
||||
}
|
||||
Debug.assert(fs);
|
||||
export type EventData = [phase: Phase, name: string, args?: object];
|
||||
|
||||
performance.mark("beginTracing");
|
||||
fs.writeSync(traceFd, `{"pid":1,"tid":1,"ph":"B","cat":"${phase}","ts":${1000 * timestamp()},"name":"${name}","args":{ "ts": ${JSON.stringify(args)} }},\n`);
|
||||
performance.mark("endTracing");
|
||||
performance.measure("Tracing", "beginTracing", "endTracing");
|
||||
/** Note: `push`/`pop` should be used by default.
|
||||
* `begin`/`end` are for special cases where we need the data point even if the event never
|
||||
* terminates (typically for reducing a scenario too big to trace to one that can be completed).
|
||||
* In the future we might implement an exit handler to dump unfinished events which would
|
||||
* deprecate these operations.
|
||||
*/
|
||||
export function begin(phase: Phase, name: string, args?: object) {
|
||||
if (!traceFd) return;
|
||||
writeEvent("B", phase, name, args);
|
||||
}
|
||||
export function end(phase: Phase, name: string, args?: object) {
|
||||
if (!traceFd) return;
|
||||
writeEvent("E", phase, name, args);
|
||||
}
|
||||
|
||||
export function end() {
|
||||
if (!traceFd) {
|
||||
return;
|
||||
}
|
||||
Debug.assert(fs);
|
||||
|
||||
performance.mark("beginTracing");
|
||||
fs.writeSync(traceFd, `{"pid":1,"tid":1,"ph":"E","ts":${1000 * timestamp()}},\n`);
|
||||
performance.mark("endTracing");
|
||||
performance.measure("Tracing", "beginTracing", "endTracing");
|
||||
export function instant(phase: Phase, name: string, args?: object) {
|
||||
if (!traceFd) return;
|
||||
writeEvent("I", phase, name, args, `"s":"g"`);
|
||||
}
|
||||
|
||||
export function instant(phase: Phase, name: string, args: object) {
|
||||
if (!traceFd) {
|
||||
return;
|
||||
}
|
||||
Debug.assert(fs);
|
||||
// Used for "Complete" (ph:"X") events
|
||||
const completeEvents: { phase: Phase, name: string, args?: object, time: number }[] = [];
|
||||
export function push(phase: Phase, name: string, args?: object) {
|
||||
if (!traceFd) return;
|
||||
completeEvents.push({ phase, name, args, time: 1000 * timestamp() });
|
||||
}
|
||||
export function pop() {
|
||||
if (!traceFd) return;
|
||||
Debug.assert(completeEvents.length > 0);
|
||||
const { phase, name, args, time } = completeEvents.pop()!;
|
||||
const dur = 1000 * timestamp() - time;
|
||||
writeEvent("X", phase, name, args, `"dur":${dur}`, time);
|
||||
}
|
||||
|
||||
function writeEvent(eventType: string, phase: Phase, name: string, args: object | undefined, extras?: string,
|
||||
time: number = 1000 * timestamp()) {
|
||||
Debug.assert(traceFd);
|
||||
Debug.assert(fs);
|
||||
performance.mark("beginTracing");
|
||||
fs.writeSync(traceFd, `{"pid":1,"tid":1,"ph":"i","cat":"${phase}","ts":${1000 * timestamp()},"name":"${name}","s":"g","args":{ "ts": ${JSON.stringify(args)} }},\n`);
|
||||
fs.writeSync(traceFd, `,\n{"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time},"name":"${name}"`);
|
||||
if (extras) fs.writeSync(traceFd, `,${extras}`);
|
||||
if (args) fs.writeSync(traceFd, `,"args":${JSON.stringify(args)}`);
|
||||
fs.writeSync(traceFd, `}`);
|
||||
performance.mark("endTracing");
|
||||
performance.measure("Tracing", "beginTracing", "endTracing");
|
||||
}
|
||||
|
||||
@@ -223,9 +223,9 @@ namespace ts {
|
||||
// Transform each node.
|
||||
const transformed: T[] = [];
|
||||
for (const node of nodes) {
|
||||
tracing.begin(tracing.Phase.Emit, "transformNodes", node.kind === SyntaxKind.SourceFile ? { path: (node as any as SourceFile).path } : { kind: node.kind, pos: node.pos, end: node.end });
|
||||
tracing.push(tracing.Phase.Emit, "transformNodes", node.kind === SyntaxKind.SourceFile ? { path: (node as any as SourceFile).path } : { kind: node.kind, pos: node.pos, end: node.end });
|
||||
transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
|
||||
tracing.end();
|
||||
tracing.pop();
|
||||
}
|
||||
|
||||
// prevent modification of the lexical environment.
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace ts {
|
||||
export function isInternalDeclaration(node: Node, currentSourceFile: SourceFile) {
|
||||
const parseTreeNode = getParseTreeNode(node);
|
||||
if (parseTreeNode && parseTreeNode.kind === SyntaxKind.Parameter) {
|
||||
const paramIdx = (parseTreeNode.parent as FunctionLike).parameters.indexOf(parseTreeNode as ParameterDeclaration);
|
||||
const previousSibling = paramIdx > 0 ? (parseTreeNode.parent as FunctionLike).parameters[paramIdx - 1] : undefined;
|
||||
const paramIdx = (parseTreeNode.parent as SignatureDeclaration).parameters.indexOf(parseTreeNode as ParameterDeclaration);
|
||||
const previousSibling = paramIdx > 0 ? (parseTreeNode.parent as SignatureDeclaration).parameters[paramIdx - 1] : undefined;
|
||||
const text = currentSourceFile.text;
|
||||
const commentRanges = previousSibling
|
||||
? concatenate(
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace ts {
|
||||
level: FlattenLevel;
|
||||
downlevelIteration: boolean;
|
||||
hoistTempVariables: boolean;
|
||||
hasTransformedPriorElement?: boolean; // indicates whether we've transformed a prior declaration
|
||||
emitExpression: (value: Expression) => void;
|
||||
emitBindingOrAssignment: (target: BindingOrAssignmentElementTarget, value: Expression, location: TextRange, original: Node | undefined) => void;
|
||||
createArrayBindingOrAssignmentPattern: (elements: BindingOrAssignmentElement[]) => ArrayBindingOrAssignmentPattern;
|
||||
@@ -265,18 +266,27 @@ namespace ts {
|
||||
value: Expression | undefined,
|
||||
location: TextRange,
|
||||
skipInitializer?: boolean) {
|
||||
const bindingTarget = getTargetOfBindingOrAssignmentElement(element)!; // TODO: GH#18217
|
||||
if (!skipInitializer) {
|
||||
const initializer = visitNode(getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, isExpression);
|
||||
if (initializer) {
|
||||
// Combine value and initializer
|
||||
value = value ? createDefaultValueCheck(flattenContext, value, initializer, location) : initializer;
|
||||
if (value) {
|
||||
value = createDefaultValueCheck(flattenContext, value, initializer, location);
|
||||
// If 'value' is not a simple expression, it could contain side-effecting code that should evaluate before an object or array binding pattern.
|
||||
if (!isSimpleInlineableExpression(initializer) && isBindingOrAssignmentPattern(bindingTarget)) {
|
||||
value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ true, location);
|
||||
}
|
||||
}
|
||||
else {
|
||||
value = initializer;
|
||||
}
|
||||
}
|
||||
else if (!value) {
|
||||
// Use 'void 0' in absence of value and initializer
|
||||
value = flattenContext.context.factory.createVoidZero();
|
||||
}
|
||||
}
|
||||
const bindingTarget = getTargetOfBindingOrAssignmentElement(element)!; // TODO: GH#18217
|
||||
if (isObjectBindingOrAssignmentPattern(bindingTarget)) {
|
||||
flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value!, location);
|
||||
}
|
||||
@@ -393,7 +403,8 @@ namespace ts {
|
||||
if (flattenContext.level >= FlattenLevel.ObjectRest) {
|
||||
// If an array pattern contains an ObjectRest, we must cache the result so that we
|
||||
// can perform the ObjectRest destructuring in a different declaration
|
||||
if (element.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
|
||||
if (element.transformFlags & TransformFlags.ContainsObjectRestOrSpread || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) {
|
||||
flattenContext.hasTransformedPriorElement = true;
|
||||
const temp = flattenContext.context.factory.createTempVariable(/*recordTempVariable*/ undefined);
|
||||
if (flattenContext.hoistTempVariables) {
|
||||
flattenContext.context.hoistVariableDeclaration(temp);
|
||||
@@ -428,6 +439,17 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isSimpleBindingOrAssignmentElement(element: BindingOrAssignmentElement): boolean {
|
||||
const target = getTargetOfBindingOrAssignmentElement(element);
|
||||
if (!target || isOmittedExpression(target)) return true;
|
||||
const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(element);
|
||||
if (propertyName && !isPropertyNameLiteral(propertyName)) return false;
|
||||
const initializer = getInitializerOfBindingOrAssignmentElement(element);
|
||||
if (initializer && !isSimpleInlineableExpression(initializer)) return false;
|
||||
if (isBindingOrAssignmentPattern(target)) return every(getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement);
|
||||
return isIdentifier(target);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an expression used to provide a default value if a value is `undefined` at runtime.
|
||||
*
|
||||
|
||||
@@ -355,12 +355,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
function visitor(node: Node): VisitResult<Node> {
|
||||
if (shouldVisitNode(node)) {
|
||||
return visitJavaScript(node);
|
||||
}
|
||||
else {
|
||||
return node;
|
||||
}
|
||||
return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ false) : node;
|
||||
}
|
||||
|
||||
function visitorWithUnusedExpressionResult(node: Node): VisitResult<Node> {
|
||||
return shouldVisitNode(node) ? visitorWorker(node, /*expressionResultIsUnused*/ true) : node;
|
||||
}
|
||||
|
||||
function callExpressionVisitor(node: Node): VisitResult<Node> {
|
||||
@@ -370,7 +369,7 @@ namespace ts {
|
||||
return visitor(node);
|
||||
}
|
||||
|
||||
function visitJavaScript(node: Node): VisitResult<Node> {
|
||||
function visitorWorker(node: Node, expressionResultIsUnused: boolean): VisitResult<Node> {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.StaticKeyword:
|
||||
return undefined; // elide static keyword
|
||||
@@ -456,10 +455,13 @@ namespace ts {
|
||||
return visitNewExpression(<NewExpression>node);
|
||||
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return visitParenthesizedExpression(<ParenthesizedExpression>node, /*needsDestructuringValue*/ true);
|
||||
return visitParenthesizedExpression(<ParenthesizedExpression>node, expressionResultIsUnused);
|
||||
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return visitBinaryExpression(<BinaryExpression>node, /*needsDestructuringValue*/ true);
|
||||
return visitBinaryExpression(<BinaryExpression>node, expressionResultIsUnused);
|
||||
|
||||
case SyntaxKind.CommaListExpression:
|
||||
return visitCommaListExpression(<CommaListExpression>node, expressionResultIsUnused);
|
||||
|
||||
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
case SyntaxKind.TemplateHead:
|
||||
@@ -507,6 +509,9 @@ namespace ts {
|
||||
case SyntaxKind.ReturnStatement:
|
||||
return visitReturnStatement(<ReturnStatement>node);
|
||||
|
||||
case SyntaxKind.VoidExpression:
|
||||
return visitVoidExpression(node as VoidExpression);
|
||||
|
||||
default:
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
@@ -596,6 +601,10 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
function visitVoidExpression(node: VoidExpression): Expression {
|
||||
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
||||
}
|
||||
|
||||
function visitIdentifier(node: Identifier): Identifier {
|
||||
if (!convertedLoopState) {
|
||||
return node;
|
||||
@@ -1975,47 +1984,28 @@ namespace ts {
|
||||
* @param node An ExpressionStatement node.
|
||||
*/
|
||||
function visitExpressionStatement(node: ExpressionStatement): Statement {
|
||||
// If we are here it is most likely because our expression is a destructuring assignment.
|
||||
switch (node.expression.kind) {
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return factory.updateExpressionStatement(node, visitParenthesizedExpression(<ParenthesizedExpression>node.expression, /*needsDestructuringValue*/ false));
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return factory.updateExpressionStatement(node, visitBinaryExpression(<BinaryExpression>node.expression, /*needsDestructuringValue*/ false));
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a ParenthesizedExpression that may contain a destructuring assignment.
|
||||
*
|
||||
* @param node A ParenthesizedExpression node.
|
||||
* @param needsDestructuringValue A value indicating whether we need to hold onto the rhs
|
||||
* of a destructuring assignment.
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitParenthesizedExpression(node: ParenthesizedExpression, needsDestructuringValue: boolean): ParenthesizedExpression {
|
||||
// If we are here it is most likely because our expression is a destructuring assignment.
|
||||
if (!needsDestructuringValue) {
|
||||
// By default we always emit the RHS at the end of a flattened destructuring
|
||||
// expression. If we are in a state where we do not need the destructuring value,
|
||||
// we pass that information along to the children that care about it.
|
||||
switch (node.expression.kind) {
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return factory.updateParenthesizedExpression(node, visitParenthesizedExpression(<ParenthesizedExpression>node.expression, /*needsDestructuringValue*/ false));
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return factory.updateParenthesizedExpression(node, visitBinaryExpression(<BinaryExpression>node.expression, /*needsDestructuringValue*/ false));
|
||||
}
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
function visitParenthesizedExpression(node: ParenthesizedExpression, expressionResultIsUnused: boolean): ParenthesizedExpression {
|
||||
return visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a BinaryExpression that contains a destructuring assignment.
|
||||
*
|
||||
* @param node A BinaryExpression node.
|
||||
* @param needsDestructuringValue A value indicating whether we need to hold onto the rhs
|
||||
* of a destructuring assignment.
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitBinaryExpression(node: BinaryExpression, needsDestructuringValue: boolean): Expression {
|
||||
function visitBinaryExpression(node: BinaryExpression, expressionResultIsUnused: boolean): Expression {
|
||||
// If we are here it is because this is a destructuring assignment.
|
||||
if (isDestructuringAssignment(node)) {
|
||||
return flattenDestructuringAssignment(
|
||||
@@ -2023,11 +2013,40 @@ namespace ts {
|
||||
visitor,
|
||||
context,
|
||||
FlattenLevel.All,
|
||||
needsDestructuringValue);
|
||||
!expressionResultIsUnused);
|
||||
}
|
||||
if (node.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
return factory.updateBinaryExpression(
|
||||
node,
|
||||
visitNode(node.left, visitorWithUnusedExpressionResult, isExpression),
|
||||
node.operatorToken,
|
||||
visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, isExpression)
|
||||
);
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitCommaListExpression(node: CommaListExpression, expressionResultIsUnused: boolean): Expression {
|
||||
if (expressionResultIsUnused) {
|
||||
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
||||
}
|
||||
let result: Expression[] | undefined;
|
||||
for (let i = 0; i < node.elements.length; i++) {
|
||||
const element = node.elements[i];
|
||||
const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression);
|
||||
if (result || visited !== element) {
|
||||
result ||= node.elements.slice(0, i);
|
||||
result.push(visited);
|
||||
}
|
||||
}
|
||||
const elements = result ? setTextRange(factory.createNodeArray(result), node.elements) : node.elements;
|
||||
return factory.updateCommaListExpression(node, elements);
|
||||
}
|
||||
|
||||
function isVariableStatementOfTypeScriptClassWrapper(node: VariableStatement) {
|
||||
return node.declarationList.declarations.length === 1
|
||||
&& !!node.declarationList.declarations[0].initializer
|
||||
@@ -2288,6 +2307,16 @@ namespace ts {
|
||||
outermostLabeledStatement);
|
||||
}
|
||||
|
||||
function visitEachChildOfForStatement(node: ForStatement) {
|
||||
return factory.updateForStatement(
|
||||
node,
|
||||
visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer),
|
||||
visitNode(node.condition, visitor, isExpression),
|
||||
visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression),
|
||||
visitNode(node.statement, visitor, isStatement, factory.liftToBlock)
|
||||
);
|
||||
}
|
||||
|
||||
function visitForInStatement(node: ForInStatement, outermostLabeledStatement: LabeledStatement | undefined) {
|
||||
return visitIterationStatementWithFacts(
|
||||
HierarchyFacts.ForInOrForOfStatementExcludes,
|
||||
@@ -2371,7 +2400,7 @@ namespace ts {
|
||||
// evaluated on every iteration.
|
||||
const assignment = factory.createAssignment(initializer, boundValue);
|
||||
if (isDestructuringAssignment(assignment)) {
|
||||
statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*needsDestructuringValue*/ false)));
|
||||
statements.push(factory.createExpressionStatement(visitBinaryExpression(assignment, /*expressionResultIsUnused*/ true)));
|
||||
}
|
||||
else {
|
||||
setTextRangeEnd(assignment, initializer.end);
|
||||
@@ -2714,7 +2743,10 @@ namespace ts {
|
||||
|
||||
const result = convert
|
||||
? convert(node, outermostLabeledStatement, /*convertedLoopBodyStatements*/ undefined, ancestorFacts)
|
||||
: factory.restoreEnclosingLabel(visitEachChild(node, visitor, context), outermostLabeledStatement, convertedLoopState && resetLabel);
|
||||
: factory.restoreEnclosingLabel(
|
||||
isForStatement(node) ? visitEachChildOfForStatement(node) : visitEachChild(node, visitor, context),
|
||||
outermostLabeledStatement,
|
||||
convertedLoopState && resetLabel);
|
||||
|
||||
if (convertedLoopState) {
|
||||
convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps;
|
||||
@@ -2777,9 +2809,9 @@ namespace ts {
|
||||
const shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor);
|
||||
return factory.updateForStatement(
|
||||
node,
|
||||
visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, isForInitializer),
|
||||
visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, isForInitializer),
|
||||
visitNode(shouldConvertCondition ? undefined : node.condition, visitor, isExpression),
|
||||
visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, isExpression),
|
||||
visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitorWithUnusedExpressionResult, isExpression),
|
||||
convertedLoopBody
|
||||
);
|
||||
}
|
||||
|
||||
@@ -119,11 +119,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
function visitor(node: Node): VisitResult<Node> {
|
||||
return visitorWorker(node, /*noDestructuringValue*/ false);
|
||||
return visitorWorker(node, /*expressionResultIsUnused*/ false);
|
||||
}
|
||||
|
||||
function visitorNoDestructuringValue(node: Node): VisitResult<Node> {
|
||||
return visitorWorker(node, /*noDestructuringValue*/ true);
|
||||
function visitorWithUnusedExpressionResult(node: Node): VisitResult<Node> {
|
||||
return visitorWorker(node, /*expressionResultIsUnused*/ true);
|
||||
}
|
||||
|
||||
function visitorNoAsyncModifier(node: Node): VisitResult<Node> {
|
||||
@@ -147,7 +147,11 @@ namespace ts {
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
function visitorWorker(node: Node, noDestructuringValue: boolean): VisitResult<Node> {
|
||||
/**
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitorWorker(node: Node, expressionResultIsUnused: boolean): VisitResult<Node> {
|
||||
if ((node.transformFlags & TransformFlags.ContainsES2018) === 0) {
|
||||
return node;
|
||||
}
|
||||
@@ -163,7 +167,9 @@ namespace ts {
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
return visitObjectLiteralExpression(node as ObjectLiteralExpression);
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return visitBinaryExpression(node as BinaryExpression, noDestructuringValue);
|
||||
return visitBinaryExpression(node as BinaryExpression, expressionResultIsUnused);
|
||||
case SyntaxKind.CommaListExpression:
|
||||
return visitCommaListExpression(node as CommaListExpression, expressionResultIsUnused);
|
||||
case SyntaxKind.CatchClause:
|
||||
return visitCatchClause(node as CatchClause);
|
||||
case SyntaxKind.VariableStatement:
|
||||
@@ -235,7 +241,7 @@ namespace ts {
|
||||
case SyntaxKind.ExpressionStatement:
|
||||
return visitExpressionStatement(node as ExpressionStatement);
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return visitParenthesizedExpression(node as ParenthesizedExpression, noDestructuringValue);
|
||||
return visitParenthesizedExpression(node as ParenthesizedExpression, expressionResultIsUnused);
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
return visitTaggedTemplateExpression(node as TaggedTemplateExpression);
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
@@ -411,11 +417,15 @@ namespace ts {
|
||||
}
|
||||
|
||||
function visitExpressionStatement(node: ExpressionStatement): ExpressionStatement {
|
||||
return visitEachChild(node, visitorNoDestructuringValue, context);
|
||||
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
||||
}
|
||||
|
||||
function visitParenthesizedExpression(node: ParenthesizedExpression, noDestructuringValue: boolean): ParenthesizedExpression {
|
||||
return visitEachChild(node, noDestructuringValue ? visitorNoDestructuringValue : visitor, context);
|
||||
/**
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitParenthesizedExpression(node: ParenthesizedExpression, expressionResultIsUnused: boolean): ParenthesizedExpression {
|
||||
return visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);
|
||||
}
|
||||
|
||||
function visitSourceFile(node: SourceFile): SourceFile {
|
||||
@@ -450,28 +460,51 @@ namespace ts {
|
||||
* Visits a BinaryExpression that contains a destructuring assignment.
|
||||
*
|
||||
* @param node A BinaryExpression node.
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitBinaryExpression(node: BinaryExpression, noDestructuringValue: boolean): Expression {
|
||||
function visitBinaryExpression(node: BinaryExpression, expressionResultIsUnused: boolean): Expression {
|
||||
if (isDestructuringAssignment(node) && node.left.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
|
||||
return flattenDestructuringAssignment(
|
||||
node,
|
||||
visitor,
|
||||
context,
|
||||
FlattenLevel.ObjectRest,
|
||||
!noDestructuringValue
|
||||
!expressionResultIsUnused
|
||||
);
|
||||
}
|
||||
else if (node.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
if (node.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
return factory.updateBinaryExpression(
|
||||
node,
|
||||
visitNode(node.left, visitorNoDestructuringValue, isExpression),
|
||||
visitNode(node.left, visitorWithUnusedExpressionResult, isExpression),
|
||||
node.operatorToken,
|
||||
visitNode(node.right, noDestructuringValue ? visitorNoDestructuringValue : visitor, isExpression)
|
||||
visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, isExpression)
|
||||
);
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
|
||||
* expression of an `ExpressionStatement`).
|
||||
*/
|
||||
function visitCommaListExpression(node: CommaListExpression, expressionResultIsUnused: boolean): Expression {
|
||||
if (expressionResultIsUnused) {
|
||||
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
||||
}
|
||||
let result: Expression[] | undefined;
|
||||
for (let i = 0; i < node.elements.length; i++) {
|
||||
const element = node.elements[i];
|
||||
const visited = visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression);
|
||||
if (result || visited !== element) {
|
||||
result ||= node.elements.slice(0, i);
|
||||
result.push(visited);
|
||||
}
|
||||
}
|
||||
const elements = result ? setTextRange(factory.createNodeArray(result), node.elements) : node.elements;
|
||||
return factory.updateCommaListExpression(node, elements);
|
||||
}
|
||||
|
||||
function visitCatchClause(node: CatchClause) {
|
||||
if (node.variableDeclaration &&
|
||||
isBindingPattern(node.variableDeclaration.name) &&
|
||||
@@ -539,15 +572,15 @@ namespace ts {
|
||||
function visitForStatement(node: ForStatement): VisitResult<Statement> {
|
||||
return factory.updateForStatement(
|
||||
node,
|
||||
visitNode(node.initializer, visitorNoDestructuringValue, isForInitializer),
|
||||
visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer),
|
||||
visitNode(node.condition, visitor, isExpression),
|
||||
visitNode(node.incrementor, visitor, isExpression),
|
||||
visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression),
|
||||
visitNode(node.statement, visitor, isStatement)
|
||||
);
|
||||
}
|
||||
|
||||
function visitVoidExpression(node: VoidExpression) {
|
||||
return visitEachChild(node, visitorNoDestructuringValue, context);
|
||||
return visitEachChild(node, visitorWithUnusedExpressionResult, context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -397,6 +397,8 @@ namespace ts {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return visitBinaryExpression(<BinaryExpression>node);
|
||||
case SyntaxKind.CommaListExpression:
|
||||
return visitCommaListExpression(<CommaListExpression>node);
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
return visitConditionalExpression(<ConditionalExpression>node);
|
||||
case SyntaxKind.YieldExpression:
|
||||
@@ -772,6 +774,65 @@ namespace ts {
|
||||
return visitEachChild(node, visitor, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a comma expression containing `yield`.
|
||||
*
|
||||
* @param node The node to visit.
|
||||
*/
|
||||
function visitCommaExpression(node: BinaryExpression) {
|
||||
// [source]
|
||||
// x = a(), yield, b();
|
||||
//
|
||||
// [intermediate]
|
||||
// a();
|
||||
// .yield resumeLabel
|
||||
// .mark resumeLabel
|
||||
// x = %sent%, b();
|
||||
|
||||
let pendingExpressions: Expression[] = [];
|
||||
visit(node.left);
|
||||
visit(node.right);
|
||||
return factory.inlineExpressions(pendingExpressions);
|
||||
|
||||
function visit(node: Expression) {
|
||||
if (isBinaryExpression(node) && node.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
visit(node.left);
|
||||
visit(node.right);
|
||||
}
|
||||
else {
|
||||
if (containsYield(node) && pendingExpressions.length > 0) {
|
||||
emitWorker(OpCode.Statement, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]);
|
||||
pendingExpressions = [];
|
||||
}
|
||||
|
||||
pendingExpressions.push(visitNode(node, visitor, isExpression));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a comma-list expression.
|
||||
*
|
||||
* @param node The node to visit.
|
||||
*/
|
||||
function visitCommaListExpression(node: CommaListExpression) {
|
||||
// flattened version of `visitCommaExpression`
|
||||
let pendingExpressions: Expression[] = [];
|
||||
for (const elem of node.elements) {
|
||||
if (isBinaryExpression(elem) && elem.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
pendingExpressions.push(visitCommaExpression(elem));
|
||||
}
|
||||
else {
|
||||
if (containsYield(elem) && pendingExpressions.length > 0) {
|
||||
emitWorker(OpCode.Statement, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]);
|
||||
pendingExpressions = [];
|
||||
}
|
||||
pendingExpressions.push(visitNode(elem, visitor, isExpression));
|
||||
}
|
||||
}
|
||||
return factory.inlineExpressions(pendingExpressions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a logical binary expression containing `yield`.
|
||||
*
|
||||
@@ -825,42 +886,6 @@ namespace ts {
|
||||
return resultLocal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a comma expression containing `yield`.
|
||||
*
|
||||
* @param node The node to visit.
|
||||
*/
|
||||
function visitCommaExpression(node: BinaryExpression) {
|
||||
// [source]
|
||||
// x = a(), yield, b();
|
||||
//
|
||||
// [intermediate]
|
||||
// a();
|
||||
// .yield resumeLabel
|
||||
// .mark resumeLabel
|
||||
// x = %sent%, b();
|
||||
|
||||
let pendingExpressions: Expression[] = [];
|
||||
visit(node.left);
|
||||
visit(node.right);
|
||||
return factory.inlineExpressions(pendingExpressions);
|
||||
|
||||
function visit(node: Expression) {
|
||||
if (isBinaryExpression(node) && node.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
visit(node.left);
|
||||
visit(node.right);
|
||||
}
|
||||
else {
|
||||
if (containsYield(node) && pendingExpressions.length > 0) {
|
||||
emitWorker(OpCode.Statement, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]);
|
||||
pendingExpressions = [];
|
||||
}
|
||||
|
||||
pendingExpressions.push(visitNode(node, visitor, isExpression));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Visits a conditional expression containing `yield`.
|
||||
*
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace ts {
|
||||
interface PerFileState {
|
||||
importSpecifier?: string;
|
||||
filenameDeclaration?: VariableDeclaration & { name: Identifier; };
|
||||
utilizedImplicitRuntimeImports?: Map<ImportSpecifier>;
|
||||
utilizedImplicitRuntimeImports?: Map<Map<ImportSpecifier>>;
|
||||
}
|
||||
|
||||
const {
|
||||
@@ -26,12 +26,12 @@ namespace ts {
|
||||
return currentFileState.filenameDeclaration.name;
|
||||
}
|
||||
|
||||
function getJsxFactoryCalleePrimitive(children: readonly JsxChild[] | undefined): "jsx" | "jsxs" | "jsxDEV" {
|
||||
return compilerOptions.jsx === JsxEmit.ReactJSXDev ? "jsxDEV" : children && children.length > 1 ? "jsxs" : "jsx";
|
||||
function getJsxFactoryCalleePrimitive(childrenLength: number): "jsx" | "jsxs" | "jsxDEV" {
|
||||
return compilerOptions.jsx === JsxEmit.ReactJSXDev ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx";
|
||||
}
|
||||
|
||||
function getJsxFactoryCallee(children: readonly JsxChild[] | undefined) {
|
||||
const type = getJsxFactoryCalleePrimitive(children);
|
||||
function getJsxFactoryCallee(childrenLength: number) {
|
||||
const type = getJsxFactoryCalleePrimitive(childrenLength);
|
||||
return getImplicitImportForName(type);
|
||||
}
|
||||
|
||||
@@ -40,17 +40,25 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getImplicitImportForName(name: string) {
|
||||
const existing = currentFileState.utilizedImplicitRuntimeImports?.get(name);
|
||||
const importSource = name === "createElement"
|
||||
? currentFileState.importSpecifier!
|
||||
: getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions)!;
|
||||
const existing = currentFileState.utilizedImplicitRuntimeImports?.get(importSource)?.get(name);
|
||||
if (existing) {
|
||||
return existing.name;
|
||||
}
|
||||
if (!currentFileState.utilizedImplicitRuntimeImports) {
|
||||
currentFileState.utilizedImplicitRuntimeImports = createMap();
|
||||
}
|
||||
let specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource);
|
||||
if (!specifierSourceImports) {
|
||||
specifierSourceImports = createMap();
|
||||
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
||||
}
|
||||
const generatedName = factory.createUniqueName(`_${name}`, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel | GeneratedIdentifierFlags.AllowNameSubstitution);
|
||||
const specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName);
|
||||
generatedName.generatedImportReference = specifier;
|
||||
currentFileState.utilizedImplicitRuntimeImports.set(name, specifier);
|
||||
specifierSourceImports.set(name, specifier);
|
||||
return generatedName;
|
||||
}
|
||||
|
||||
@@ -73,29 +81,30 @@ namespace ts {
|
||||
if (currentFileState.filenameDeclaration) {
|
||||
statements = insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([currentFileState.filenameDeclaration], NodeFlags.Const)));
|
||||
}
|
||||
if (currentFileState.utilizedImplicitRuntimeImports && currentFileState.utilizedImplicitRuntimeImports.size && currentFileState.importSpecifier !== undefined) {
|
||||
const specifier = `${currentFileState.importSpecifier}/${compilerOptions.jsx === JsxEmit.ReactJSXDev ? "jsx-dev-runtime" : "jsx-runtime"}`;
|
||||
if (isExternalModule(node)) {
|
||||
// Add `import` statement
|
||||
const importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(arrayFrom(currentFileState.utilizedImplicitRuntimeImports.values()))), factory.createStringLiteral(specifier));
|
||||
setParentRecursive(importStatement, /*incremental*/ false);
|
||||
statements = insertStatementAfterCustomPrologue(statements.slice(), importStatement);
|
||||
}
|
||||
else if (isExternalOrCommonJsModule(node)) {
|
||||
// Add `require` statement
|
||||
const requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([
|
||||
factory.createVariableDeclaration(
|
||||
factory.createObjectBindingPattern(map(arrayFrom(currentFileState.utilizedImplicitRuntimeImports.values()), s => factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name))),
|
||||
/*exclaimationToken*/ undefined,
|
||||
/*type*/ undefined,
|
||||
factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(specifier)])
|
||||
)
|
||||
], NodeFlags.Const));
|
||||
setParentRecursive(requireStatement, /*incremental*/ false);
|
||||
statements = insertStatementAfterCustomPrologue(statements.slice(), requireStatement);
|
||||
}
|
||||
else {
|
||||
// Do nothing (script file) - consider an error in the checker?
|
||||
if (currentFileState.utilizedImplicitRuntimeImports) {
|
||||
for (const [importSource, importSpecifiersMap] of arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries())) {
|
||||
if (isExternalModule(node)) {
|
||||
// Add `import` statement
|
||||
const importStatement = factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, factory.createImportClause(/*typeOnly*/ false, /*name*/ undefined, factory.createNamedImports(arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource));
|
||||
setParentRecursive(importStatement, /*incremental*/ false);
|
||||
statements = insertStatementAfterCustomPrologue(statements.slice(), importStatement);
|
||||
}
|
||||
else if (isExternalOrCommonJsModule(node)) {
|
||||
// Add `require` statement
|
||||
const requireStatement = factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([
|
||||
factory.createVariableDeclaration(
|
||||
factory.createObjectBindingPattern(map(arrayFrom(importSpecifiersMap.values()), s => factory.createBindingElement(/*dotdotdot*/ undefined, s.propertyName, s.name))),
|
||||
/*exclaimationToken*/ undefined,
|
||||
/*type*/ undefined,
|
||||
factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, [factory.createStringLiteral(importSource)])
|
||||
)
|
||||
], NodeFlags.Const));
|
||||
setParentRecursive(requireStatement, /*incremental*/ false);
|
||||
statements = insertStatementAfterCustomPrologue(statements.slice(), requireStatement);
|
||||
}
|
||||
else {
|
||||
// Do nothing (script file) - consider an error in the checker?
|
||||
}
|
||||
}
|
||||
}
|
||||
if (statements !== visited.statements) {
|
||||
@@ -191,8 +200,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
function convertJsxChildrenToChildrenPropObject(children: readonly JsxChild[]) {
|
||||
if (children.length === 1) {
|
||||
const result = transformJsxChildToExpression(children[0]);
|
||||
const nonWhitespaceChildren = getSemanticJsxChildren(children);
|
||||
if (length(nonWhitespaceChildren) === 1) {
|
||||
const result = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
||||
return result && factory.createObjectLiteralExpression([
|
||||
factory.createPropertyAssignment("children", result)
|
||||
]);
|
||||
@@ -208,48 +218,51 @@ namespace ts {
|
||||
let objectProperties: Expression;
|
||||
const keyAttr = find(node.attributes.properties, p => !!p.name && isIdentifier(p.name) && p.name.escapedText === "key") as JsxAttribute | undefined;
|
||||
const attrs = keyAttr ? filter(node.attributes.properties, p => p !== keyAttr) : node.attributes.properties;
|
||||
if (attrs.length === 0) {
|
||||
objectProperties = factory.createObjectLiteralExpression([]);
|
||||
// When there are no attributes, React wants {}
|
||||
}
|
||||
else {
|
||||
|
||||
let segments: Expression[] = [];
|
||||
if (attrs.length) {
|
||||
// Map spans of JsxAttribute nodes into object literals and spans
|
||||
// of JsxSpreadAttribute nodes into expressions.
|
||||
const segments = flatten<Expression | ObjectLiteralExpression>(
|
||||
segments = flatten(
|
||||
spanMap(attrs, isJsxSpreadAttribute, (attrs, isSpread) => isSpread
|
||||
? map(attrs, transformJsxSpreadAttributeToExpression)
|
||||
: factory.createObjectLiteralExpression(map(attrs, transformJsxAttributeToObjectLiteralElement))
|
||||
)
|
||||
);
|
||||
|
||||
if (children && children.length) {
|
||||
const result = convertJsxChildrenToChildrenPropObject(children);
|
||||
if (result) {
|
||||
segments.push(result);
|
||||
}
|
||||
}
|
||||
|
||||
if (isJsxSpreadAttribute(attrs[0])) {
|
||||
// We must always emit at least one object literal before a spread
|
||||
// argument.factory.createObjectLiteral
|
||||
segments.unshift(factory.createObjectLiteralExpression());
|
||||
}
|
||||
}
|
||||
if (children && children.length) {
|
||||
const result = convertJsxChildrenToChildrenPropObject(children);
|
||||
if (result) {
|
||||
segments.push(result);
|
||||
}
|
||||
}
|
||||
|
||||
if (segments.length === 0) {
|
||||
objectProperties = factory.createObjectLiteralExpression([]);
|
||||
// When there are no attributes, React wants {}
|
||||
}
|
||||
else {
|
||||
// Either emit one big object literal (no spread attribs), or
|
||||
// a call to the __assign helper.
|
||||
objectProperties = singleOrUndefined(segments) || emitHelpers().createAssignHelper(segments);
|
||||
}
|
||||
|
||||
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location);
|
||||
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, length(getSemanticJsxChildren(children || emptyArray)), isChild, location);
|
||||
}
|
||||
|
||||
function visitJsxOpeningLikeElementOrFragmentJSX(tagName: Expression, objectProperties: Expression, keyAttr: JsxAttribute | undefined, children: readonly JsxChild[] | undefined, isChild: boolean, location: TextRange) {
|
||||
function visitJsxOpeningLikeElementOrFragmentJSX(tagName: Expression, objectProperties: Expression, keyAttr: JsxAttribute | undefined, childrenLength: number, isChild: boolean, location: TextRange) {
|
||||
const args: Expression[] = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
|
||||
if (compilerOptions.jsx === JsxEmit.ReactJSXDev) {
|
||||
const originalFile = getOriginalNode(currentSourceFile);
|
||||
if (originalFile && isSourceFile(originalFile)) {
|
||||
// isStaticChildren development flag
|
||||
args.push(children && children.length > 1 ? factory.createTrue() : factory.createFalse());
|
||||
args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse());
|
||||
// __source development flag
|
||||
const lineCol = getLineAndCharacterOfPosition(originalFile, location.pos);
|
||||
args.push(factory.createObjectLiteralExpression([
|
||||
@@ -261,7 +274,7 @@ namespace ts {
|
||||
args.push(factory.createThis());
|
||||
}
|
||||
}
|
||||
const element = setTextRange(factory.createCallExpression(getJsxFactoryCallee(children), /*typeArguments*/ undefined, args), location);
|
||||
const element = setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location);
|
||||
|
||||
if (isChild) {
|
||||
startOnNewLine(element);
|
||||
@@ -302,14 +315,21 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const callee = currentFileState.importSpecifier === undefined
|
||||
? createJsxFactoryExpression(
|
||||
factory,
|
||||
context.getEmitResolver().getJsxFactoryEntity(currentSourceFile),
|
||||
compilerOptions.reactNamespace!, // TODO: GH#18217
|
||||
node
|
||||
)
|
||||
: getImplicitImportForName("createElement");
|
||||
|
||||
const element = createExpressionForJsxElement(
|
||||
factory,
|
||||
context.getEmitResolver().getJsxFactoryEntity(currentSourceFile),
|
||||
compilerOptions.reactNamespace!, // TODO: GH#18217
|
||||
callee,
|
||||
tagName,
|
||||
objectProperties,
|
||||
mapDefined(children, transformJsxChildToExpression),
|
||||
node,
|
||||
location
|
||||
);
|
||||
|
||||
@@ -332,7 +352,7 @@ namespace ts {
|
||||
getImplicitJsxFragmentReference(),
|
||||
childrenProps || factory.createObjectLiteralExpression([]),
|
||||
/*keyAttr*/ undefined,
|
||||
children,
|
||||
length(getSemanticJsxChildren(children)),
|
||||
isChild,
|
||||
location
|
||||
);
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
"corePublic.ts",
|
||||
"core.ts",
|
||||
"debug.ts",
|
||||
"performanceTimestamp.ts",
|
||||
"semver.ts",
|
||||
"performanceCore.ts",
|
||||
"performance.ts",
|
||||
"perfLogger.ts",
|
||||
"semver.ts",
|
||||
"tracing.ts",
|
||||
|
||||
"types.ts",
|
||||
|
||||
+44
-39
@@ -167,6 +167,7 @@ namespace ts {
|
||||
DeclareKeyword,
|
||||
GetKeyword,
|
||||
InferKeyword,
|
||||
IntrinsicKeyword,
|
||||
IsKeyword,
|
||||
KeyOfKeyword,
|
||||
ModuleKeyword,
|
||||
@@ -186,10 +187,6 @@ namespace ts {
|
||||
FromKeyword,
|
||||
GlobalKeyword,
|
||||
BigIntKeyword,
|
||||
UppercaseKeyword,
|
||||
LowercaseKeyword,
|
||||
CapitalizeKeyword,
|
||||
UncapitalizeKeyword,
|
||||
OfKeyword, // LastKeyword and LastToken and LastContextualKeyword
|
||||
|
||||
// Parse tree nodes
|
||||
@@ -544,7 +541,6 @@ namespace ts {
|
||||
| SyntaxKind.BigIntKeyword
|
||||
| SyntaxKind.BooleanKeyword
|
||||
| SyntaxKind.BreakKeyword
|
||||
| SyntaxKind.CapitalizeKeyword
|
||||
| SyntaxKind.CaseKeyword
|
||||
| SyntaxKind.CatchKeyword
|
||||
| SyntaxKind.ClassKeyword
|
||||
@@ -574,10 +570,10 @@ namespace ts {
|
||||
| SyntaxKind.InKeyword
|
||||
| SyntaxKind.InstanceOfKeyword
|
||||
| SyntaxKind.InterfaceKeyword
|
||||
| SyntaxKind.IntrinsicKeyword
|
||||
| SyntaxKind.IsKeyword
|
||||
| SyntaxKind.KeyOfKeyword
|
||||
| SyntaxKind.LetKeyword
|
||||
| SyntaxKind.LowercaseKeyword
|
||||
| SyntaxKind.ModuleKeyword
|
||||
| SyntaxKind.NamespaceKeyword
|
||||
| SyntaxKind.NeverKeyword
|
||||
@@ -605,11 +601,9 @@ namespace ts {
|
||||
| SyntaxKind.TryKeyword
|
||||
| SyntaxKind.TypeKeyword
|
||||
| SyntaxKind.TypeOfKeyword
|
||||
| SyntaxKind.UncapitalizeKeyword
|
||||
| SyntaxKind.UndefinedKeyword
|
||||
| SyntaxKind.UniqueKeyword
|
||||
| SyntaxKind.UnknownKeyword
|
||||
| SyntaxKind.UppercaseKeyword
|
||||
| SyntaxKind.VarKeyword
|
||||
| SyntaxKind.VoidKeyword
|
||||
| SyntaxKind.WhileKeyword
|
||||
@@ -635,6 +629,7 @@ namespace ts {
|
||||
| SyntaxKind.AnyKeyword
|
||||
| SyntaxKind.BigIntKeyword
|
||||
| SyntaxKind.BooleanKeyword
|
||||
| SyntaxKind.IntrinsicKeyword
|
||||
| SyntaxKind.NeverKeyword
|
||||
| SyntaxKind.NumberKeyword
|
||||
| SyntaxKind.ObjectKeyword
|
||||
@@ -1665,19 +1660,10 @@ namespace ts {
|
||||
export interface TemplateLiteralTypeSpan extends TypeNode {
|
||||
readonly kind: SyntaxKind.TemplateLiteralTypeSpan,
|
||||
readonly parent: TemplateLiteralTypeNode;
|
||||
readonly casing: TemplateCasing;
|
||||
readonly type: TypeNode;
|
||||
readonly literal: TemplateMiddle | TemplateTail;
|
||||
}
|
||||
|
||||
export const enum TemplateCasing {
|
||||
None,
|
||||
Uppercase,
|
||||
Lowercase,
|
||||
Capitalize,
|
||||
Uncapitalize,
|
||||
}
|
||||
|
||||
// Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing.
|
||||
// Consider 'Expression'. Without the brand, 'Expression' is actually no different
|
||||
// (structurally) than 'Node'. Because of this you can pass any Node to a function that
|
||||
@@ -3776,6 +3762,8 @@ namespace ts {
|
||||
/* @internal */ getDiagnosticsProducingTypeChecker(): TypeChecker;
|
||||
/* @internal */ dropDiagnosticsProducingTypeChecker(): void;
|
||||
|
||||
/* @internal */ getCachedSemanticDiagnostics(sourceFile?: SourceFile): readonly Diagnostic[] | undefined;
|
||||
|
||||
/* @internal */ getClassifiableNames(): Set<__String>;
|
||||
|
||||
getTypeCatalog(): readonly Type[];
|
||||
@@ -3793,7 +3781,8 @@ namespace ts {
|
||||
isSourceFileDefaultLibrary(file: SourceFile): boolean;
|
||||
|
||||
// For testing purposes only.
|
||||
/* @internal */ structureIsReused?: StructureIsReused;
|
||||
// This is set on created program to let us know how the program was created using old program
|
||||
/* @internal */ readonly structureIsReused: StructureIsReused;
|
||||
|
||||
/* @internal */ getSourceFileFromReference(referencingFile: SourceFile | UnparsedSource, ref: FileReference): SourceFile | undefined;
|
||||
/* @internal */ getLibFileFromReference(ref: FileReference): SourceFile | undefined;
|
||||
@@ -3811,7 +3800,7 @@ namespace ts {
|
||||
getResolvedProjectReferences(): readonly (ResolvedProjectReference | undefined)[] | undefined;
|
||||
/*@internal*/ getProjectReferenceRedirect(fileName: string): string | undefined;
|
||||
/*@internal*/ getResolvedProjectReferenceToRedirect(fileName: string): ResolvedProjectReference | undefined;
|
||||
/*@internal*/ forEachResolvedProjectReference<T>(cb: (resolvedProjectReference: ResolvedProjectReference | undefined, resolvedProjectReferencePath: Path) => T | undefined): T | undefined;
|
||||
/*@internal*/ forEachResolvedProjectReference<T>(cb: (resolvedProjectReference: ResolvedProjectReference) => T | undefined): T | undefined;
|
||||
/*@internal*/ getResolvedProjectReferenceByPath(projectReferencePath: Path): ResolvedProjectReference | undefined;
|
||||
/*@internal*/ isSourceOfProjectReferenceRedirect(fileName: string): boolean;
|
||||
/*@internal*/ getProgramBuildInfo?(): ProgramBuildInfo | undefined;
|
||||
@@ -4018,6 +4007,7 @@ namespace ts {
|
||||
getAugmentedPropertiesOfType(type: Type): Symbol[];
|
||||
|
||||
getRootSymbols(symbol: Symbol): readonly Symbol[];
|
||||
getSymbolOfExpando(node: Node, allowDeclaration: boolean): Symbol | undefined;
|
||||
getContextualType(node: Expression): Type | undefined;
|
||||
/* @internal */ getContextualType(node: Expression, contextFlags?: ContextFlags): Type | undefined; // eslint-disable-line @typescript-eslint/unified-signatures
|
||||
/* @internal */ getContextualTypeForObjectLiteralElement(element: ObjectLiteralElementLike): Type | undefined;
|
||||
@@ -4184,7 +4174,7 @@ namespace ts {
|
||||
export const enum UnionReduction {
|
||||
None = 0,
|
||||
Literal,
|
||||
Subtype
|
||||
Subtype,
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -4521,7 +4511,7 @@ namespace ts {
|
||||
isDeclarationVisible(node: Declaration | AnyImportSyntax): boolean;
|
||||
isLateBound(node: Declaration): node is LateBoundDeclaration;
|
||||
collectLinkedAliases(node: Identifier, setVisibility?: boolean): Node[] | undefined;
|
||||
isImplementationOfOverload(node: FunctionLike): boolean | undefined;
|
||||
isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined;
|
||||
isRequiredInitializedParameter(node: ParameterDeclaration): boolean;
|
||||
isOptionalUninitializedParameterProperty(node: ParameterDeclaration): boolean;
|
||||
isExpandoFunctionDeclaration(node: FunctionDeclaration): boolean;
|
||||
@@ -4853,11 +4843,11 @@ namespace ts {
|
||||
resolvedJSDocType?: Type; // Resolved type of a JSDoc type reference
|
||||
switchTypes?: Type[]; // Cached array of switch case expression types
|
||||
jsxNamespace?: Symbol | false; // Resolved jsx namespace symbol for this node
|
||||
jsxImplicitImportContainer?: Symbol | false; // Resolved module symbol the implicit jsx import of this file should refer to
|
||||
contextFreeType?: Type; // Cached context-free type used by the first pass of inference; used when a function's return is partially contextually sensitive
|
||||
deferredNodes?: ESMap<NodeId, Node>; // Set of nodes whose checking has been deferred
|
||||
capturedBlockScopeBindings?: Symbol[]; // Block-scoped bindings captured beneath this part of an IterationStatement
|
||||
outerTypeParameters?: TypeParameter[]; // Outer type parameters of anonymous object type
|
||||
instantiations?: ESMap<string, Type>; // Instantiations of generic type alias (undefined if non-generic)
|
||||
isExhaustive?: boolean; // Is node an exhaustive switch statement
|
||||
skipDirectInference?: true; // Flag set by the API `getContextualType` call on a node when `Completions` is passed to force the checker to skip making inferences to a node's type
|
||||
declarationRequiresScopeChange?: boolean; // Set by `useOuterVariableScopeInParameter` in checker when downlevel emit would change the name resolution scope inside of a parameter.
|
||||
@@ -4892,6 +4882,7 @@ namespace ts {
|
||||
Substitution = 1 << 25, // Type parameter substitution
|
||||
NonPrimitive = 1 << 26, // intrinsic object type
|
||||
TemplateLiteral = 1 << 27, // Template literal type
|
||||
StringMapping = 1 << 28, // Uppercase/Lowercase type
|
||||
|
||||
/* @internal */
|
||||
AnyOrUnknown = Any | Unknown,
|
||||
@@ -4909,7 +4900,7 @@ namespace ts {
|
||||
Intrinsic = Any | Unknown | String | Number | BigInt | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never | NonPrimitive,
|
||||
/* @internal */
|
||||
Primitive = String | Number | BigInt | Boolean | Enum | EnumLiteral | ESSymbol | Void | Undefined | Null | Literal | UniqueESSymbol,
|
||||
StringLike = String | StringLiteral | TemplateLiteral,
|
||||
StringLike = String | StringLiteral | TemplateLiteral | StringMapping,
|
||||
NumberLike = Number | NumberLiteral | Enum,
|
||||
BigIntLike = BigInt | BigIntLiteral,
|
||||
BooleanLike = Boolean | BooleanLiteral,
|
||||
@@ -4922,7 +4913,7 @@ namespace ts {
|
||||
StructuredType = Object | Union | Intersection,
|
||||
TypeVariable = TypeParameter | IndexedAccess,
|
||||
InstantiableNonPrimitive = TypeVariable | Conditional | Substitution,
|
||||
InstantiablePrimitive = Index | TemplateLiteral,
|
||||
InstantiablePrimitive = Index | TemplateLiteral | StringMapping,
|
||||
Instantiable = InstantiableNonPrimitive | InstantiablePrimitive,
|
||||
StructuredOrInstantiable = StructuredType | Instantiable,
|
||||
/* @internal */
|
||||
@@ -4930,7 +4921,7 @@ namespace ts {
|
||||
/* @internal */
|
||||
Simplifiable = IndexedAccess | Conditional,
|
||||
/* @internal */
|
||||
Substructure = Object | Union | Intersection | Index | IndexedAccess | Conditional | Substitution | TemplateLiteral,
|
||||
Substructure = Object | Union | Intersection | Index | IndexedAccess | Conditional | Substitution | TemplateLiteral | StringMapping,
|
||||
// 'Narrowable' types are types where narrowing actually narrows.
|
||||
// This *should* be every type other than null, undefined, void, and never
|
||||
Narrowable = Any | Unknown | StructuredOrInstantiable | StringLike | NumberLike | BigIntLike | BooleanLike | ESSymbol | UniqueESSymbol | NonPrimitive,
|
||||
@@ -4938,7 +4929,7 @@ namespace ts {
|
||||
NotPrimitiveUnion = Any | Unknown | Enum | Void | Never | StructuredOrInstantiable,
|
||||
// The following flags are aggregated during union and intersection type construction
|
||||
/* @internal */
|
||||
IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive,
|
||||
IncludesMask = Any | Unknown | Primitive | Never | Object | Union | Intersection | NonPrimitive | TemplateLiteral,
|
||||
// The following flags are used for different purposes during union and intersection type construction
|
||||
/* @internal */
|
||||
IncludesStructuredOrInstantiable = TypeParameter,
|
||||
@@ -5150,6 +5141,8 @@ namespace ts {
|
||||
node: TypeReferenceNode | ArrayTypeNode | TupleTypeNode;
|
||||
/* @internal */
|
||||
mapper?: TypeMapper;
|
||||
/* @internal */
|
||||
instantiations?: ESMap<string, Type>; // Instantiations of generic type alias (undefined if non-generic)
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -5230,6 +5223,7 @@ namespace ts {
|
||||
export interface AnonymousType extends ObjectType {
|
||||
target?: AnonymousType; // Instantiation target
|
||||
mapper?: TypeMapper; // Instantiation mapper
|
||||
instantiations?: ESMap<string, Type>; // Instantiations of generic type alias (undefined if non-generic)
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -5335,6 +5329,12 @@ namespace ts {
|
||||
export interface IndexedAccessType extends InstantiableType {
|
||||
objectType: Type;
|
||||
indexType: Type;
|
||||
/**
|
||||
* @internal
|
||||
* Indicates that --noUncheckedIndexedAccess may introduce 'undefined' into
|
||||
* the resulting type, depending on how type variable constraints are resolved.
|
||||
*/
|
||||
noUncheckedIndexedAccessCandidate: boolean;
|
||||
constraint?: Type;
|
||||
simplifiedForReading?: Type;
|
||||
simplifiedForWriting?: Type;
|
||||
@@ -5379,11 +5379,15 @@ namespace ts {
|
||||
}
|
||||
|
||||
export interface TemplateLiteralType extends InstantiableType {
|
||||
texts: readonly string[]; // Always one element longer than casings/types
|
||||
casings: readonly TemplateCasing[]; // Always at least one element
|
||||
texts: readonly string[]; // Always one element longer than types
|
||||
types: readonly Type[]; // Always at least one element
|
||||
}
|
||||
|
||||
export interface StringMappingType extends InstantiableType {
|
||||
symbol: Symbol;
|
||||
type: Type;
|
||||
}
|
||||
|
||||
// Type parameter substitution (TypeFlags.Substitution)
|
||||
// Substitution types are created for type parameters or indexed access types that occur in the
|
||||
// true branch of a conditional type. For example, in 'T extends string ? Foo<T> : Bar<T>', the
|
||||
@@ -5528,17 +5532,17 @@ namespace ts {
|
||||
|
||||
/**
|
||||
* Ternary values are defined such that
|
||||
* x & y is False if either x or y is False.
|
||||
* x & y is Maybe if either x or y is Maybe, but neither x or y is False.
|
||||
* x & y is True if both x and y are True.
|
||||
* x | y is False if both x and y are False.
|
||||
* x | y is Maybe if either x or y is Maybe, but neither x or y is True.
|
||||
* x | y is True if either x or y is True.
|
||||
* x & y picks the lesser in the order False < Unknown < Maybe < True, and
|
||||
* x | y picks the greater in the order False < Unknown < Maybe < True.
|
||||
* Generally, Ternary.Maybe is used as the result of a relation that depends on itself, and
|
||||
* Ternary.Unknown is used as the result of a variance check that depends on itself. We make
|
||||
* a distinction because we don't want to cache circular variance check results.
|
||||
*/
|
||||
/* @internal */
|
||||
export const enum Ternary {
|
||||
False = 0,
|
||||
Maybe = 1,
|
||||
Unknown = 1,
|
||||
Maybe = 3,
|
||||
True = -1
|
||||
}
|
||||
|
||||
@@ -5852,7 +5856,8 @@ namespace ts {
|
||||
enable?: boolean;
|
||||
include?: string[];
|
||||
exclude?: string[];
|
||||
[option: string]: string[] | boolean | undefined;
|
||||
disableFilenameBasedTypeAcquisition?: boolean;
|
||||
[option: string]: CompilerOptionsValue | undefined;
|
||||
}
|
||||
|
||||
export enum ModuleKind {
|
||||
@@ -6329,7 +6334,7 @@ namespace ts {
|
||||
/*@internal*/
|
||||
export interface ResolvedProjectReferenceCallbacks {
|
||||
getSourceOfProjectReferenceRedirect(fileName: string): SourceOfProjectReferenceRedirect | undefined;
|
||||
forEachResolvedProjectReference<T>(cb: (resolvedProjectReference: ResolvedProjectReference | undefined, resolvedProjectReferencePath: Path) => T | undefined): T | undefined;
|
||||
forEachResolvedProjectReference<T>(cb: (resolvedProjectReference: ResolvedProjectReference) => T | undefined): T | undefined;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -6774,8 +6779,8 @@ namespace ts {
|
||||
createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
|
||||
/* @internal */ createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined): IndexSignatureDeclaration; // eslint-disable-line @typescript-eslint/unified-signatures
|
||||
updateIndexSignature(node: IndexSignatureDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration;
|
||||
createTemplateLiteralTypeSpan(casing: TemplateCasing, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
|
||||
updateTemplateLiteralTypeSpan(casing: TemplateCasing, node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
|
||||
createTemplateLiteralTypeSpan(type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
|
||||
updateTemplateLiteralTypeSpan(node: TemplateLiteralTypeSpan, type: TypeNode, literal: TemplateMiddle | TemplateTail): TemplateLiteralTypeSpan;
|
||||
|
||||
//
|
||||
// Types
|
||||
|
||||
+110
-70
@@ -100,28 +100,6 @@ namespace ts {
|
||||
!isJsonEqual(getCompilerOptionValue(oldOptions, o), getCompilerOptionValue(newOptions, o)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit"
|
||||
* At that point findAncestor returns undefined.
|
||||
*/
|
||||
export function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined;
|
||||
export function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined;
|
||||
export function findAncestor(node: Node, callback: (element: Node) => boolean | "quit"): Node | undefined {
|
||||
while (node) {
|
||||
const result = callback(node);
|
||||
if (result === "quit") {
|
||||
return undefined;
|
||||
}
|
||||
else if (result) {
|
||||
return node;
|
||||
}
|
||||
node = node.parent;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function forEachAncestor<T>(node: Node, callback: (n: Node) => T | undefined | "quit"): T | undefined {
|
||||
while (true) {
|
||||
const res = callback(node);
|
||||
@@ -562,6 +540,77 @@ namespace ts {
|
||||
return emitNode && emitNode.flags || 0;
|
||||
}
|
||||
|
||||
interface ScriptTargetFeatures {
|
||||
[key: string]: { [key: string]: string[] | undefined };
|
||||
};
|
||||
|
||||
export function getScriptTargetFeatures(): ScriptTargetFeatures {
|
||||
return {
|
||||
es2015: {
|
||||
Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"],
|
||||
RegExp: ["flags", "sticky", "unicode"],
|
||||
Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get"," getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"],
|
||||
ArrayConstructor: ["from", "of"],
|
||||
ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"],
|
||||
NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"],
|
||||
Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"],
|
||||
Map: ["entries", "keys", "values"],
|
||||
Set: ["entries", "keys", "values"],
|
||||
Promise: emptyArray,
|
||||
PromiseConstructor: ["all", "race", "reject", "resolve"],
|
||||
Symbol: ["for", "keyFor"],
|
||||
WeakMap: ["entries", "keys", "values"],
|
||||
WeakSet: ["entries", "keys", "values"],
|
||||
Iterator: emptyArray,
|
||||
AsyncIterator: emptyArray,
|
||||
String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"],
|
||||
StringConstructor: ["fromCodePoint", "raw"]
|
||||
},
|
||||
es2016: {
|
||||
Array: ["includes"]
|
||||
},
|
||||
es2017: {
|
||||
Atomics: emptyArray,
|
||||
SharedArrayBuffer: emptyArray,
|
||||
String: ["padStart", "padEnd"],
|
||||
ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"],
|
||||
DateTimeFormat: ["formatToParts"]
|
||||
},
|
||||
es2018: {
|
||||
Promise: ["finally"],
|
||||
RegExpMatchArray: ["groups"],
|
||||
RegExpExecArray: ["groups"],
|
||||
RegExp: ["dotAll"],
|
||||
Intl: ["PluralRules"],
|
||||
AsyncIterable: emptyArray,
|
||||
AsyncIterableIterator: emptyArray,
|
||||
AsyncGenerator: emptyArray,
|
||||
AsyncGeneratorFunction: emptyArray,
|
||||
},
|
||||
es2019: {
|
||||
Array: ["flat", "flatMap"],
|
||||
ObjectConstructor: ["fromEntries"],
|
||||
String: ["trimStart", "trimEnd", "trimLeft", "trimRight"],
|
||||
Symbol: ["description"]
|
||||
},
|
||||
es2020: {
|
||||
BigInt: emptyArray,
|
||||
BigInt64Array: emptyArray,
|
||||
BigUint64Array: emptyArray,
|
||||
PromiseConstructor: ["allSettled"],
|
||||
SymbolConstructor: ["matchAll"],
|
||||
String: ["matchAll"],
|
||||
DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"],
|
||||
RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"]
|
||||
},
|
||||
esnext: {
|
||||
PromiseConstructor: ["any"],
|
||||
String: ["replaceAll"],
|
||||
NumberFormat: ["formatToParts"]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const enum GetLiteralTextFlags {
|
||||
None = 0,
|
||||
NeverAsciiEscape = 1 << 0,
|
||||
@@ -1959,48 +2008,6 @@ namespace ts {
|
||||
return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === CharacterCodes.doubleQuote;
|
||||
}
|
||||
|
||||
export function getDeclarationOfExpando(node: Node): Node | undefined {
|
||||
if (!node.parent) {
|
||||
return undefined;
|
||||
}
|
||||
let name: Expression | BindingName | undefined;
|
||||
let decl: Node | undefined;
|
||||
if (isVariableDeclaration(node.parent) && node.parent.initializer === node) {
|
||||
if (!isInJSFile(node) && !isVarConst(node.parent)) {
|
||||
return undefined;
|
||||
}
|
||||
name = node.parent.name;
|
||||
decl = node.parent;
|
||||
}
|
||||
else if (isBinaryExpression(node.parent)) {
|
||||
const parentNode = node.parent;
|
||||
const parentNodeOperator = node.parent.operatorToken.kind;
|
||||
if (parentNodeOperator === SyntaxKind.EqualsToken && parentNode.right === node) {
|
||||
name = parentNode.left;
|
||||
decl = name;
|
||||
}
|
||||
else if (parentNodeOperator === SyntaxKind.BarBarToken || parentNodeOperator === SyntaxKind.QuestionQuestionToken) {
|
||||
if (isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) {
|
||||
name = parentNode.parent.name;
|
||||
decl = parentNode.parent;
|
||||
}
|
||||
else if (isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === SyntaxKind.EqualsToken && parentNode.parent.right === parentNode) {
|
||||
name = parentNode.parent.left;
|
||||
decl = name;
|
||||
}
|
||||
|
||||
if (!name || !isBindableStaticNameExpression(name) || !isSameEntityName(name, parentNode.left)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!name || !getExpandoInitializer(node, isPrototypeAccess(name))) {
|
||||
return undefined;
|
||||
}
|
||||
return decl;
|
||||
}
|
||||
|
||||
export function isAssignmentDeclaration(decl: Declaration) {
|
||||
return isBinaryExpression(decl) || isAccessExpression(decl) || isIdentifier(decl) || isCallExpression(decl);
|
||||
}
|
||||
@@ -2120,7 +2127,7 @@ namespace ts {
|
||||
* var min = window.min || {}
|
||||
* my.app = self.my.app || class { }
|
||||
*/
|
||||
function isSameEntityName(name: Expression, initializer: Expression): boolean {
|
||||
export function isSameEntityName(name: Expression, initializer: Expression): boolean {
|
||||
if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) {
|
||||
return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer);
|
||||
}
|
||||
@@ -2730,6 +2737,20 @@ namespace ts {
|
||||
return walkUp(node, SyntaxKind.ParenthesizedExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Walks up parenthesized types.
|
||||
* It returns both the outermost parenthesized type and its parent.
|
||||
* If given node is not a parenthesiezd type, undefined is return as the former.
|
||||
*/
|
||||
export function walkUpParenthesizedTypesAndGetParentAndChild(node: Node): [ParenthesizedTypeNode | undefined, Node] {
|
||||
let child: ParenthesizedTypeNode | undefined;
|
||||
while (node && node.kind === SyntaxKind.ParenthesizedType) {
|
||||
child = <ParenthesizedTypeNode>node;
|
||||
node = node.parent;
|
||||
}
|
||||
return [child, node];
|
||||
}
|
||||
|
||||
export function skipParentheses(node: Expression): Expression;
|
||||
export function skipParentheses(node: Node): Node;
|
||||
export function skipParentheses(node: Node): Node {
|
||||
@@ -3600,6 +3621,19 @@ namespace ts {
|
||||
return -1;
|
||||
}
|
||||
|
||||
export function getSemanticJsxChildren(children: readonly JsxChild[]) {
|
||||
return filter(children, i => {
|
||||
switch (i.kind) {
|
||||
case SyntaxKind.JsxExpression:
|
||||
return !!i.expression;
|
||||
case SyntaxKind.JsxText:
|
||||
return !i.containsOnlyTriviaWhiteSpaces;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function createDiagnosticCollection(): DiagnosticCollection {
|
||||
let nonFileDiagnostics = [] as Diagnostic[] as SortedArray<Diagnostic>; // See GH#19873
|
||||
const filesWithDiagnostics = [] as string[] as SortedArray<string>;
|
||||
@@ -3815,8 +3849,10 @@ namespace ts {
|
||||
|
||||
const indentStrings: string[] = ["", " "];
|
||||
export function getIndentString(level: number) {
|
||||
if (indentStrings[level] === undefined) {
|
||||
indentStrings[level] = getIndentString(level - 1) + indentStrings[1];
|
||||
// prepopulate cache
|
||||
const singleLevel = indentStrings[1];
|
||||
for (let current = indentStrings.length; current <= level; current++) {
|
||||
indentStrings.push(indentStrings[current - 1] + singleLevel);
|
||||
}
|
||||
return indentStrings[level];
|
||||
}
|
||||
@@ -5783,7 +5819,6 @@ namespace ts {
|
||||
if (arguments.length > 2) {
|
||||
text = formatStringFromArgs(text, arguments, 2);
|
||||
}
|
||||
|
||||
return {
|
||||
messageText: text,
|
||||
category: message.category,
|
||||
@@ -5974,8 +6009,8 @@ namespace ts {
|
||||
return jsx === JsxEmit.React || jsx === JsxEmit.ReactJSX || jsx === JsxEmit.ReactJSXDev;
|
||||
}
|
||||
|
||||
export function getJSXImplicitImportBase(compilerOptions: CompilerOptions, file: SourceFile): string | undefined {
|
||||
const jsxImportSourcePragmas = file.pragmas.get("jsximportsource");
|
||||
export function getJSXImplicitImportBase(compilerOptions: CompilerOptions, file?: SourceFile): string | undefined {
|
||||
const jsxImportSourcePragmas = file?.pragmas.get("jsximportsource");
|
||||
const jsxImportSourcePragma = isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[0] : jsxImportSourcePragmas;
|
||||
return compilerOptions.jsx === JsxEmit.ReactJSX ||
|
||||
compilerOptions.jsx === JsxEmit.ReactJSXDev ||
|
||||
@@ -5985,6 +6020,10 @@ namespace ts {
|
||||
undefined;
|
||||
}
|
||||
|
||||
export function getJSXRuntimeImport(base: string | undefined, options: CompilerOptions) {
|
||||
return base ? `${base}/${options.jsx === JsxEmit.ReactJSXDev ? "jsx-dev-runtime" : "jsx-runtime"}` : undefined;
|
||||
}
|
||||
|
||||
export function hasZeroOrOneAsteriskCharacter(str: string): boolean {
|
||||
let seenAsterisk = false;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
@@ -6633,6 +6672,7 @@ namespace ts {
|
||||
if (!diagnostic.relatedInformation) {
|
||||
diagnostic.relatedInformation = [];
|
||||
}
|
||||
Debug.assert(diagnostic.relatedInformation !== emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!");
|
||||
diagnostic.relatedInformation.push(...relatedInformation);
|
||||
return diagnostic;
|
||||
}
|
||||
|
||||
@@ -403,6 +403,28 @@ namespace ts {
|
||||
return !nodeTest || nodeTest(node) ? node : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit"
|
||||
* At that point findAncestor returns undefined.
|
||||
*/
|
||||
export function findAncestor<T extends Node>(node: Node | undefined, callback: (element: Node) => element is T): T | undefined;
|
||||
export function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined;
|
||||
export function findAncestor(node: Node, callback: (element: Node) => boolean | "quit"): Node | undefined {
|
||||
while (node) {
|
||||
const result = callback(node);
|
||||
if (result === "quit") {
|
||||
return undefined;
|
||||
}
|
||||
else if (result) {
|
||||
return node;
|
||||
}
|
||||
node = node.parent;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value indicating whether a node originated in the parse tree.
|
||||
*
|
||||
|
||||
@@ -573,6 +573,16 @@ namespace ts {
|
||||
return factory.updateLiteralTypeNode(<LiteralTypeNode>node,
|
||||
nodeVisitor((<LiteralTypeNode>node).literal, visitor, isExpression));
|
||||
|
||||
case SyntaxKind.TemplateLiteralType:
|
||||
return factory.updateTemplateLiteralType(<TemplateLiteralTypeNode>node,
|
||||
nodeVisitor((<TemplateLiteralTypeNode>node).head, visitor, isTemplateHead),
|
||||
nodesVisitor((<TemplateLiteralTypeNode>node).templateSpans, visitor, isTemplateLiteralTypeSpan));
|
||||
|
||||
case SyntaxKind.TemplateLiteralTypeSpan:
|
||||
return factory.updateTemplateLiteralTypeSpan(<TemplateLiteralTypeSpan>node,
|
||||
nodeVisitor((<TemplateLiteralTypeSpan>node).type, visitor, isTypeNode),
|
||||
nodeVisitor((<TemplateLiteralTypeSpan>node).literal, visitor, isTemplateMiddleOrTemplateTail));
|
||||
|
||||
// Binding patterns
|
||||
case SyntaxKind.ObjectBindingPattern:
|
||||
return factory.updateObjectBindingPattern(<ObjectBindingPattern>node,
|
||||
|
||||
@@ -345,11 +345,11 @@ namespace ts {
|
||||
|
||||
export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: { createHash?(data: string): string; }) {
|
||||
const originalGetSourceFile = compilerHost.getSourceFile;
|
||||
const computeHash = host.createHash || generateDjb2Hash;
|
||||
const computeHash = maybeBind(host, host.createHash) || generateDjb2Hash;
|
||||
compilerHost.getSourceFile = (...args) => {
|
||||
const result = originalGetSourceFile.call(compilerHost, ...args);
|
||||
if (result) {
|
||||
result.version = computeHash.call(host, result.text);
|
||||
result.version = computeHash(result.text);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
@@ -635,7 +635,7 @@ namespace ts {
|
||||
|
||||
function reloadFileNamesFromConfigFile() {
|
||||
writeLog("Reloading new file names and options");
|
||||
const result = getFileNamesFromConfigSpecs(configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost);
|
||||
const result = getFileNamesFromConfigSpecs(configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
||||
if (updateErrorForNoInputFiles(result, getNormalizedAbsolutePath(configFileName, currentDirectory), configFileSpecs, configFileParsingDiagnostics!, canConfigFileJsonReportNoInputFiles)) {
|
||||
hasChangedConfigFileParsingErrors = true;
|
||||
}
|
||||
@@ -748,6 +748,7 @@ namespace ts {
|
||||
fileOrDirectoryPath,
|
||||
configFileName,
|
||||
configFileSpecs,
|
||||
extraFileExtensions,
|
||||
options: compilerOptions,
|
||||
program: getCurrentBuilderProgram(),
|
||||
currentDirectory,
|
||||
|
||||
@@ -648,19 +648,22 @@ namespace ts {
|
||||
reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K");
|
||||
}
|
||||
|
||||
const programTime = performance.getDuration("Program");
|
||||
const bindTime = performance.getDuration("Bind");
|
||||
const checkTime = performance.getDuration("Check");
|
||||
const emitTime = performance.getDuration("Emit");
|
||||
const isPerformanceEnabled = performance.isEnabled();
|
||||
const programTime = isPerformanceEnabled ? performance.getDuration("Program") : 0;
|
||||
const bindTime = isPerformanceEnabled ? performance.getDuration("Bind") : 0;
|
||||
const checkTime = isPerformanceEnabled ? performance.getDuration("Check") : 0;
|
||||
const emitTime = isPerformanceEnabled ? performance.getDuration("Emit") : 0;
|
||||
if (compilerOptions.extendedDiagnostics) {
|
||||
const caches = program.getRelationCacheSizes();
|
||||
reportCountStatistic("Assignability cache size", caches.assignable);
|
||||
reportCountStatistic("Identity cache size", caches.identity);
|
||||
reportCountStatistic("Subtype cache size", caches.subtype);
|
||||
reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
|
||||
performance.forEachMeasure((name, duration) => reportTimeStatistic(`${name} time`, duration));
|
||||
if (isPerformanceEnabled) {
|
||||
performance.forEachMeasure((name, duration) => reportTimeStatistic(`${name} time`, duration));
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (isPerformanceEnabled) {
|
||||
// Individual component times.
|
||||
// Note: To match the behavior of previous versions of the compiler, the reported parse time includes
|
||||
// I/O read time and processing time for triple-slash references and module imports, and the reported
|
||||
@@ -672,10 +675,16 @@ namespace ts {
|
||||
reportTimeStatistic("Check time", checkTime);
|
||||
reportTimeStatistic("Emit time", emitTime);
|
||||
}
|
||||
reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime);
|
||||
if (isPerformanceEnabled) {
|
||||
reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime);
|
||||
}
|
||||
reportStatistics();
|
||||
|
||||
performance.disable();
|
||||
if (!isPerformanceEnabled) {
|
||||
sys.write(Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n");
|
||||
}
|
||||
else {
|
||||
performance.disable();
|
||||
}
|
||||
}
|
||||
|
||||
function reportStatistics() {
|
||||
|
||||
@@ -759,7 +759,18 @@ namespace FourSlash {
|
||||
ts.zipWith(endMarkers, definitions, (endMarker, definition, i) => {
|
||||
const marker = this.getMarkerByName(endMarker);
|
||||
if (ts.comparePaths(marker.fileName, definition.fileName, /*ignoreCase*/ true) !== ts.Comparison.EqualTo || marker.position !== definition.textSpan.start) {
|
||||
this.raiseError(`${testName} failed for definition ${endMarker} (${i}): expected ${marker.fileName} at ${marker.position}, got ${definition.fileName} at ${definition.textSpan.start}`);
|
||||
const filesToDisplay = ts.deduplicate([marker.fileName, definition.fileName], ts.equateValues);
|
||||
const markers = [{ text: "EXPECTED", fileName: marker.fileName, position: marker.position }, { text: "ACTUAL", fileName: definition.fileName, position: definition.textSpan.start }];
|
||||
const text = filesToDisplay.map(fileName => {
|
||||
const markersToRender = markers.filter(m => m.fileName === fileName).sort((a, b) => b.position - a.position);
|
||||
let fileContent = this.getFileContent(fileName);
|
||||
for (const marker of markersToRender) {
|
||||
fileContent = fileContent.slice(0, marker.position) + `\x1b[1;4m/*${marker.text}*/\x1b[0;31m` + fileContent.slice(marker.position);
|
||||
}
|
||||
return `// @Filename: ${fileName}\n${fileContent}`;
|
||||
}).join("\n\n");
|
||||
|
||||
this.raiseError(`${testName} failed for definition ${endMarker} (${i}): expected ${marker.fileName} at ${marker.position}, got ${definition.fileName} at ${definition.textSpan.start}\n\n${text}\n`);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -777,7 +788,7 @@ namespace FourSlash {
|
||||
const fileContent = this.getFileContent(startFile);
|
||||
const spanContent = fileContent.slice(defs.textSpan.start, ts.textSpanEnd(defs.textSpan));
|
||||
const spanContentWithMarker = spanContent.slice(0, marker.position - defs.textSpan.start) + `/*${startMarkerName}*/` + spanContent.slice(marker.position - defs.textSpan.start);
|
||||
const suggestedFileContent = (fileContent.slice(0, defs.textSpan.start) + `\x1b[1;4m[|${spanContentWithMarker}|]\x1b[31m` + fileContent.slice(ts.textSpanEnd(defs.textSpan)))
|
||||
const suggestedFileContent = (fileContent.slice(0, defs.textSpan.start) + `\x1b[1;4m[|${spanContentWithMarker}|]\x1b[0;31m` + fileContent.slice(ts.textSpanEnd(defs.textSpan)))
|
||||
.split(/\r?\n/).map(line => " ".repeat(6) + line).join(ts.sys.newLine);
|
||||
this.raiseError(`goToDefinitionsAndBoundSpan failed. Found a starting TextSpan around '${spanContent}' in '${startFile}' (at position ${defs.textSpan.start}). `
|
||||
+ `If this is the correct input span, put a fourslash range around it: \n\n${suggestedFileContent}\n`);
|
||||
@@ -2461,8 +2472,7 @@ namespace FourSlash {
|
||||
const { fileName } = this.activeFile;
|
||||
const before = this.getFileContent(fileName);
|
||||
this.formatDocument();
|
||||
const after = this.getFileContent(fileName);
|
||||
this.assertObjectsEqual(after, before);
|
||||
this.verifyFileContent(fileName, before);
|
||||
}
|
||||
|
||||
public verifyTextAtCaretIs(text: string) {
|
||||
|
||||
@@ -1065,6 +1065,10 @@ namespace FourSlashInterface {
|
||||
typeEntry("ConstructorParameters"),
|
||||
typeEntry("ReturnType"),
|
||||
typeEntry("InstanceType"),
|
||||
typeEntry("Uppercase"),
|
||||
typeEntry("Lowercase"),
|
||||
typeEntry("Capitalize"),
|
||||
typeEntry("Uncapitalize"),
|
||||
interfaceEntry("ThisType"),
|
||||
varEntry("ArrayBuffer"),
|
||||
interfaceEntry("ArrayBufferTypes"),
|
||||
@@ -1370,6 +1374,7 @@ namespace FourSlashInterface {
|
||||
"let",
|
||||
"package",
|
||||
"yield",
|
||||
"as",
|
||||
"async",
|
||||
"await",
|
||||
].map(keywordEntry);
|
||||
@@ -1510,6 +1515,7 @@ namespace FourSlashInterface {
|
||||
"let",
|
||||
"package",
|
||||
"yield",
|
||||
"as",
|
||||
"async",
|
||||
"await",
|
||||
].map(keywordEntry);
|
||||
|
||||
@@ -1203,9 +1203,11 @@ interface Array<T> { length: number; [n: number]: T; }`
|
||||
}
|
||||
|
||||
function baselineOutputs(baseline: string[], output: readonly string[], start: number, end = output.length) {
|
||||
let baselinedOutput: string[] | undefined;
|
||||
for (let i = start; i < end; i++) {
|
||||
baseline.push(output[i].replace(/Elapsed::\s[0-9]+ms/g, "Elapsed:: *ms"));
|
||||
(baselinedOutput ||= []).push(output[i].replace(/Elapsed::\s[0-9]+(?:\.\d+)?ms/g, "Elapsed:: *ms"));
|
||||
}
|
||||
if (baselinedOutput) baseline.push(baselinedOutput.join(""));
|
||||
}
|
||||
|
||||
export type TestServerHostTrackingWrittenFiles = TestServerHost & { writtenFiles: ESMap<Path, number>; };
|
||||
|
||||
@@ -149,8 +149,9 @@ namespace ts.JsTyping {
|
||||
const nodeModulesPath = combinePaths(searchDir, "node_modules");
|
||||
getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch);
|
||||
});
|
||||
getTypingNamesFromSourceFileNames(fileNames);
|
||||
|
||||
if(!typeAcquisition.disableFilenameBasedTypeAcquisition) {
|
||||
getTypingNamesFromSourceFileNames(fileNames);
|
||||
}
|
||||
// add typings for unresolved imports
|
||||
if (unresolvedImports) {
|
||||
const module = deduplicate<string>(
|
||||
|
||||
Vendored
-4
@@ -7,10 +7,6 @@ interface SharedArrayBuffer {
|
||||
*/
|
||||
readonly byteLength: number;
|
||||
|
||||
/*
|
||||
* The SharedArrayBuffer constructor's length property whose value is 1.
|
||||
*/
|
||||
length: number;
|
||||
/**
|
||||
* Returns a section of an SharedArrayBuffer.
|
||||
*/
|
||||
|
||||
Vendored
+22
-1
@@ -1047,7 +1047,7 @@ interface JSON {
|
||||
/**
|
||||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
||||
* @param value A JavaScript value, usually an object or array, to be converted.
|
||||
* @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.
|
||||
* @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
|
||||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
||||
*/
|
||||
stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
||||
@@ -1508,6 +1508,26 @@ type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => i
|
||||
*/
|
||||
type InstanceType<T extends new (...args: any) => any> = T extends new (...args: any) => infer R ? R : any;
|
||||
|
||||
/**
|
||||
* Convert string literal type to uppercase
|
||||
*/
|
||||
type Uppercase<S extends string> = intrinsic;
|
||||
|
||||
/**
|
||||
* Convert string literal type to lowercase
|
||||
*/
|
||||
type Lowercase<S extends string> = intrinsic;
|
||||
|
||||
/**
|
||||
* Convert first character of string literal type to uppercase
|
||||
*/
|
||||
type Capitalize<S extends string> = intrinsic;
|
||||
|
||||
/**
|
||||
* Convert first character of string literal type to lowercase
|
||||
*/
|
||||
type Uncapitalize<S extends string> = intrinsic;
|
||||
|
||||
/**
|
||||
* Marker for contextual 'this' type
|
||||
*/
|
||||
@@ -4264,6 +4284,7 @@ declare namespace Intl {
|
||||
style?: string;
|
||||
currency?: string;
|
||||
currencyDisplay?: string;
|
||||
currencySign?: string;
|
||||
useGrouping?: boolean;
|
||||
minimumIntegerDigits?: number;
|
||||
minimumFractionDigits?: number;
|
||||
|
||||
Vendored
+1
@@ -2,3 +2,4 @@
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.string" />
|
||||
/// <reference lib="esnext.promise" />
|
||||
/// <reference lib="esnext.weakref" />
|
||||
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
interface WeakRef<T extends object> {
|
||||
readonly [Symbol.toStringTag]: "WeakRef";
|
||||
|
||||
/**
|
||||
* Returns the WeakRef instance's target object, or undefined if the target object has been
|
||||
* reclaimed.
|
||||
*/
|
||||
deref(): T | undefined;
|
||||
}
|
||||
|
||||
interface WeakRefConstructor {
|
||||
readonly prototype: WeakRef<any>;
|
||||
|
||||
/**
|
||||
* Creates a WeakRef instance for the given target object.
|
||||
* @param target The target object for the WeakRef instance.
|
||||
*/
|
||||
new<T extends object>(target?: T): WeakRef<T>;
|
||||
}
|
||||
|
||||
declare var WeakRef: WeakRefConstructor;
|
||||
|
||||
interface FinalizationRegistry {
|
||||
readonly [Symbol.toStringTag]: "FinalizationRegistry";
|
||||
|
||||
/**
|
||||
* Registers an object with the registry.
|
||||
* @param target The target object to register.
|
||||
* @param heldValue The value to pass to the finalizer for this object. This cannot be the
|
||||
* target object.
|
||||
* @param unregisterToken The token to pass to the unregister method to unregister the target
|
||||
* object. If provided (and not undefined), this must be an object. If not provided, the target
|
||||
* cannot be unregistered.
|
||||
*/
|
||||
register(target: object, heldValue: any, unregisterToken?: object): void;
|
||||
|
||||
/**
|
||||
* Unregisters an object from the registry.
|
||||
* @param unregisterToken The token that was used as the unregisterToken argument when calling
|
||||
* register to register the target object.
|
||||
*/
|
||||
unregister(unregisterToken: object): void;
|
||||
}
|
||||
|
||||
interface FinalizationRegistryConstructor {
|
||||
readonly prototype: FinalizationRegistry;
|
||||
|
||||
/**
|
||||
* Creates a finalization registry with an associated cleanup callback
|
||||
* @param cleanupCallback The callback to call after an object in the registry has been reclaimed.
|
||||
*/
|
||||
new(cleanupCallback: (heldValue: any) => void): FinalizationRegistry;
|
||||
}
|
||||
|
||||
declare var FinalizationRegistry: FinalizationRegistryConstructor;
|
||||
@@ -50,6 +50,7 @@
|
||||
"esnext.intl",
|
||||
"esnext.string",
|
||||
"esnext.promise",
|
||||
"esnext.weakref",
|
||||
// Default libraries
|
||||
"es5.full",
|
||||
"es2015.full",
|
||||
|
||||
@@ -1416,6 +1416,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[将 "void" 添加到已解析但没有值的承诺]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[将 "void" 添加到所有已解析但没有值的承诺]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2678,10 +2696,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 es2015 或更高版本。]]></Val>
|
||||
<Val><![CDATA[找不到名称“{0}”。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 {1} 或更高版本。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2694,56 +2715,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装测试运行程序的类型定义? 请尝试使用 `npm i @types/jest` 或 `npm i @types/mocha`。]]></Val>
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装测试运行器的类型定义? 请尝试使用 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装测试运行程序的类型定义? 请尝试使用 `npm i @types/jest` 或 `npm i @types/mocha`,然后在 tsconfig 的 types 字段中添加 `jest` 或 `mocha`。]]></Val>
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装测试运行器的类型定义? 请尝试使用 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`,然后在 tsconfig 的 types 字段中添加 `jest` 或 `mocha`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装 jQuery 的类型定义? 请尝试 `npm i @types/jquery`。]]></Val>
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装 jQuery 的类型定义? 请尝试使用 `npm i --save-dev @types/jquery`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装 jQuery 的类型定义? 请尝试使用 `npm i @types/jquery`,然后在 tsconfig 中将 `jquery` 添加到 types 字段。]]></Val>
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要安装 jQuery 的类型定义? 请尝试使用 `npm i --save-dev @types/jquery`,然后在 tsconfig 中将 `jquery` 添加到 types 字段。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要为节点安装类型定义? 请尝试使用 `npm i @types/node`。]]></Val>
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要为节点安装类型定义? 请尝试使用 `npm i --save-dev @types/node`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要为节点安装类型定义? 请尝试使用 `npm i @types/node`,然后在 tsconfig 中将 "node" 添加到 types 字段。]]></Val>
|
||||
<Val><![CDATA[找不到名称 "{0}"。是否需要为节点安装类型定义? 请尝试使用 `npm i --save-dev @types/node`,然后在 tsconfig 中将 `node` 添加到 types 字段。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3939,6 +3960,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[具有明确赋值断言的声明也必须具有类型批注。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[具有初始值设定项的声明不能同时具有明确赋值断言。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4041,15 +4080,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[明确赋值断言只能与类型注释一起使用。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4881,6 +4911,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[应为 {0} 个参数,但得到的却是 {1} 个。你是否忘了将类型参数中的 "void" 包含到 "Promise"?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6378,6 +6417,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[很可能缺少了分隔这两个模板表达式的逗号。它们构成了无法调用的带标记的模板表达式。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8178,6 +8226,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["--diagnostics" 或 "--extendedDiagnostics" 的性能计时在此会话中不可用。未能找到 Web 性能 API 的本机实现。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8463,6 +8520,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[在“{1}”上没有“{0}”属性。是否需要更改目标库? 请尝试将 `lib` 编译器选项更改为 {2} 或更高版本。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10257,15 +10323,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[模板文本类型参数“{0}”不是文本类型或泛型类型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10356,6 +10413,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[针对此实现的调用已成功,但重载的实现签名在外部不可见。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10521,6 +10587,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[此节点的推断类型超出编译器将序列化的最大长度。需要显式类型注释。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10539,6 +10614,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["intrinsic" 关键字只能用于声明编译器提供的内部类型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11238,11 +11322,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[尝试 `npm install @types/{1}` (如果存在),或者添加一个包含 `declare module '{0}';` 的新声明(.d.ts)文件]]></Val>
|
||||
<Val><![CDATA[尝试使用 `npm i --save-dev @types/{1}` (如果存在),或者添加一个包含 `declare module '{0}';` 的新声明(.d.ts)文件]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12825,15 +12909,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[“{0}”修饰符不能出现在类元素上。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12888,6 +12963,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[“{0}”修饰符不能出现在此类型的类元素上。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1416,6 +1416,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[為已經解析但不具值的 Promise 新增 'void']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[為已經解析但不具值的所有 Promise 新增 'void']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2678,10 +2696,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要變更您的目標程式庫嗎? 請嘗試將 `lib` 編譯器選項變更為 es2015 或更新版本。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。要變更您的目標程式庫嗎? 請嘗試將 'lib' 編譯器選項變更為 '{1}' 或更新版本。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2694,56 +2715,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝測試執行器的類型定義嗎? 請嘗試 `npm i @types/jest` 或 `npm i @types/mocha`。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝測試執行器的型別定義嗎? 請嘗試 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝測試執行器的類型定義嗎? 請嘗試 `npm i @types/jest` 或 `npm i @types/mocha`,然後將 `jest` 或 `mocha` 新增至 tsconfig 中的類型欄位。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝測試執行器的型別定義嗎? 請嘗試 `npm i --save-dev @types/jest` 或 `npm i --save-dev @types/mocha`,然後將 `jest` 或 `mocha` 新增至 tsconfig 中的型別欄位。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝 jQuery 的類型定義嗎? 請嘗試 `npm i @types/jquery`。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝 jQuery 的型別定義嗎? 請嘗試 `npm i --save-dev @types/jquery`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。您需要安裝 jQuery 的類型定義嗎? 請嘗試 `npm i @types/jquery`,然後將 `jquery` 新增至 tsconfig 中的類型欄位。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝 jQuery 的型別定義嗎? 請嘗試 `npm i --save-dev @types/jquery`,然後將 `jquery` 新增至 tsconfig 中的型別欄位。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝節點的類型定義嗎? 請嘗試 `npm i @types/node`。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝節點的型別定義嗎? 請嘗試 `npm i --save-dev @types/node`。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝節點的類型定義嗎? 請嘗試 `npm i @types/node`,然後將 `node` 新增至 tsconfig 中的類型欄位。]]></Val>
|
||||
<Val><![CDATA[找不到名稱 '{0}'。需要安裝節點的型別定義嗎? 請嘗試 `npm i --save-dev @types/node`,然後將 `node` 新增至 tsconfig 中的型別欄位。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3454,7 +3475,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to '{1} in {0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[將 '{0}' 轉換成「{0} 中的 {1}」]]></Val>
|
||||
<Val><![CDATA[將 '{0}' 轉換成 '{1} in {0}']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3939,6 +3960,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[包含明確指派判斷提示的宣告也必須包含類型註釋。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[包含初始設定式的宣告不得同時包含明確指派判斷提示。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4041,15 +4080,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[明確的指派判斷提示只可搭配型別註解使用。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4881,6 +4911,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[應為 {0} 個引數,但現有 {1} 個。是否忘記將型別引數中的 'void' 納入 'Promise' 中?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6378,6 +6417,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[可能是未使用逗號分隔這兩個範本運算式,因而形成了附加標籤的範本運算式,導致無法叫用。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8178,6 +8226,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[在此工作階段中無法使用 '--diagnostics ' 或 '--extendedDiagnostics ' 的效能計時。找不到 Web 效能 API 的原生實作。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8463,6 +8520,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[類型 '{1}' 沒有屬性 '{0}'。要變更您的目標程式庫嗎? 請嘗試將 'lib' 編譯器選項變更為 '{2}' 或更新版本。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10189,7 +10255,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Switch each misused '{0}' to '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[將每個誤用的 '{0}' 切換為 '{1}']]></Val>
|
||||
<Val><![CDATA[將每個誤用的 '{0}' 切換成 '{1}']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10257,15 +10323,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[樣板常值型別引數 ' {0} ' 不是常值型別或泛型型別。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10356,6 +10413,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[對此實作的呼叫會成功,但多載的實作簽章未向外部顯示。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10521,6 +10587,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[此節點的推斷型別超過編譯器將序列化的長度上限。需要明確的型別註解。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10539,6 +10614,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['intrinsic' 關鍵字只可用於宣告編譯器提供的內建類型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11238,11 +11322,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[如有 `npm install @types/{1}`,請嘗試使用,或新增包含 `declare module '{0}';` 的宣告 (.d.ts) 檔案]]></Val>
|
||||
<Val><![CDATA[如有 `npm i --save-dev @types/{1}`,請嘗試使用,或新增包含 `declare module '{0}';` 的宣告 (.d.ts) 檔案]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12825,15 +12909,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[類別項目不得有 '{0}' 修飾元。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12888,6 +12963,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[不得在此種類別項目中使用 '{0}' 修飾元。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1425,6 +1425,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Přidat void k objektu Promise vyřešenému bez hodnoty]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Přidat void ke všem objektům Promise vyřešeným bez hodnoty]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2687,10 +2705,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na es2015 nebo novější.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na {1} nebo novější.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2703,56 +2724,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i @types/jest nebo npm i @types/mocha.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i --save-dev @types/jest nebo npm i --save-dev @types/mocha.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i @types/jest nebo npm i @types/mocha a pak do polí typů v tsconfig přidejte jest nebo mocha.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro spouštěč testů? Zkuste npm i --save-dev @types/jest nebo npm i --save-dev @types/mocha a pak do polí typů v tsconfig přidejte jest nebo mocha.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i @types/jquery.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i --save-dev @types/jquery.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i @types/jquery a pak pro pole typů v tsconfig přidejte jquery.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro jQuery? Zkuste npm i --save-dev @types/jquery a pak pro pole typů v tsconfig přidejte jquery.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i @types/node.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i --save-dev @types/node.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i @types/node a pak do pole typů v tsconfig přidejte node.]]></Val>
|
||||
<Val><![CDATA[Nepovedlo se najít název {0}. Potřebujete nainstalovat definice typů pro Node? Zkuste npm i --save-dev @types/node a pak do pole typů v tsconfig přidejte node.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3948,6 +3969,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklarace s kontrolními výrazy jednoznačného přiřazení musí mít také anotace typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklarace s inicializátory nemůžou mít také kontrolní výrazy jednoznačného přiřazení.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4050,15 +4089,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Jednoznačné kontrolní výrazy přiřazení se dají použít jen spolu s anotací typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4890,6 +4920,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Očekával se tento počet argumentů: {0}, ale byl přijat tento počet: {1}. Nezapomněli jste zahrnout void do argumentu typu pro objekt Promise?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6387,6 +6426,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pravděpodobně chybí čárka, která by oddělila tyto dva výrazy šablony. Tvoří výraz šablony se značkami, který se nedá vyvolat.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8187,6 +8235,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Časování výkonu pro --diagnostics nebo --extendedDiagnostics nejsou v této relaci k dispozici. Nepovedlo se najít nativní implementace rozhraní Web Performance API.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8472,6 +8529,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Vlastnost {0} neexistuje u typu {1}. Potřebujete změnit cílovou knihovnu? Zkuste změnit možnost kompilátoru lib na {2} nebo novější.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10266,15 +10332,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Argument typu literálu šablony {0} není literálového ani generického typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10365,6 +10422,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Volání by pro tuto implementaci proběhlo úspěšně, ale signatury implementace pro přetížení nejsou externě k dispozici.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10530,6 +10596,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Odvozený typ tohoto uzlu přesahuje maximální délku, kterou kompilátor může serializovat. Je potřeba zadat explicitní anotaci typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10548,6 +10623,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Klíčové slovo intrinsic se dá použít jenom k deklaraci vnitřních typů poskytovaných kompilátorem.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11247,11 +11331,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Vyzkoušejte deklaraci npm install @types/{1}, pokud existuje, nebo přidejte nový soubor deklarací (.d.ts) s deklarací declare module '{0}';.]]></Val>
|
||||
<Val><![CDATA[Vyzkoušejte deklaraci npm i --save-dev @types/{1}, pokud existuje, nebo přidejte nový soubor deklarací (.d.ts) s deklarací declare module '{0}';.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12834,15 +12918,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Modifikátor {0} se nemůže objevit v elementu třídy.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12897,6 +12972,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Modifikátor {0} se nemůže objevit u elementů třídy tohoto typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1413,6 +1413,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["Void" zu ohne Wert aufgelöstem Promise hinzufügen]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["Void" allen ohne Wert aufgelösten Promises hinzufügen]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2675,10 +2693,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption "lib" in "es2015" oder höher.]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption "lib" in "{1}" oder höher.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2691,56 +2712,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit "npm i @types/jest" oder "npm i @types/mocha".]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit "npm i --save-dev @types/jest" oder "npm i --save-dev @types/mocha".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit "npm i @types/jest" oder "npm i @types/mocha", und fügen Sie dann "jest" oder "mocha" zum Typenfeld in Ihrer tsconfig-Datei hinzu.]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für einen Test Runner installieren? Versuchen Sie es mit "npm i --save-dev @types/jest" oder "npm i --save-dev @types/mocha", und fügen Sie dann dem Typenfeld in Ihrer tsconfig-Datei "jest" oder "mocha" hinzu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit "npm i @types/jquery".]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit "npm i --save-dev @types/jquery".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit "npm i @types/jquery", und fügen Sie dann "jquery" zum Typenfeld in Ihrer tsconfig-Datei hinzu.]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für jQuery installieren? Versuchen Sie es mit "npm i --save-dev @types/jquery", und fügen Sie dann dem Typenfeld in Ihrer tsconfig-Datei "jquery" hinzu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit "npm i @types/node".]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit "npm i --save-dev @types/node".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit "npm i @types/node", und fügen Sie dann "node" zum Typenfeld in Ihrer tsconfig-Datei hinzu.]]></Val>
|
||||
<Val><![CDATA[Der Name "{0}" wurde nicht gefunden. Müssen Sie Typdefinitionen für Node installieren? Versuchen Sie es mit "npm i --save-dev @types/node", und fügen Sie dann dem Typenfeld in Ihrer tsconfig-Datei "node" hinzu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3936,6 +3957,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklarationen mit definitiven Zuweisungsassertionen müssen auch Typanmerkungen aufweisen.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklarationen mit Initialisierern dürfen keine definitiven Zuweisungsassertionen aufweisen.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4038,15 +4077,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Definitive Zuweisungsassertionen können nur zusammen mit einer Typanmerkung verwendet werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4878,6 +4908,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Es wurden {0} Argumente erwartet, aber {1} erhalten. Sollte "void" in Ihr Typargument in "Promise" eingeschlossen werden?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6375,6 +6414,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Möglicherweise fehlt ein Komma, um diese beiden Vorlagenausdrücke zu trennen. Sie bilden einen Vorlagenausdruck mit Tags, der nicht aufgerufen werden kann.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8172,6 +8220,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Leistungsdaten zum zeitlichen Ablauf sind für "--diagnostics" oder "--extendedDiagnostics" in dieser Sitzung nicht verfügbar. Eine native Implementierung der Webleistungs-API wurde nicht gefunden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8457,6 +8514,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die Eigenschaft "{0}" ist für den Typ "{1}" nicht vorhanden. Müssen Sie Ihre Zielbibliothek ändern? Ändern Sie die Compileroption "lib" in "{2}" oder höher.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10251,15 +10317,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Das Typargument "{0}" des Vorlagenliterals ist weder ein Literaltyp noch ein generischer Typ.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10350,6 +10407,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Aufruf wäre für diese Implementierung erfolgreich, aber die Implementierungssignaturen von Überladungen sind nicht extern sichtbar.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10515,6 +10581,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der abgeleitete Typ dieses Knotens überschreitet die maximale Länge, die vom Compiler serialisiert wird. Eine explizite Typanmerkung ist erforderlich.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10533,6 +10608,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Das Schlüsselwort "intrinsic" darf nur zum Deklarieren von vom Compiler bereitgestellten intrinsischen Typen verwendet werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11232,11 +11316,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Versuchen Sie es mit "npm install @types/{1}", sofern vorhanden, oder fügen Sie eine neue Deklarationsdatei (.d.ts) hinzu, die "declare module '{0}';" enthält.]]></Val>
|
||||
<Val><![CDATA[Versuchen Sie es mit "npm i --save-dev @types/{1}", sofern vorhanden, oder fügen Sie eine neue Deklarationsdatei (.d.ts) hinzu, die "declare module '{0}';" enthält.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12819,15 +12903,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Modifizierer "{0}" darf nicht für ein Klassenelement verwendet werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12882,6 +12957,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Modifizierer "{0}" kann nicht für Klassenelemente dieser Art verwendet werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1428,6 +1428,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Agregar "void" a la instancia de Promise resuelta sin un valor]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Agregar "void" a todas las instancias de Promise resueltas sin un valor]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2690,10 +2708,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador "lib" a es2015 o posterior.]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador "lib" a "{1}" o posterior.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2706,56 +2727,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe "npm i @types/jest" o "npm i @types/mocha".]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe "npm i --save-dev @types/jest" o "npm i --save-dev @types/mocha".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe "npm i @types/jest" o "npm i @types/mocha" y, a continuación, agregue "jest" o "mocha" al campo de tipos del archivo tsconfig.]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para un ejecutor de pruebas? Pruebe "npm i --save-dev @types/jest" o "npm i --save-dev @types/mocha" y, a continuación, agregue "jest" o "mocha" al campo de tipos del archivo tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe "npm i @types/jquery".]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe "npm i --save-dev @types/jquery".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe "npm i @types/jquery" y, a continuación, agregue "jquery" al campo de tipos del archivo tsconfig.]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para jQuery? Pruebe "npm i --save-dev @types/jquery" y, a continuación, agregue "jquery" al campo de tipos del archivo tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe "npm i @types/node".]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe "npm i --save-dev @types/node".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe "npm i @types/node" y, a continuación, agregue "node" al campo de tipos del archivo tsconfig.]]></Val>
|
||||
<Val><![CDATA[No se encuentra el nombre "{0}". ¿Necesita instalar definiciones de tipo para el nodo? Pruebe "npm i --save-dev @types/node" y, a continuación, agregue "node" al campo de tipos del archivo tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3466,7 +3487,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to '{1} in {0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Convertir "{0}" en "{1} en "{0}"]]></Val>
|
||||
<Val><![CDATA[Convertir "{0}" a "{1} en "{0}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3951,6 +3972,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Las declaraciones con aserciones de asignación definitiva deben tener también anotaciones de tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Las declaraciones con inicializadores no pueden tener también aserciones de asignación definitiva.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4053,15 +4092,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Las aserciones de asignación definitiva solo se pueden usar junto con una anotación de tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4893,6 +4923,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Se esperaban {0} argumentos, pero se obtuvo un total de {1}. ¿Olvidó incluir "void" en el argumento de tipo para "Promise"?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6390,6 +6429,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Es probable que falte una coma para separar estas dos expresiones de plantilla. Forman una expresión de plantilla con etiquetas que no se puede invocar.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8190,6 +8238,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Los intervalos de rendimiento de "--diagnostics" o "--extendedDiagnostics" no están disponibles en esta sesión. No se encontró ninguna implementación nativa de la API de rendimiento web.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8475,6 +8532,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No existe la propiedad "{0}" en el tipo "{1}". ¿Necesita cambiar la biblioteca de destino? Pruebe a cambiar la opción del compilador "lib" a "{2}" o posterior.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -9115,7 +9181,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused declarations for: '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Quitar las declaraciones sin usar para "{0}"]]></Val>
|
||||
<Val><![CDATA[Quite las declaraciones sin usar para "{0}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -9124,7 +9190,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused destructuring declaration]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Quitar la declaración de desestructuración no utilizada]]></Val>
|
||||
<Val><![CDATA[Quite la declaración de desestructuración no utilizada]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10201,7 +10267,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Switch each misused '{0}' to '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Cambiar cada elemento "{0}" usado incorrectamente a "{1}"]]></Val>
|
||||
<Val><![CDATA[Cambie cada elemento "{0}" usado incorrectamente a "{1}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10269,15 +10335,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El argumento de tipo de literal de plantilla "{0}" no es un tipo literal ni un tipo genérico.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10368,6 +10425,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La llamada se llevaría a cabo sin problemas en esta implementación, pero las signaturas de implementación de las sobrecargas no están visibles externamente.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10533,6 +10599,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El tipo inferido de este nodo supera la longitud máxima que el compilador podrá serializar. Se necesita una anotación de tipo explícito.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10551,6 +10626,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La palabra clave "intrinsic" solo se puede usar para declarar tipos intrínsecos proporcionados por el compilador.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11250,11 +11334,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pruebe "npm install @types/{1}" si existe o agregue un nuevo archivo de declaración (.d.ts) que incluya "declare module '{0}';".]]></Val>
|
||||
<Val><![CDATA[Pruebe "npm i --save-dev @types/{1}" si existe o agregue un nuevo archivo de declaración (.d.ts) que incluya "declare module '{0}';".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12837,15 +12921,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El modificador '{0}' no puede aparecer en un elemento de clase.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12900,6 +12975,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El modificador "{0}" no puede aparecer en elementos de clase de este tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1428,6 +1428,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ajouter 'void' à un Promise résolu sans valeur]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ajouter 'void' à toutes les promesses résolues sans valeur]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2690,10 +2708,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous changer votre bibliothèque cible ? Essayez de remplacer l'option de compilateur 'lib' par es2015 ou une version ultérieure.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous changer votre bibliothèque cible ? Essayez de changer l'option de compilateur 'lib' en '{1}' ou une version ultérieure.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2706,56 +2727,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i @types/jest' ou 'npm i @types/mocha'.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i --save-dev @types/jest' ou 'npm i --save-dev @types/mocha'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i @types/jest' ou 'npm i @types/mocha', puis ajoutez 'jest' ou 'mocha' au champ types de votre fichier tsconfig.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour un exécuteur de tests ? Essayez 'npm i --save-dev @types/jest' ou 'npm i --save-dev @types/mocha', puis ajoutez 'jest' ou 'mocha' au champ types de votre fichier tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i @types/jquery'.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i --save-dev @types/jquery'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i @types/jquery', puis ajoutez 'jquery' au champ types de votre fichier tsconfig.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour jQuery ? Essayez 'npm i --save-dev @types/jquery', puis ajoutez 'jquery' au champ types de votre fichier tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i @types/node'.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i --save-dev @types/node'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i @types/node', puis ajoutez 'node' au champ types de votre fichier tsconfig.]]></Val>
|
||||
<Val><![CDATA[Le nom '{0}' est introuvable. Devez-vous installer des définitions de type pour node ? Essayez 'npm i --save-dev @types/node', puis ajoutez 'node' au champ types de votre fichier tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3951,6 +3972,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Les déclarations avec des assertions d'affectation définies doivent également avoir des annotations de type.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Les déclarations avec des initialiseurs ne peuvent pas avoir également des assertions d'affectation définies.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4053,15 +4092,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Les assertions d'assignation définies peuvent être utilisées uniquement avec une annotation de type.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4893,6 +4923,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0} arguments attendus, mais {1} reçus. Avez-vous oublié d'inclure 'void' dans votre argument de type pour 'Promise' ?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6390,6 +6429,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il manque probablement une virgule pour séparer ces deux expressions de modèle. Elles forment une expression de modèle étiquetée qui ne peut pas être appelée.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8190,6 +8238,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Les minutages de performances pour '--diagnostics' ou '--extendedDiagnostics' ne sont pas disponibles dans cette session. Une implémentation native de l'API de performances web est introuvable.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8475,6 +8532,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La propriété '{0}' n'existe pas sur le type '{1}'. Devez-vous changer votre bibliothèque cible ? Essayez de changer l'option de compilateur 'lib' en '{2}' ou une version ultérieure.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -9115,7 +9181,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused declarations for: '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Supprimer les déclarations inutilisées pour : '{0}']]></Val>
|
||||
<Val><![CDATA[Supprimer les déclarations inutilisées pour '{0}']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10269,15 +10335,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[L'argument de type littéral de modèle '{0}' n'est pas un type littéral ou un type générique.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10368,6 +10425,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[L'appel aurait pu réussir sur cette implémentation, mais les signatures de surcharges de l'implémentation ne sont pas visibles en externe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10497,11 +10563,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_esnext_or_system_1343" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_or_system_1343" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'import.meta' meta-property is only allowed when the '--module' option is 'esnext' or 'system'.]]></Val>
|
||||
<Val><![CDATA[The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La métapropriété 'import.meta' est autorisée uniquement quand l'option '--module' a la valeur 'esnext' ou 'system'.]]></Val>
|
||||
<Val><![CDATA[La métapropriété 'import.meta' est autorisée uniquement quand l'option '--module' a la valeur 'es2020', 'esnext' ou 'system'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10533,6 +10599,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le type déduit de ce nœud dépasse la longueur maximale que le compilateur va sérialiser. Une annotation de type explicite est nécessaire.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10551,6 +10626,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le mot clé 'intrinsic' peut uniquement être utilisé pour déclarer les types intrinsèques fournis par le compilateur.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11250,11 +11334,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Essayez 'npm install @types/{1}' s'il existe, ou ajoutez un nouveau fichier de déclaration (.d.ts) contenant 'declare module '{0}';']]></Val>
|
||||
<Val><![CDATA[Essayez 'npm i --save-dev @types/{1}' s'il existe, ou ajoutez un nouveau fichier de déclaration (.d.ts) contenant 'declare module '{0}';']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12837,15 +12921,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le modificateur '{0}' ne peut pas apparaître dans un élément de classe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12900,6 +12975,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le modificateur '{0}' ne peut pas apparaître sur les éléments de classe de ce genre.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1416,6 +1416,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aggiungere 'void' all'elemento Promise risolto senza un valore]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aggiungere 'void' a tutti gli elementi Promise risolti senza un valore]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2678,10 +2696,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su es2015 o versioni successive.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su '{1}' o versioni successive.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2694,56 +2715,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i @types/jest` o `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i --save-dev @types/jest` o `npm i --save-dev @types/mocha`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i @types/jest` o `npm i @types/mocha` e quindi aggiungere `jest` o `mocha` al campo types in tsconfig.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per un test runner? Provare con `npm i --save-dev @types/jest` o `npm i --save-dev @types/mocha` e quindi aggiungere `jest` o `mocha` al campo types in tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i --save-dev @types/jquery`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i @types/jquery` e quindi aggiungere `jquery` al campo types in tsconfig.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per jQuery? Provare con `npm i --save-dev @types/jquery` e quindi aggiungere `jquery` al campo types in tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i --save-dev @types/node`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i @types/node` e quindi aggiungere `node` al campo types in tsconfig.]]></Val>
|
||||
<Val><![CDATA[Non è possibile trovare il nome '{0}'. È necessario installare le definizioni di tipo per il nodo? Provare con `npm i --save-dev @types/node` e quindi aggiungere `node` al campo types in tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3939,6 +3960,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le dichiarazioni con asserzioni di assegnazione definite devono includere anche annotazioni di tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le dichiarazioni con inizializzatori non possono includere anche asserzioni di assegnazione definite.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4041,15 +4080,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le asserzioni di assegnazione definite possono essere usate solo con un'annotazione di tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4881,6 +4911,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Sono previsti {0} argomenti, ma ne sono stati ottenuti {1}. Si è dimenticato di includere 'void' nell'argomento di tipo per 'Promise'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6378,6 +6417,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[È probabile che manchi una virgola per separare queste due espressioni di modello. Costituiscono un'espressione di modello con tag che non può essere richiamata.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8178,6 +8226,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Gli intervalli delle prestazioni per '--Diagnostics' o '--extendedDiagnostics' non sono disponibili in questa sessione. Non è stato possibile trovare un'implementazione nativa dell'API Prestazioni Web.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8463,6 +8520,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La proprietà '{0}' non esiste nel tipo '{1}'. È necessario modificare la libreria di destinazione? Provare a impostare l'opzione `lib` del compilatore su '{2}' o versioni successive.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10257,15 +10323,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[L'argomento '{0}' del tipo di valore letterale del modello non è un tipo di valore letterale o generico.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10356,6 +10413,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La chiamata sarebbe riuscita rispetto a questa implementazione, ma le firme di implementazione degli overload non sono visibili esternamente.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10521,6 +10587,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il tipo dedotto di questo nodo supera la lunghezza massima serializzata dal compilatore. È necessaria un'annotazione di tipo esplicita.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10539,6 +10614,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La parola chiave 'intrinsic' può essere usata solo per dichiarare tipi intrinseci forniti dal compilatore.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11238,11 +11322,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Provare con `npm install @types/{1}` se esiste oppure aggiungere un nuovo file di dichiarazione con estensione d.ts contenente `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Provare con `npm i --save-dev @types/{1}` se esiste oppure aggiungere un nuovo file di dichiarazione con estensione d.ts contenente `declare module '{0}';`]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12825,15 +12909,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il modificatore '{0}' non può essere incluso in un elemento classe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12888,6 +12963,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il modificatore '{0}' non può essere incluso in elementi di classe di questo tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1416,6 +1416,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[値なしで解決された Promise に 'void' を追加します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[値なしで解決されたすべての Promise に 'void' を追加します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2678,10 +2696,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。ターゲット ライブラリを変更しますか? `lib` コンパイラ オプションを es2015 以降に変更してみてください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。ターゲット ライブラリを変更する必要がありますか? `lib` コンパイラ オプションを '{1}' 以降に変更してみてください。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2694,56 +2715,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールしますか? `npm i @types/jest` または `npm i @types/mocha` を試してみてください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールする必要がありますか? `npm i --save-dev @types/jest` または `npm i --save-dev @types/mocha` をお試しください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールしますか? `npm i @types/jest` または `npm i @types/mocha` を試してから、tsconfig の型フィールドに `jest` または `mocha` を追加してください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。テスト ランナーの型定義をインストールする必要がありますか? `npm i --save-dev @types/jest` または `npm i --save-dev @types/mocha` を試してから、お客様の tsconfig の型フィールドに `jest` または `mocha` を追加してください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。jQuery の型定義をインストールしますか? `npm i @types/jquery` を試してみてください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。jQuery の型定義をインストールする必要がありますか? `npm i --save-dev @types/jquery` をお試しください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。jQuery の型定義をインストールしますか? `npm i @types/jquery` を試してから、tsconfig の型フィールドに `jquery` を追加してみてください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。jQuery の型定義をインストールする必要がありますか? `npm i --save-dev @types/jquery` を試してから、お客様の tsconfig の型フィールドに `jquery` を追加してみてください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。ノードの型定義をインストールしますか? `npm i @types/node` を試してみてください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。ノードの型定義をインストールする必要がありますか? `npm i --save-dev @types/node` をお試しください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。ノードの型定義をインストールしますか? `npm i @types/node` を試してから、tsconfig の型フィールドに `node` を追加してみてください。]]></Val>
|
||||
<Val><![CDATA[名前 '{0}' が見つかりません。ノードの型定義をインストールする必要がありますか? `npm i --save-dev @types/node` を試してから、お客様の tsconfig の型フィールドに `node` を追加してみてください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3454,7 +3475,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Convert '{0}' to '{1} in {0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' で '{0}' を '{1}' に変換します]]></Val>
|
||||
<Val><![CDATA['{0}' を '{0} の {1}' に変換します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3939,6 +3960,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[明確な代入アサーションを使った宣言には、型の注釈も指定する必要があります。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[初期化子を使った宣言に明確な代入アサーションを含めることはできません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4041,15 +4080,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[明確な代入アサーションを使用できるのは、型の注釈と共に使用する場合のみです。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4881,6 +4911,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0} 引数が必要ですが、{1} が指定されました。'Promise' の型引数に 'void' を含めましたか?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6378,6 +6417,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[これら 2 つのテンプレート式を区切るコンマが不足している可能性があります。タグ付きテンプレート式を形成しており、呼び出すことができません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8178,6 +8226,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['--diagnostics' または '--extendedDiagnostics' のパフォーマンスのタイミングは、このセッションでは使用できません。Web パフォーマンス API のネイティブ実装が見つかりませんでした。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8463,6 +8520,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[プロパティ '{0}' が型 '{1}' に存在しません。ターゲット ライブラリを変更する必要がありますか? 'lib' コンパイラ オプションを '{2}' 以降に変更してみてください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -9103,7 +9169,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused declarations for: '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' に対する使用されていない宣言を削除する]]></Val>
|
||||
<Val><![CDATA['{0}' に対する使用されていない宣言を削除してください]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -9112,7 +9178,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused destructuring declaration]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[未使用の非構造化宣言を削除する]]></Val>
|
||||
<Val><![CDATA[使用されていない非構造化宣言を削除してください]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10189,7 +10255,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Switch each misused '{0}' to '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[誤用されている各 '{0}' を '{1}' に切り替える]]></Val>
|
||||
<Val><![CDATA[誤用されている各 '{0}' を '{1}' に切り替えてください]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10257,15 +10323,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[テンプレート リテラル型の引数 '{0}' がリテラル型またはジェネリック型ではありません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10356,6 +10413,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[呼び出しはこの実装に対して成功した可能性がありますが、オーバーロードの実装シグネチャは外部からは参照できません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10521,6 +10587,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[このノードの推定型は、コンパイラがシリアル化する最大長を超えています。明示的な型の注釈が必要です。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10539,6 +10614,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['組み込み' キーワードは、コンパイラが提供する組み込み型を宣言する場合にのみ使用できます。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11238,11 +11322,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[存在する場合は `npm install @types/{1}` を試してください。または、`declare module '{0}';` を含む新しい宣言 (.d.ts) ファイルを追加します。]]></Val>
|
||||
<Val><![CDATA[存在する場合は `npm i --save-dev @types/{1}` を試すか、`declare module '{0}';` を含む新しい宣言 (.d.ts) ファイルを追加します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12825,15 +12909,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 修飾子はクラス要素では使用できません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12888,6 +12963,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 修飾子はこの種類のクラス要素では使用できません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1416,6 +1416,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[값 없이 확인된 Promise에 'void' 추가]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[값 없이 확인된 모든 Promise에 'void' 추가]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2678,10 +2696,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 대상 라이브러리를 변경하려는 경우 'lib' 컴파일러 옵션을 es2015 이상으로 변경해 봅니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 대상 라이브러리를 변경하려는 경우 'lib' 컴파일러 옵션을 '{1}' 이상으로 변경해 보세요.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2694,56 +2715,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i @types/jest' 또는 'npm i @types/mocha'를 시도해 봅니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jest' 또는 'npm i --save-dev @types/mocha'를 시도합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i @types/jest' 또는 'npm i @types/mocha'를 시도한 다음, tsconfig의 형식 필드에 'jest' 또는 'mocha'를 추가합니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 테스트 실행기의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jest' 또는 'npm i --save-dev @types/mocha'를 시도한 다음, tsconfig의 형식 필드에 'jest' 또는 'mocha'를 추가합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i @types/jquery'를 시도합니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jquery'를 시도합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i @types/jquery'를 시도한 다음, tsconfig의 형식 필드에 'jquery'를 추가합니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. jQuery의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/jquery'를 시도한 다음, tsconfig의 형식 필드에 'jquery'를 추가합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i @types/node'를 시도합니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/node'를 시도합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i @types/node'를 시도한 다음, tsconfig의 형식 필드에 'node'를 추가합니다.]]></Val>
|
||||
<Val><![CDATA['{0}' 이름을 찾을 수 없습니다. 노드의 형식 정의를 설치하려는 경우 'npm i --save-dev @types/node'를 시도한 다음, tsconfig의 형식 필드에 'node'를 추가합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3939,6 +3960,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[한정된 할당 어설션이 포함된 선언에는 형식 주석도 있어야 합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이니셜라이저가 포함된 선언에는 한정적 할당 어설션을 사용할 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4041,15 +4080,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[한정된 할당 어설션은 형식 주석과 함께여야만 사용할 수 있습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4881,6 +4911,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0}개 인수가 필요한데 {1}개를 가져왔습니다. 'void'를 'Promise'의 형식 인수에 포함하는 것을 잊으셨습니까?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6378,6 +6417,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[두 템플릿 식을 구분할 쉼표가 없는 것 같습니다. 이 두 템플릿 식은 태그가 지정된 호출 불가능한 하나의 템플릿 식을 구성합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8178,6 +8226,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 세션에서는 '--diagnostics' 또는 '--extendedDiagnostics'에 대해 성능 타이밍을 사용할 수 없습니다. Web Performance API의 네이티브 구현을 찾을 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8463,6 +8520,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 속성이 '{1}' 형식에 없습니다. 대상 라이브러리를 변경해야 하는 경우 'lib' 컴파일러 옵션을 '{2}' 이상으로 변경해 보세요.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10257,15 +10323,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[템플릿 리터럴 형식 인수 '{0}'은(는) 리터럴 형식 또는 제네릭 형식이 아닙니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10356,6 +10413,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 구현에 대한 호출이 성공하겠지만, 오버로드의 구현 시그니처는 외부에 표시되지 않습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10521,6 +10587,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 노드의 유추된 형식이 컴파일러가 직렬화할 최대 길이를 초과합니다. 명시적 형식 주석이 필요합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10539,6 +10614,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['내장' 키워드는 컴파일러에서 제공하는 내장 형식을 선언하는 데에만 사용할 수 있습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11238,11 +11322,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[해당 항목이 있는 경우 'npm install @types/{1}'을(를) 시도하거나, 'declare module '{0}';'을(를) 포함하는 새 선언(.d.ts) 파일 추가]]></Val>
|
||||
<Val><![CDATA[해당 항목이 있는 경우 'npm i --save-dev @types/{1}'을(를) 시도하거나, 'declare module '{0}';'을(를) 포함하는 새 선언(.d.ts) 파일 추가]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12825,15 +12909,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 한정자는 클래스 요소에 나타날 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12888,6 +12963,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 종류의 클래스 요소에는 '{0}' 한정자를 표시할 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1406,6 +1406,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Dodaj argument „void” do obiektu Promise rozwiązanego bez wartości]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Dodaj argument „void” do wszystkich obiektów Promise rozwiązanych bez wartości]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2668,10 +2686,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora „lib” na es2015 lub nowszą.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora `lib` na „{1}” lub nowszą.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2684,56 +2705,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i @types/jest” lub „npm i @types/mocha”.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i --save-dev @types/jest” lub „npm i --save-dev @types/mocha”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i @types/jest” lub „npm i @types/mocha”, a następnie dodaj element „jest” lub „mocha” do pola types w pliku tsconfig.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla modułu uruchamiającego testy? Spróbuj użyć polecenia „npm i --save-dev @types/jest” lub „npm i --save-dev @types/mocha”, a następnie dodaj element „jest” lub „mocha” do pola types w pliku tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i @types/jquery”.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i --save-dev @types/jquery”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i @types/jquery”, a następnie dodaj element „jquery” do pola types w pliku tsconfig.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla biblioteki jQuery? Spróbuj użyć polecenia „npm i --save-dev @types/jquery”, a następnie dodaj element „jquery” do pola types w pliku tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla node? Spróbuj użyć polecenia „npm i @types/node”.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla środowiska Node? Spróbuj użyć polecenia „npm i --save-dev @types/node”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla node? Spróbuj użyć polecenia „npm i @types/node”, a następnie dodaj element „node” do pola types w pliku tsconfig.]]></Val>
|
||||
<Val><![CDATA[Nie można odnaleźć nazwy „{0}”. Czy chcesz zainstalować definicje typów dla środowiska Node? Spróbuj użyć polecenia „npm i --save-dev @types/node”, a następnie dodaj element „node” do pola types w pliku tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3929,6 +3950,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklaracje z asercjami określonego przypisania muszą również mieć adnotacje typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklaracje z inicjatorami nie mogą mieć również asercji określonego przypisania.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4031,15 +4070,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Asercje określonego przypisania mogą być używane tylko wraz z adnotacją typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4871,6 +4901,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Oczekiwano {0} argumentów, ale otrzymano {1}. Czy zapomniano dołączyć wartość „void” w argumencie typu obiektu „Promise”?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6368,6 +6407,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Prawdopodobnie brakuje przecinka, aby oddzielić te dwa wyrażenia szablonu. Tworzą one wyrażenie szablonu z tagami, którego nie można wywołać.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8165,6 +8213,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Chronometraż wydajności dla opcji „--diagnostics” lub „--extendedDiagnostics” nie jest dostępny w tej sesji. Nie można było znaleźć natywnej implementacji interfejsu Web Performance API.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8450,6 +8507,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Właściwość „{0}” nie istnieje w typie „{1}”. Czy chcesz zmienić bibliotekę docelową? Spróbuj zmienić opcję kompilatora `lib` na „{2}” lub nowszą.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10244,15 +10310,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Argument typu literału szablonu „{0}” nie jest typem literału ani typem ogólnym.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10343,6 +10400,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Wywołanie powiodłoby się dla tej implementacji, ale sygnatury implementacji przeciążeń nie są widoczne na zewnątrz.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10508,6 +10574,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Wywnioskowany typ tego węzła przekracza maksymalną długość, którą kompilator może serializować. Wymagana jest jawna adnotacja typu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10526,6 +10601,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Słowa kluczowego „intrinsic” można używać tylko do deklarowania typów wewnętrznych udostępnianych przez kompilator.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11225,11 +11309,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Spróbuj użyć polecenia „npm install @types/{1}”, jeśli istnieje, lub dodać nowy plik deklaracji (.d.ts) zawierający ciąg „declare module '{0}';”]]></Val>
|
||||
<Val><![CDATA[Spróbuj użyć polecenia „npm i --save-dev @types/{1}”, jeśli istnieje, lub dodać nowy plik deklaracji (.d.ts) zawierający ciąg „declare module '{0}';”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12812,15 +12896,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Modyfikator „{0}” nie może występować w elemencie klasy.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12875,6 +12950,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Modyfikator „{0}” nie może występować w elementach klasy tego rodzaju.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1409,6 +1409,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Adicionar 'void' à Promessa resolvida sem um valor]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Adicionar 'void' a todas as Promessas resolvidas sem um valor]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2671,10 +2689,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção de compilador 'lib' para es2015 ou posterior.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção `lib` do compilador para '{1}' ou posterior.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2687,56 +2708,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente 'npm i @types/jest ' ou 'npm i @types/mocha'.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente `npm i --save-dev @types/jest` ou `npm i --save-dev @types/mocha`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente 'npm i @types/jest' ou 'npm i @types/mocha' e, em seguida, adicione 'jest' ou 'mocha' ao campo de tipos em seu tsconfig.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para um executor de teste? Tente `npm i --save-dev @types/jest` ou `npm i --save-dev @types/mocha` e, em seguida, adicione `jest` ou `mocha` aos campos de tipo no tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente 'npm i @types/jquery'.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente `npm i --save-dev @types/jquery`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente 'npm i @types/jquery' e, em seguida, adicione 'jquery' ao campo de tipos em seu tsconfig.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o jQuery? Tente `npm i --save-dev @types/jquery` e, em seguida, adicione `jquery` ao campo de tipos no tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente 'npm i @types/node'.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente `npm i --save-dev @types/node`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente 'npm i @types/node' e, em seguida, adicione 'node' ao campo de tipos em seu tsconfig.]]></Val>
|
||||
<Val><![CDATA[Não é possível localizar o nome '{0}'. Você precisa instalar definições de tipo para o nó? Tente `npm i --save-dev @types/node` e, em seguida, adicione `node` ao campo de tipos no tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3932,6 +3953,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[As declarações com asserções de atribuição definitiva também precisam ter anotações de tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[As declarações com inicializadores também não podem ter asserções de atribuição definitiva.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4034,15 +4073,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[As declarações de atribuição definitivas só podem ser usadas juntamente com uma anotação de tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4874,6 +4904,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0} argumentos eram esperados, mas foram obtidos {1}. Você esqueceu de incluir 'void' no argumento de tipo para 'Promise'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6371,6 +6410,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[É provável que não haja uma vírgula para separar essas duas expressões de modelo. Elas formam uma expressão de modelo marcada que não pode ser invocada.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8168,6 +8216,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Os tempos de desempenho de '--diagnostics' ou '--extendedDiagnostics' não estão disponíveis nesta sessão. Não foi possível encontrar uma implementação nativa da API de Desempenho Web.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8453,6 +8510,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A propriedade '{0}' não existe no tipo '{1}'. Você precisa alterar sua biblioteca de destino? Tente alterar a opção `lib` do compilador para '{2}' ou posterior.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10247,15 +10313,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O argumento de tipo literal do modelo '{0}' não é um tipo literal nem um tipo genérico.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10346,6 +10403,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A chamada teria sido bem-sucedida nesta implementação, mas as assinaturas de implementação de sobrecargas não estão visíveis externamente.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10511,6 +10577,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O tipo inferido deste nó excede o tamanho máximo que o compilador serializará. Uma anotação de tipo explícita é necessária.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10529,6 +10604,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A palavra-chave 'intrinsic' só pode ser usada para declarar tipos intrínsecos fornecidos pelo compilador.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11228,11 +11312,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Tente `npm install @types/{1}` se existir ou adicione um novo arquivo de declaração (.d.ts) contendo `módulo declare '{0}';`]]></Val>
|
||||
<Val><![CDATA[Tente `npm i --save-dev @types/{1}` caso exista ou adicione um novo arquivo de declaração (.d.ts) contendo `declare module '{0}';`]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12815,15 +12899,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O modificador '{0}' não pode aparecer em um elemento de classe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12878,6 +12953,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O modificador '{0}' não pode aparecer em elementos de classe deste tipo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1415,6 +1415,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Добавить "void" в Promise (обещание), разрешенное без значения]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Добавить "void" во все Promise (обещания), разрешенные без значения]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2677,10 +2695,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора "lib" на es2015 или более поздней версии.]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора "lib" на "{1}" или более поздней версии.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2693,56 +2714,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать "npm i @types/jest" или "npm i @types/mocha".]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать команды "npm i --save-dev @types/jest" или "npm i --save-dev @types/mocha".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать "npm i @types/jest" или "npm i @types/mocha", а затем добавить "jest" или "mocha" в поле типов в файле tsconfig.]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для средства запуска тестов? Попробуйте использовать команды "npm i --save-dev @types/jest" или "npm i --save-dev @types/mocha", а затем добавить "jest" или "mocha" в поле типов в файле tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для jQuery? Попробуйте использовать "npm i @types/jquery".]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для jQuery? Попробуйте использовать команду "npm i --save-dev @types/jquery".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для jQuery? Попробуйте использовать "npm i @types/jquery" и затем добавить "jquery" в поле типов в файле tsconfig.]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для jQuery? Попробуйте использовать команду "npm i --save-dev @types/jquery", а затем добавить "jquery" в поле типов в файле tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для узла? Попробуйте использовать "npm i @types/node".]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для узла? Попробуйте использовать команду "npm i --save-dev @types/node".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для узла? Попробуйте использовать "npm i @types/node" и затем добавить "node" в поле типов в файле tsconfig.]]></Val>
|
||||
<Val><![CDATA[Не удается найти имя "{0}". Вы хотите установить определения типов для узла? Попробуйте использовать команду "npm i --save-dev @types/node", а затем добавить "node" в поле типов в файле tsconfig.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3938,6 +3959,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Объявления с определенными утверждениями присваивания также должны иметь заметки типов.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Объявления с инициализаторами не могут также иметь определенные утверждения присваивания.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4040,15 +4079,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Определенные утверждения присваивания можно использовать только вместе с заметкой с типом.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4880,6 +4910,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ожидаемое число аргументов — {0}, фактическое — {1}. Возможно, вы забыли указать void в аргументе типа в Promise?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6377,6 +6416,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Вероятно, не хватает запятой, разделяющей эти два выражения шаблона. Они формируют выражение шаблона с тегами, которое не может быть вызвано.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8177,6 +8225,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Временные показатели производительности для параметров "--diagnostics" и "--extendedDiagnostics" недоступны в этом сеансе. Не удалось найти стандартную реализацию API веб-производительности.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8462,6 +8519,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Свойство "{0}" не существует в типе "{1}". Вы хотите изменить целевую библиотеку? Попробуйте изменить параметр компилятора "lib" на "{2}" или более поздней версии.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -9102,7 +9168,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused declarations for: '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Удалите неиспользуемые объявления для: "{0}"]]></Val>
|
||||
<Val><![CDATA[Удалить неиспользуемые объявления для: "{0}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -9111,7 +9177,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Remove unused destructuring declaration]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Удалите неиспользуемое объявление деструктурирования]]></Val>
|
||||
<Val><![CDATA[Удалить неиспользуемое объявление деструктурирования]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10188,7 +10254,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Switch each misused '{0}' to '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Измените все неверно используемые "{0}" на "{1}"]]></Val>
|
||||
<Val><![CDATA[Изменить все неверно используемые "{0}" на "{1}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -10256,15 +10322,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Аргумент типа литерала шаблона "{0}" не является типом литерала или универсальным типом.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10355,6 +10412,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Вызов для этой реализации был выполнен успешно, но сигнатуры реализации перегрузок не видны извне.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10520,6 +10586,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Выведенный тип этого узла превышает максимальную длину, которую будет сериализовывать компилятор. Требуется указать заметку явного типа.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10538,6 +10613,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ключевое слово intrinsic можно использовать только для объявления внутренних типов, предоставляемых компилятором.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11237,11 +11321,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Попробуйте использовать "npm install @types/{1}", если он существует, или добавьте новый файл объявления (.d.ts), содержащий "declare module '{0}';".]]></Val>
|
||||
<Val><![CDATA[Попробуйте использовать команду "npm i --save-dev @types/{1}", если он существует, или добавьте новый файл объявления (.d.ts), содержащий "declare module '{0}';".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12824,15 +12908,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Модификатор "{0}" не может использоваться в элементе класса.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12887,6 +12962,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Модификатор "{0}" не может использоваться для элементов класса этого типа.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
@@ -1409,6 +1409,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_Promise_resolved_without_a_value_95143" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to Promise resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Değer olmadan çözümlenen Promise'e 'void' ekle]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Add_void_to_all_Promises_resolved_without_a_value_95144" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add 'void' to all Promises resolved without a value]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Değer olmadan çözümlenen tüm Promise'lere 'void' ekle]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<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>
|
||||
@@ -2671,10 +2689,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to '{1}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Hedef kitaplığınızı değiştirmeniz gerekiyor mu? `lib` derleyici seçeneğini es2015 veya üzeri olarak değiştirmeyi deneyin.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Hedef kitaplığınızı değiştirmeniz mi gerekiyor? `lib` derleyici seçeneğini '{1}' veya üzeri olarak değiştirmeyi deneyin.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2687,56 +2708,56 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz gerekiyor mu? Şunları deneyin: `npm i @types/jest` veya `npm i @types/mocha`.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz mi gerekiyor? Şunları deneyin: `npm i --save-dev @types/jest` veya `npm i --save-dev @types/mocha`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_types_Slashje_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz gerekiyor mu? Şunları deneyin: `npm i @types/jest` veya `npm i @types/mocha`. Ardından tsconfig dosyanızdaki türler alanına `jest` veya `mocha` ekleyin.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Test Runner için tür tanımlarını yüklemeniz mi gerekiyor? Şunları deneyin: `npm i --save-dev @types/jest` veya `npm i --save-dev @types/mocha`. Ardından tsconfig dosyanızdaki types alanına `jest` veya `mocha` ekleyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. JQuery için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/jquery`.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. jQuery için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/jquery`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_types_Slashjquery_an_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add `jquery` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. JQuery için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/jquery`. Ardından tsconfig dosyanızdaki türler alanına `jquery` öğesini ekleyin.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. jQuery için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/jquery`. Ardından tsconfig dosyanızdaki types alanına `jquery` ekleyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/node`.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/node`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_types_Slashnode_and_th_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Val><![CDATA[Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add `node` to the types field in your tsconfig.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz gerekiyor mu? Şunu deneyin: `npm i @types/node`. Ardından tsconfig dosyanızdaki türler alanına `node` ekleyin.]]></Val>
|
||||
<Val><![CDATA['{0}' adı bulunamıyor. Düğüm için tür tanımlarını yüklemeniz mi gerekiyor? Şunu deneyin: `npm i --save-dev @types/node`. Ardından tsconfig dosyanızdaki types alanına `node` ekleyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -3932,6 +3953,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with definite assignment assertions must also have type annotations.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Kesin atama onaylamaları olan bildirimlerde tür ek açıklamaları da olmalıdır.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declarations with initializers cannot also have definite assignment assertions.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Başlatıcılara sahip bildirimlerde kesin atama onaylamaları olamaz.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_a_private_field_named_0_90053" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare a private field named '{0}'.]]></Val>
|
||||
@@ -4034,15 +4073,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definite_assignment_assertions_can_only_be_used_along_with_a_type_annotation_1258" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definite assignment assertions can only be used along with a type annotation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Belirli atama onaylamaları yalnızca bir tür ek açıklaması ile birlikte kullanılabilir.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Definitions of the following identifiers conflict with those in another file: {0}]]></Val>
|
||||
@@ -4874,6 +4904,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0} bağımsız değişken bekleniyordu ancak {1} bağımsız değişken alındı. Tür bağımsız değişkeninizdeki 'void' operatörünü 'Promise'e eklemeyi mi unuttunuz?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Expected_0_arguments_but_got_1_or_more_2556" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Expected {0} arguments, but got {1} or more.]]></Val>
|
||||
@@ -6371,6 +6410,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu iki şablon ifadesini ayırmak için virgül koymamış olabilirsiniz. Bu ifadeler, çağrılamayacak etiketli bir şablon ifadesi oluşturur.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Its_element_type_0_is_not_a_valid_JSX_element_2789" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Its element type '{0}' is not a valid JSX element.]]></Val>
|
||||
@@ -8171,6 +8219,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['--diagnostics' veya '--extendedDiagnostics' için performans zamanlamaları bu oturumda kullanılamaz. Web performans API'sinin yerel bir uygulaması bulunamadı.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</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>
|
||||
@@ -8456,6 +8513,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the `lib` compiler option to '{2}' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' özelliği '{1}' türünde yok. Hedef kitaplığınızı değiştirmeniz mi gerekiyor? `lib` derleyici seçeneğini '{2}' veya üzeri olarak değiştirmeyi deneyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Property '{0}' has no initializer and is not definitely assigned in the constructor.]]></Val>
|
||||
@@ -10250,15 +10316,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Template_literal_type_argument_0_is_not_literal_type_or_a_generic_type_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Template literal type argument '{0}' is not literal type or a generic type.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Şablon sabit değerli tür bağımsız değişkeni ('{0}') sabit değerli tür veya genel bir tür değil.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_0_modifier_can_only_be_used_in_TypeScript_files_8009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The '{0}' modifier can only be used in TypeScript files.]]></Val>
|
||||
@@ -10349,6 +10406,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Çağrı, bu uygulamada başarılı olabilirdi, ancak aşırı yüklemelerin uygulama imzaları dışarıdan görünmüyor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_character_set_of_the_input_files_6163" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The character set of the input files.]]></Val>
|
||||
@@ -10514,6 +10580,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu düğümün çıkarsanan türü, derleyicinin seri hale getireceği maksimum uzunluğu aşıyor. Açık tür ek açıklaması gerekiyor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some.]]></Val>
|
||||
@@ -10532,6 +10607,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['intrinsic' anahtar sözcüğü, yalnızca derleyicinin sağladığı iç türleri bildirmek için kullanılabilir.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.]]></Val>
|
||||
@@ -11231,11 +11315,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Try_npm_install_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Try `npm install @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Val><![CDATA[Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Varsa `npm install @types/{1}` deneyin veya `declare module '{0}';` öğesini içeren yeni bir bildirim (.d.ts) dosyası ekleyin]]></Val>
|
||||
<Val><![CDATA[Varsa `npm i --save-dev @types/{1}` deneyin veya `declare module '{0}';` deyimini içeren yeni bir bildirim (.d.ts) dosyası ekleyin]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -12818,15 +12902,6 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_class_element_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a class element.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' değiştiricisi bir sınıf öğesinde görüntülenemez.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_a_constructor_declaration_1089" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on a constructor declaration.]]></Val>
|
||||
@@ -12881,6 +12956,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot appear on class elements of this kind.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' değiştiricisi bu tip sınıf öğelerinde görünemez.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_modifier_cannot_be_used_here_1042" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' modifier cannot be used here.]]></Val>
|
||||
|
||||
+134
-64
@@ -263,6 +263,16 @@ namespace ts.server {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function convertTypeAcquisition(protocolOptions: protocol.InferredProjectCompilerOptions): TypeAcquisition | undefined {
|
||||
let result: TypeAcquisition | undefined;
|
||||
typeAcquisitionDeclarations.forEach((option) => {
|
||||
const propertyValue = protocolOptions[option.name];
|
||||
if (propertyValue === undefined) return;
|
||||
(result || (result = {}))[option.name] = propertyValue;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
export function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind {
|
||||
return isString(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName;
|
||||
}
|
||||
@@ -434,64 +444,105 @@ namespace ts.server {
|
||||
/*@internal*/
|
||||
export function forEachResolvedProjectReferenceProject<T>(
|
||||
project: ConfiguredProject,
|
||||
fileName: string | undefined,
|
||||
cb: (child: ConfiguredProject) => T | undefined,
|
||||
projectReferenceProjectLoadKind: ProjectReferenceProjectLoadKind.Find | ProjectReferenceProjectLoadKind.FindCreate,
|
||||
): T | undefined;
|
||||
/*@internal*/
|
||||
export function forEachResolvedProjectReferenceProject<T>(
|
||||
project: ConfiguredProject,
|
||||
fileName: string | undefined,
|
||||
cb: (child: ConfiguredProject) => T | undefined,
|
||||
projectReferenceProjectLoadKind: ProjectReferenceProjectLoadKind,
|
||||
reason: string
|
||||
): T | undefined;
|
||||
export function forEachResolvedProjectReferenceProject<T>(
|
||||
project: ConfiguredProject,
|
||||
fileName: string | undefined,
|
||||
cb: (child: ConfiguredProject) => T | undefined,
|
||||
projectReferenceProjectLoadKind: ProjectReferenceProjectLoadKind,
|
||||
reason?: string
|
||||
): T | undefined {
|
||||
const resolvedRefs = project.getCurrentProgram()?.getResolvedProjectReferences();
|
||||
if (!resolvedRefs) return undefined;
|
||||
let seenResolvedRefs: ESMap<string, ProjectReferenceProjectLoadKind> | undefined;
|
||||
return worker(project.getCurrentProgram()?.getResolvedProjectReferences(), project.getCompilerOptions());
|
||||
|
||||
function worker(resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[] | undefined, parentOptions: CompilerOptions): T | undefined {
|
||||
const loadKind = parentOptions.disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : projectReferenceProjectLoadKind;
|
||||
return forEach(resolvedProjectReferences, ref => {
|
||||
if (!ref) return undefined;
|
||||
|
||||
const configFileName = toNormalizedPath(ref.sourceFile.fileName);
|
||||
const canonicalPath = project.projectService.toCanonicalFileName(configFileName);
|
||||
const seenValue = seenResolvedRefs?.get(canonicalPath);
|
||||
if (seenValue !== undefined && seenValue >= loadKind) {
|
||||
return undefined;
|
||||
}
|
||||
const child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (
|
||||
loadKind === ProjectReferenceProjectLoadKind.Find ?
|
||||
undefined :
|
||||
loadKind === ProjectReferenceProjectLoadKind.FindCreate ?
|
||||
project.projectService.createConfiguredProject(configFileName) :
|
||||
loadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ?
|
||||
project.projectService.createAndLoadConfiguredProject(configFileName, reason!) :
|
||||
Debug.assertNever(loadKind)
|
||||
const possibleDefaultRef = fileName ? project.getResolvedProjectReferenceToRedirect(fileName) : undefined;
|
||||
if (possibleDefaultRef) {
|
||||
// Try to find the name of the file directly through resolved project references
|
||||
const configFileName = toNormalizedPath(possibleDefaultRef.sourceFile.fileName);
|
||||
const child = project.projectService.findConfiguredProjectByProjectName(configFileName);
|
||||
if (child) {
|
||||
const result = cb(child);
|
||||
if (result) return result;
|
||||
}
|
||||
else if (projectReferenceProjectLoadKind !== ProjectReferenceProjectLoadKind.Find) {
|
||||
seenResolvedRefs = new Map();
|
||||
// Try to see if this project can be loaded
|
||||
const result = forEachResolvedProjectReferenceProjectWorker(
|
||||
resolvedRefs,
|
||||
project.getCompilerOptions(),
|
||||
(ref, loadKind) => possibleDefaultRef === ref ? callback(ref, loadKind) : undefined,
|
||||
projectReferenceProjectLoadKind,
|
||||
project.projectService,
|
||||
seenResolvedRefs
|
||||
);
|
||||
if (result) return result;
|
||||
// Cleanup seenResolvedRefs
|
||||
seenResolvedRefs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
const result = child && cb(child);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
return forEachResolvedProjectReferenceProjectWorker(
|
||||
resolvedRefs,
|
||||
project.getCompilerOptions(),
|
||||
(ref, loadKind) => possibleDefaultRef !== ref ? callback(ref, loadKind) : undefined,
|
||||
projectReferenceProjectLoadKind,
|
||||
project.projectService,
|
||||
seenResolvedRefs
|
||||
);
|
||||
|
||||
(seenResolvedRefs || (seenResolvedRefs = new Map())).set(canonicalPath, loadKind);
|
||||
return worker(ref.references, ref.commandLine.options);
|
||||
});
|
||||
function callback(ref: ResolvedProjectReference, loadKind: ProjectReferenceProjectLoadKind) {
|
||||
const configFileName = toNormalizedPath(ref.sourceFile.fileName);
|
||||
const child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (
|
||||
loadKind === ProjectReferenceProjectLoadKind.Find ?
|
||||
undefined :
|
||||
loadKind === ProjectReferenceProjectLoadKind.FindCreate ?
|
||||
project.projectService.createConfiguredProject(configFileName) :
|
||||
loadKind === ProjectReferenceProjectLoadKind.FindCreateLoad ?
|
||||
project.projectService.createAndLoadConfiguredProject(configFileName, reason!) :
|
||||
Debug.assertNever(loadKind)
|
||||
);
|
||||
|
||||
return child && cb(child);
|
||||
}
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export function forEachResolvedProjectReference<T>(
|
||||
project: ConfiguredProject,
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference | undefined, resolvedProjectReferencePath: Path) => T | undefined
|
||||
function forEachResolvedProjectReferenceProjectWorker<T>(
|
||||
resolvedProjectReferences: readonly (ResolvedProjectReference | undefined)[],
|
||||
parentOptions: CompilerOptions,
|
||||
cb: (resolvedRef: ResolvedProjectReference, loadKind: ProjectReferenceProjectLoadKind) => T | undefined,
|
||||
projectReferenceProjectLoadKind: ProjectReferenceProjectLoadKind,
|
||||
projectService: ProjectService,
|
||||
seenResolvedRefs: ESMap<string, ProjectReferenceProjectLoadKind> | undefined,
|
||||
): T | undefined {
|
||||
const program = project.getCurrentProgram();
|
||||
return program && program.forEachResolvedProjectReference(cb);
|
||||
const loadKind = parentOptions.disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : projectReferenceProjectLoadKind;
|
||||
return forEach(resolvedProjectReferences, ref => {
|
||||
if (!ref) return undefined;
|
||||
|
||||
const configFileName = toNormalizedPath(ref.sourceFile.fileName);
|
||||
const canonicalPath = projectService.toCanonicalFileName(configFileName);
|
||||
const seenValue = seenResolvedRefs?.get(canonicalPath);
|
||||
if (seenValue !== undefined && seenValue >= loadKind) {
|
||||
return undefined;
|
||||
}
|
||||
const result = cb(ref, loadKind);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
(seenResolvedRefs || (seenResolvedRefs = new Map())).set(canonicalPath, loadKind);
|
||||
return ref.references && forEachResolvedProjectReferenceProjectWorker(ref.references, ref.commandLine.options, cb, loadKind, projectService, seenResolvedRefs);
|
||||
});
|
||||
}
|
||||
|
||||
function forEachPotentialProjectReference<T>(
|
||||
@@ -504,12 +555,12 @@ namespace ts.server {
|
||||
|
||||
function forEachAnyProjectReferenceKind<T>(
|
||||
project: ConfiguredProject,
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference | undefined, resolvedProjectReferencePath: Path) => T | undefined,
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference) => T | undefined,
|
||||
cbProjectRef: (projectReference: ProjectReference) => T | undefined,
|
||||
cbPotentialProjectRef: (potentialProjectReference: Path) => T | undefined
|
||||
): T | undefined {
|
||||
return project.getCurrentProgram() ?
|
||||
forEachResolvedProjectReference(project, cb) :
|
||||
project.forEachResolvedProjectReference(cb) :
|
||||
project.isInitialLoadPending() ?
|
||||
forEachPotentialProjectReference(project, cbPotentialProjectRef) :
|
||||
forEach(project.getProjectReferences(), cbProjectRef);
|
||||
@@ -530,8 +581,8 @@ namespace ts.server {
|
||||
): T | undefined {
|
||||
return forEachAnyProjectReferenceKind(
|
||||
project,
|
||||
resolvedRef => callbackRefProject(project, cb, resolvedRef && resolvedRef.sourceFile.path),
|
||||
projectRef => callbackRefProject(project, cb, project.toPath(projectRef.path)),
|
||||
resolvedRef => callbackRefProject(project, cb, resolvedRef.sourceFile.path),
|
||||
projectRef => callbackRefProject(project, cb, project.toPath(resolveProjectReferencePath(projectRef))),
|
||||
potentialProjectRef => callbackRefProject(project, cb, potentialProjectRef)
|
||||
);
|
||||
}
|
||||
@@ -642,6 +693,8 @@ namespace ts.server {
|
||||
private compilerOptionsForInferredProjectsPerProjectRoot = new Map<string, CompilerOptions>();
|
||||
private watchOptionsForInferredProjects: WatchOptions | undefined;
|
||||
private watchOptionsForInferredProjectsPerProjectRoot = new Map<string, WatchOptions | false>();
|
||||
private typeAcquisitionForInferredProjects: TypeAcquisition | undefined;
|
||||
private typeAcquisitionForInferredProjectsPerProjectRoot = new Map<string, TypeAcquisition | undefined>();
|
||||
/**
|
||||
* Project size for configured or external projects
|
||||
*/
|
||||
@@ -730,7 +783,6 @@ namespace ts.server {
|
||||
this.syntaxOnly = false;
|
||||
}
|
||||
|
||||
Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
|
||||
if (this.host.realpath) {
|
||||
this.realpathToScriptInfos = createMultiMap();
|
||||
}
|
||||
@@ -983,11 +1035,12 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void {
|
||||
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void {
|
||||
Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled");
|
||||
|
||||
const compilerOptions = convertCompilerOptions(projectCompilerOptions);
|
||||
const watchOptions = convertWatchOptions(projectCompilerOptions);
|
||||
const typeAcquisition = convertTypeAcquisition(projectCompilerOptions);
|
||||
|
||||
// always set 'allowNonTsExtensions' for inferred projects since user cannot configure it from the outside
|
||||
// previously we did not expose a way for user to change these settings and this option was enabled by default
|
||||
@@ -996,10 +1049,12 @@ namespace ts.server {
|
||||
if (canonicalProjectRootPath) {
|
||||
this.compilerOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, compilerOptions);
|
||||
this.watchOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, watchOptions || false);
|
||||
this.typeAcquisitionForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, typeAcquisition);
|
||||
}
|
||||
else {
|
||||
this.compilerOptionsForInferredProjects = compilerOptions;
|
||||
this.watchOptionsForInferredProjects = watchOptions;
|
||||
this.typeAcquisitionForInferredProjects = typeAcquisition;
|
||||
}
|
||||
|
||||
for (const project of this.inferredProjects) {
|
||||
@@ -1016,6 +1071,7 @@ namespace ts.server {
|
||||
!project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) {
|
||||
project.setCompilerOptions(compilerOptions);
|
||||
project.setWatchOptions(watchOptions);
|
||||
project.setTypeAcquisition(typeAcquisition);
|
||||
project.compileOnSaveEnabled = compilerOptions.compileOnSave!;
|
||||
project.markAsDirty();
|
||||
this.delayUpdateProjectGraph(project);
|
||||
@@ -2299,13 +2355,18 @@ namespace ts.server {
|
||||
private createInferredProject(currentDirectory: string | undefined, isSingleInferredProject?: boolean, projectRootPath?: NormalizedPath): InferredProject {
|
||||
const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects!; // TODO: GH#18217
|
||||
let watchOptions: WatchOptions | false | undefined;
|
||||
let typeAcquisition: TypeAcquisition | undefined;
|
||||
if (projectRootPath) {
|
||||
watchOptions = this.watchOptionsForInferredProjectsPerProjectRoot.get(projectRootPath);
|
||||
typeAcquisition = this.typeAcquisitionForInferredProjectsPerProjectRoot.get(projectRootPath);
|
||||
}
|
||||
if (watchOptions === undefined) {
|
||||
watchOptions = this.watchOptionsForInferredProjects;
|
||||
}
|
||||
const project = new InferredProject(this, this.documentRegistry, compilerOptions, watchOptions || undefined, projectRootPath, currentDirectory, this.currentPluginConfigOverrides);
|
||||
if (typeAcquisition === undefined) {
|
||||
typeAcquisition = this.typeAcquisitionForInferredProjects;
|
||||
}
|
||||
const project = new InferredProject(this, this.documentRegistry, compilerOptions, watchOptions || undefined, projectRootPath, currentDirectory, this.currentPluginConfigOverrides, typeAcquisition);
|
||||
if (isSingleInferredProject) {
|
||||
this.inferredProjects.unshift(project);
|
||||
}
|
||||
@@ -2855,6 +2916,7 @@ namespace ts.server {
|
||||
if (!projectContainsInfoDirectly(project, info)) {
|
||||
const referencedProject = forEachResolvedProjectReferenceProject(
|
||||
project,
|
||||
info.path,
|
||||
child => {
|
||||
reloadChildProject(child);
|
||||
return projectContainsInfoDirectly(child, info);
|
||||
@@ -2865,6 +2927,7 @@ namespace ts.server {
|
||||
// Reload the project's tree that is already present
|
||||
forEachResolvedProjectReferenceProject(
|
||||
project,
|
||||
/*fileName*/ undefined,
|
||||
reloadChildProject,
|
||||
ProjectReferenceProjectLoadKind.Find
|
||||
);
|
||||
@@ -2970,11 +3033,12 @@ namespace ts.server {
|
||||
// Find the project that is referenced from this solution that contains the script info directly
|
||||
configuredProject = forEachResolvedProjectReferenceProject(
|
||||
configuredProject,
|
||||
fileName,
|
||||
child => {
|
||||
updateProjectIfDirty(child);
|
||||
return projectContainsOriginalInfo(child) ? child : undefined;
|
||||
},
|
||||
configuredProject.getCompilerOptions().disableReferencedProjectLoad ? ProjectReferenceProjectLoadKind.Find : ProjectReferenceProjectLoadKind.FindCreateLoad,
|
||||
ProjectReferenceProjectLoadKind.FindCreateLoad,
|
||||
`Creating project referenced in solution ${configuredProject.projectName} to find possible configured project for original file: ${originalFileInfo.fileName}${location !== originalLocation ? " for location: " + location.fileName : ""}`
|
||||
);
|
||||
if (!configuredProject) return undefined;
|
||||
@@ -3050,6 +3114,7 @@ namespace ts.server {
|
||||
if (!projectContainsInfoDirectly(project, info)) {
|
||||
forEachResolvedProjectReferenceProject(
|
||||
project,
|
||||
info.path,
|
||||
child => {
|
||||
updateProjectIfDirty(child);
|
||||
// Retain these projects
|
||||
@@ -3164,32 +3229,37 @@ namespace ts.server {
|
||||
// Work on array copy as we could add more projects as part of callback
|
||||
for (const project of arrayFrom(this.configuredProjects.values())) {
|
||||
// If this project has potential project reference for any of the project we are loading ancestor tree for
|
||||
// we need to load this project tree
|
||||
if (forEachPotentialProjectReference(
|
||||
project,
|
||||
potentialRefPath => forProjects!.has(potentialRefPath)
|
||||
) || forEachResolvedProjectReference(
|
||||
project,
|
||||
(_ref, resolvedPath) => forProjects!.has(resolvedPath)
|
||||
)) {
|
||||
// Load children
|
||||
this.ensureProjectChildren(project, seenProjects);
|
||||
// load this project first
|
||||
if (forEachPotentialProjectReference(project, potentialRefPath => forProjects!.has(potentialRefPath))) {
|
||||
updateProjectIfDirty(project);
|
||||
}
|
||||
this.ensureProjectChildren(project, forProjects, seenProjects);
|
||||
}
|
||||
}
|
||||
|
||||
private ensureProjectChildren(project: ConfiguredProject, seenProjects: Set<NormalizedPath>) {
|
||||
private ensureProjectChildren(project: ConfiguredProject, forProjects: ReadonlyCollection<string>, seenProjects: Set<NormalizedPath>) {
|
||||
if (!tryAddToSet(seenProjects, project.canonicalConfigFilePath)) return;
|
||||
// Update the project
|
||||
updateProjectIfDirty(project);
|
||||
|
||||
// Create tree because project is uptodate we only care of resolved references
|
||||
forEachResolvedProjectReferenceProject(
|
||||
project,
|
||||
child => this.ensureProjectChildren(child, seenProjects),
|
||||
ProjectReferenceProjectLoadKind.FindCreateLoad,
|
||||
`Creating project for reference of project: ${project.projectName}`
|
||||
);
|
||||
// If this project disables child load ignore it
|
||||
if (project.getCompilerOptions().disableReferencedProjectLoad) return;
|
||||
|
||||
const children = project.getCurrentProgram()?.getResolvedProjectReferences();
|
||||
if (!children) return;
|
||||
|
||||
for (const child of children) {
|
||||
if (!child) continue;
|
||||
const referencedProject = forEachResolvedProjectReference(child.references, ref => forProjects.has(ref.sourceFile.path) ? ref : undefined);
|
||||
if (!referencedProject) continue;
|
||||
|
||||
// Load this project,
|
||||
const configFileName = toNormalizedPath(child.sourceFile.fileName);
|
||||
const childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) ||
|
||||
project.projectService.createAndLoadConfiguredProject(configFileName, `Creating project referenced by : ${project.projectName} as it references project ${referencedProject.sourceFile.fileName}`);
|
||||
updateProjectIfDirty(childProject);
|
||||
|
||||
// Ensure children for this project
|
||||
this.ensureProjectChildren(childProject, forProjects, seenProjects);
|
||||
}
|
||||
}
|
||||
|
||||
private cleanupAfterOpeningFile(toRetainConfigProjects: readonly ConfiguredProject[] | ConfiguredProject | undefined) {
|
||||
@@ -3514,8 +3584,8 @@ namespace ts.server {
|
||||
const { rootFiles } = proj;
|
||||
const typeAcquisition = proj.typeAcquisition!;
|
||||
Debug.assert(!!typeAcquisition, "proj.typeAcquisition should be set by now");
|
||||
// If type acquisition has been explicitly disabled, do not exclude anything from the project
|
||||
if (typeAcquisition.enable === false) {
|
||||
|
||||
if (typeAcquisition.enable === false || typeAcquisition.disableFilenameBasedTypeAcquisition) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
+59
-39
@@ -249,6 +249,8 @@ namespace ts.server {
|
||||
private symlinks: SymlinkCache | undefined;
|
||||
/*@internal*/
|
||||
autoImportProviderHost: AutoImportProviderProject | false | undefined;
|
||||
/*@internal*/
|
||||
protected typeAcquisition: TypeAcquisition | undefined;
|
||||
|
||||
/*@internal*/
|
||||
constructor(
|
||||
@@ -631,8 +633,16 @@ namespace ts.server {
|
||||
}
|
||||
updateProjectIfDirty(this);
|
||||
this.builderState = BuilderState.create(this.program!, this.projectService.toCanonicalFileName, this.builderState);
|
||||
return mapDefined(BuilderState.getFilesAffectedBy(this.builderState, this.program!, scriptInfo.path, this.cancellationToken, data => this.projectService.host.createHash!(data)), // TODO: GH#18217
|
||||
sourceFile => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined);
|
||||
return mapDefined(
|
||||
BuilderState.getFilesAffectedBy(
|
||||
this.builderState,
|
||||
this.program!,
|
||||
scriptInfo.path,
|
||||
this.cancellationToken,
|
||||
maybeBind(this.projectService.host, this.projectService.host.createHash)
|
||||
),
|
||||
sourceFile => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -654,7 +664,10 @@ namespace ts.server {
|
||||
const dtsFiles = outputFiles.filter(f => fileExtensionIs(f.name, Extension.Dts));
|
||||
if (dtsFiles.length === 1) {
|
||||
const sourceFile = this.program!.getSourceFile(scriptInfo.fileName)!;
|
||||
BuilderState.updateSignatureOfFile(this.builderState, this.projectService.host.createHash!(dtsFiles[0].text), sourceFile.resolvedPath);
|
||||
const signature = this.projectService.host.createHash ?
|
||||
this.projectService.host.createHash(dtsFiles[0].text) :
|
||||
generateDjb2Hash(dtsFiles[0].text);
|
||||
BuilderState.updateSignatureOfFile(this.builderState, signature, sourceFile.resolvedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -692,7 +705,6 @@ namespace ts.server {
|
||||
getProjectName() {
|
||||
return this.projectName;
|
||||
}
|
||||
abstract getTypeAcquisition(): TypeAcquisition;
|
||||
|
||||
protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition {
|
||||
if (!newTypeAcquisition || !newTypeAcquisition.include) {
|
||||
@@ -738,11 +750,8 @@ namespace ts.server {
|
||||
for (const f of this.program.getSourceFiles()) {
|
||||
this.detachScriptInfoIfNotRoot(f.fileName);
|
||||
}
|
||||
this.program.forEachResolvedProjectReference(ref => {
|
||||
if (ref) {
|
||||
this.detachScriptInfoFromProject(ref.sourceFile.fileName);
|
||||
}
|
||||
});
|
||||
this.program.forEachResolvedProjectReference(ref =>
|
||||
this.detachScriptInfoFromProject(ref.sourceFile.fileName));
|
||||
}
|
||||
|
||||
// Release external files
|
||||
@@ -1075,7 +1084,7 @@ namespace ts.server {
|
||||
// bump up the version if
|
||||
// - oldProgram is not set - this is a first time updateGraph is called
|
||||
// - newProgram is different from the old program and structure of the old program was not reused.
|
||||
const hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(oldProgram.structureIsReused! & StructureIsReused.Completely)));
|
||||
const hasNewProgram = this.program && (!oldProgram || (this.program !== oldProgram && !(this.program.structureIsReused & StructureIsReused.Completely)));
|
||||
if (hasNewProgram) {
|
||||
if (oldProgram) {
|
||||
for (const f of oldProgram.getSourceFiles()) {
|
||||
@@ -1087,8 +1096,8 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
oldProgram.forEachResolvedProjectReference((resolvedProjectReference, resolvedProjectReferencePath) => {
|
||||
if (resolvedProjectReference && !this.program!.getResolvedProjectReferenceByPath(resolvedProjectReferencePath)) {
|
||||
oldProgram.forEachResolvedProjectReference(resolvedProjectReference => {
|
||||
if (!this.program!.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {
|
||||
this.detachScriptInfoFromProject(resolvedProjectReference.sourceFile.fileName);
|
||||
}
|
||||
});
|
||||
@@ -1142,7 +1151,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
if (!this.importSuggestionsCache.isEmpty()) {
|
||||
if (this.hasAddedorRemovedFiles || oldProgram && !oldProgram.structureIsReused) {
|
||||
if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) {
|
||||
this.importSuggestionsCache.clear();
|
||||
}
|
||||
else if (this.dirtyFilesForSuggestions && oldProgram && this.program) {
|
||||
@@ -1183,7 +1192,7 @@ namespace ts.server {
|
||||
this.print(/*writeProjectFileNames*/ true);
|
||||
}
|
||||
else if (this.program !== oldProgram) {
|
||||
this.writeLog(`Different program with same set of files:: oldProgram.structureIsReused:: ${oldProgram && oldProgram.structureIsReused}`);
|
||||
this.writeLog(`Different program with same set of files:: structureIsReused:: ${this.program.structureIsReused}`);
|
||||
}
|
||||
return hasNewProgram;
|
||||
}
|
||||
@@ -1400,6 +1409,16 @@ namespace ts.server {
|
||||
return this.watchOptions;
|
||||
}
|
||||
|
||||
setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void {
|
||||
if (newTypeAcquisition) {
|
||||
this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition);
|
||||
}
|
||||
}
|
||||
|
||||
getTypeAcquisition() {
|
||||
return this.typeAcquisition || {};
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
getChangesSinceVersion(lastKnownVersion?: number, includeProjectReferenceRedirectInfo?: boolean): ProjectFilesWithTSDiagnostics {
|
||||
const includeProjectReferenceRedirectInfoIfRequested =
|
||||
@@ -1622,6 +1641,7 @@ namespace ts.server {
|
||||
|
||||
/*@internal*/
|
||||
getPackageJsonsVisibleToFile(fileName: string, rootDir?: string): readonly PackageJsonInfo[] {
|
||||
if (this.projectService.serverMode !== LanguageServiceMode.Semantic) return emptyArray;
|
||||
return this.projectService.getPackageJsonsVisibleToFile(fileName, rootDir);
|
||||
}
|
||||
|
||||
@@ -1669,9 +1689,13 @@ namespace ts.server {
|
||||
if (this.autoImportProviderHost === false) {
|
||||
return undefined;
|
||||
}
|
||||
if (this.projectService.serverMode !== LanguageServiceMode.Semantic) {
|
||||
this.autoImportProviderHost = false;
|
||||
return undefined;
|
||||
}
|
||||
if (this.autoImportProviderHost) {
|
||||
updateProjectIfDirty(this.autoImportProviderHost);
|
||||
if (!this.autoImportProviderHost.hasRoots()) {
|
||||
if (this.autoImportProviderHost.isEmpty()) {
|
||||
this.autoImportProviderHost.close();
|
||||
this.autoImportProviderHost = undefined;
|
||||
return undefined;
|
||||
@@ -1681,9 +1705,11 @@ namespace ts.server {
|
||||
|
||||
const dependencySelection = this.includePackageJsonAutoImports();
|
||||
if (dependencySelection) {
|
||||
const start = timestamp();
|
||||
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getModuleResolutionHostForAutoImportProvider(), this.documentRegistry);
|
||||
if (this.autoImportProviderHost) {
|
||||
updateProjectIfDirty(this.autoImportProviderHost);
|
||||
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start);
|
||||
return this.autoImportProviderHost.getCurrentProgram();
|
||||
}
|
||||
}
|
||||
@@ -1770,7 +1796,8 @@ namespace ts.server {
|
||||
watchOptions: WatchOptions | undefined,
|
||||
projectRootPath: NormalizedPath | undefined,
|
||||
currentDirectory: string | undefined,
|
||||
pluginConfigOverrides: ESMap<string, any> | undefined) {
|
||||
pluginConfigOverrides: ESMap<string, any> | undefined,
|
||||
typeAcquisition: TypeAcquisition | undefined) {
|
||||
super(InferredProject.newName(),
|
||||
ProjectKind.Inferred,
|
||||
projectService,
|
||||
@@ -1783,6 +1810,7 @@ namespace ts.server {
|
||||
watchOptions,
|
||||
projectService.host,
|
||||
currentDirectory);
|
||||
this.typeAcquisition = typeAcquisition;
|
||||
this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath);
|
||||
if (!projectRootPath && !projectService.useSingleInferredProject) {
|
||||
this.canonicalCurrentDirectory = projectService.toCanonicalFileName(this.currentDirectory);
|
||||
@@ -1828,7 +1856,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
getTypeAcquisition(): TypeAcquisition {
|
||||
return {
|
||||
return this.typeAcquisition || {
|
||||
enable: allRootFilesAreJsOrDts(this),
|
||||
include: ts.emptyArray,
|
||||
exclude: ts.emptyArray
|
||||
@@ -1935,6 +1963,11 @@ namespace ts.server {
|
||||
this.rootFileNames = initialRootNames;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
isEmpty() {
|
||||
return !some(this.rootFileNames);
|
||||
}
|
||||
|
||||
isOrphan() {
|
||||
return true;
|
||||
}
|
||||
@@ -2005,7 +2038,6 @@ namespace ts.server {
|
||||
* Otherwise it will create an InferredProject.
|
||||
*/
|
||||
export class ConfiguredProject extends Project {
|
||||
private typeAcquisition: TypeAcquisition | undefined;
|
||||
/* @internal */
|
||||
configFileWatcher: FileWatcher | undefined;
|
||||
private directoriesWatchedForWildcards: ESMap<string, WildcardDirectoryWatcher> | undefined;
|
||||
@@ -2170,6 +2202,13 @@ namespace ts.server {
|
||||
return program && program.getResolvedProjectReferenceToRedirect(fileName);
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
forEachResolvedProjectReference<T>(
|
||||
cb: (resolvedProjectReference: ResolvedProjectReference) => T | undefined
|
||||
): T | undefined {
|
||||
return this.getCurrentProgram()?.forEachResolvedProjectReference(cb);
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
enablePluginsWithOptions(options: CompilerOptions, pluginConfigOverrides: ESMap<string, any> | undefined) {
|
||||
const host = this.projectService.host;
|
||||
@@ -2217,14 +2256,6 @@ namespace ts.server {
|
||||
this.projectErrors = projectErrors;
|
||||
}
|
||||
|
||||
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void {
|
||||
this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition);
|
||||
}
|
||||
|
||||
getTypeAcquisition() {
|
||||
return this.typeAcquisition || {};
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
watchWildcards(wildcardDirectories: ESMap<string, WatchDirectoryFlags>) {
|
||||
updateWatchingWildcardDirectories(
|
||||
@@ -2278,6 +2309,7 @@ namespace ts.server {
|
||||
getDefaultChildProjectFromProjectWithReferences(info: ScriptInfo) {
|
||||
return forEachResolvedProjectReferenceProject(
|
||||
this,
|
||||
info.path,
|
||||
child => projectContainsInfoDirectly(child, info) ?
|
||||
child :
|
||||
undefined,
|
||||
@@ -2315,6 +2347,7 @@ namespace ts.server {
|
||||
return this.containsScriptInfo(info) ||
|
||||
!!forEachResolvedProjectReferenceProject(
|
||||
this,
|
||||
info.path,
|
||||
child => child.containsScriptInfo(info),
|
||||
ProjectReferenceProjectLoadKind.Find
|
||||
);
|
||||
@@ -2343,7 +2376,6 @@ namespace ts.server {
|
||||
*/
|
||||
export class ExternalProject extends Project {
|
||||
excludedFiles: readonly NormalizedPath[] = [];
|
||||
private typeAcquisition: TypeAcquisition | undefined;
|
||||
/*@internal*/
|
||||
constructor(public externalProjectName: string,
|
||||
projectService: ProjectService,
|
||||
@@ -2377,18 +2409,6 @@ namespace ts.server {
|
||||
getExcludedFiles() {
|
||||
return this.excludedFiles;
|
||||
}
|
||||
|
||||
getTypeAcquisition() {
|
||||
return this.typeAcquisition || {};
|
||||
}
|
||||
|
||||
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void {
|
||||
Debug.assert(!!newTypeAcquisition, "newTypeAcquisition may not be null/undefined");
|
||||
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 = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition);
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
+14
-1
@@ -617,6 +617,12 @@ namespace ts.server.protocol {
|
||||
* so this description should make sense by itself if the parent is inlineable=true
|
||||
*/
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* A message to show to the user if the refactoring cannot be applied in
|
||||
* the current context.
|
||||
*/
|
||||
notApplicableReason?: string;
|
||||
}
|
||||
|
||||
export interface GetEditsForRefactorRequest extends Request {
|
||||
@@ -1756,6 +1762,11 @@ namespace ts.server.protocol {
|
||||
closedFiles?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* External projects have a typeAcquisition option so they need to be added separately to compiler options for inferred projects.
|
||||
*/
|
||||
export type InferredProjectCompilerOptions = ExternalProjectCompilerOptions & TypeAcquisition;
|
||||
|
||||
/**
|
||||
* Request to set compiler options for inferred projects.
|
||||
* External projects are opened / closed explicitly.
|
||||
@@ -1777,7 +1788,7 @@ namespace ts.server.protocol {
|
||||
/**
|
||||
* Compiler options to be used with inferred projects.
|
||||
*/
|
||||
options: ExternalProjectCompilerOptions;
|
||||
options: InferredProjectCompilerOptions;
|
||||
|
||||
/**
|
||||
* Specifies the project root path used to scope compiler options.
|
||||
@@ -3185,6 +3196,7 @@ namespace ts.server.protocol {
|
||||
insertSpaceAfterConstructor?: boolean;
|
||||
insertSpaceAfterKeywordsInControlFlowStatements?: boolean;
|
||||
insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean;
|
||||
insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
|
||||
insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean;
|
||||
insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean;
|
||||
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
|
||||
@@ -3223,6 +3235,7 @@ namespace ts.server.protocol {
|
||||
readonly allowTextChangesInNewFiles?: boolean;
|
||||
readonly lazyConfiguredProjectsFromExternalProject?: boolean;
|
||||
readonly providePrefixAndSuffixTextForRename?: boolean;
|
||||
readonly provideRefactorNotApplicableReason?: boolean;
|
||||
readonly allowRenameOfImportPath?: boolean;
|
||||
readonly includePackageJsonAutoImports?: "auto" | "on" | "off";
|
||||
}
|
||||
|
||||
@@ -199,7 +199,26 @@ namespace ts.codefix {
|
||||
}
|
||||
});
|
||||
|
||||
return getSynthesizedDeepCloneWithRenames(nodeToRename, /*includeTrivia*/ true, identsToRenameMap, checker);
|
||||
return getSynthesizedDeepCloneWithReplacements(nodeToRename, /*includeTrivia*/ true, original => {
|
||||
if (isBindingElement(original) && isIdentifier(original.name) && isObjectBindingPattern(original.parent)) {
|
||||
const symbol = checker.getSymbolAtLocation(original.name);
|
||||
const renameInfo = symbol && identsToRenameMap.get(String(getSymbolId(symbol)));
|
||||
if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) {
|
||||
return factory.createBindingElement(
|
||||
original.dotDotDotToken,
|
||||
original.propertyName || original.name,
|
||||
renameInfo,
|
||||
original.initializer);
|
||||
}
|
||||
}
|
||||
else if (isIdentifier(original)) {
|
||||
const symbol = checker.getSymbolAtLocation(original);
|
||||
const renameInfo = symbol && identsToRenameMap.get(String(getSymbolId(symbol)));
|
||||
if (renameInfo) {
|
||||
return factory.createIdentifier(renameInfo.text);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getNewNameIfConflict(name: Identifier, originalNames: ReadonlyESMap<string, Symbol[]>): SynthIdentifier {
|
||||
@@ -289,7 +308,7 @@ namespace ts.codefix {
|
||||
|
||||
const tryStatement = factory.createTryStatement(tryBlock, catchClause, /*finallyBlock*/ undefined);
|
||||
const destructuredResult = prevArgName && varDeclIdentifier && isSynthBindingPattern(prevArgName)
|
||||
&& factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([factory.createVariableDeclaration(getSynthesizedDeepCloneWithRenames(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], NodeFlags.Const));
|
||||
&& factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([factory.createVariableDeclaration(getSynthesizedDeepClone(prevArgName.bindingPattern), /*exclamationToken*/ undefined, /*type*/ undefined, varDeclIdentifier)], NodeFlags.Const));
|
||||
return compact([varDeclList, tryStatement, destructuredResult]);
|
||||
}
|
||||
|
||||
@@ -302,7 +321,6 @@ namespace ts.codefix {
|
||||
const [onFulfilled, onRejected] = node.arguments;
|
||||
const onFulfilledArgumentName = getArgBindingName(onFulfilled, transformer);
|
||||
const transformationBody = getTransformationBody(onFulfilled, prevArgName, onFulfilledArgumentName, node, transformer);
|
||||
|
||||
if (onRejected) {
|
||||
const onRejectedArgumentName = getArgBindingName(onRejected, transformer);
|
||||
const tryBlock = factory.createBlock(transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody));
|
||||
@@ -310,10 +328,8 @@ namespace ts.codefix {
|
||||
const catchArg = onRejectedArgumentName ? isSynthIdentifier(onRejectedArgumentName) ? onRejectedArgumentName.identifier.text : onRejectedArgumentName.bindingPattern : "e";
|
||||
const catchVariableDeclaration = factory.createVariableDeclaration(catchArg);
|
||||
const catchClause = factory.createCatchClause(catchVariableDeclaration, factory.createBlock(transformationBody2));
|
||||
|
||||
return [factory.createTryStatement(tryBlock, catchClause, /* finallyBlock */ undefined)];
|
||||
}
|
||||
|
||||
return transformExpression(node.expression, transformer, onFulfilledArgumentName).concat(transformationBody);
|
||||
}
|
||||
|
||||
@@ -395,11 +411,12 @@ namespace ts.codefix {
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction: {
|
||||
const funcBody = (func as FunctionExpression | ArrowFunction).body;
|
||||
const returnType = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)?.getReturnType();
|
||||
|
||||
// Arrow functions with block bodies { } will enter this control flow
|
||||
if (isBlock(funcBody)) {
|
||||
let refactoredStmts: Statement[] = [];
|
||||
let seenReturnStatement = false;
|
||||
|
||||
for (const statement of funcBody.statements) {
|
||||
if (isReturnStatement(statement)) {
|
||||
seenReturnStatement = true;
|
||||
@@ -407,7 +424,8 @@ namespace ts.codefix {
|
||||
refactoredStmts = refactoredStmts.concat(getInnerTransformationBody(transformer, [statement], prevArgName));
|
||||
}
|
||||
else {
|
||||
refactoredStmts.push(...maybeAnnotateAndReturn(statement.expression, parent.typeArguments?.[0]));
|
||||
const possiblyAwaitedRightHandSide = returnType && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType, statement.expression) : statement.expression;
|
||||
refactoredStmts.push(...maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, parent.typeArguments?.[0]));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -431,19 +449,21 @@ namespace ts.codefix {
|
||||
return innerCbBody;
|
||||
}
|
||||
|
||||
const type = transformer.checker.getTypeAtLocation(func);
|
||||
const returnType = getLastCallSignature(type, transformer.checker)!.getReturnType();
|
||||
const rightHandSide = getSynthesizedDeepClone(funcBody);
|
||||
const possiblyAwaitedRightHandSide = !!transformer.checker.getPromisedTypeOfPromise(returnType) ? factory.createAwaitExpression(rightHandSide) : rightHandSide;
|
||||
if (!shouldReturn(parent, transformer)) {
|
||||
const transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined);
|
||||
if (prevArgName) {
|
||||
prevArgName.types.push(returnType);
|
||||
if (returnType) {
|
||||
const possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType, funcBody);
|
||||
if (!shouldReturn(parent, transformer)) {
|
||||
const transformedStatement = createVariableOrAssignmentOrExpressionStatement(prevArgName, possiblyAwaitedRightHandSide, /*typeAnnotation*/ undefined);
|
||||
if (prevArgName) {
|
||||
prevArgName.types.push(returnType);
|
||||
}
|
||||
return transformedStatement;
|
||||
}
|
||||
else {
|
||||
return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, parent.typeArguments?.[0]);
|
||||
}
|
||||
return transformedStatement;
|
||||
}
|
||||
else {
|
||||
return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, parent.typeArguments?.[0]);
|
||||
return silentFail();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -454,12 +474,16 @@ namespace ts.codefix {
|
||||
return emptyArray;
|
||||
}
|
||||
|
||||
function getPossiblyAwaitedRightHandSide(checker: TypeChecker, type: Type, expr: Expression): AwaitExpression | Expression {
|
||||
const rightHandSide = getSynthesizedDeepClone(expr);
|
||||
return !!checker.getPromisedTypeOfPromise(type) ? factory.createAwaitExpression(rightHandSide) : rightHandSide;
|
||||
}
|
||||
|
||||
function getLastCallSignature(type: Type, checker: TypeChecker): Signature | undefined {
|
||||
const callSignatures = checker.getSignaturesOfType(type, SignatureKind.Call);
|
||||
return lastOrUndefined(callSignatures);
|
||||
}
|
||||
|
||||
|
||||
function removeReturns(stmts: readonly Statement[], prevArgName: SynthBindingName | undefined, transformer: Transformer, seenReturnStatement: boolean): readonly Statement[] {
|
||||
const ret: Statement[] = [];
|
||||
for (const stmt of stmts) {
|
||||
|
||||
@@ -44,10 +44,24 @@ namespace ts.codefix {
|
||||
const exports = collectExportRenames(sourceFile, checker, identifiers);
|
||||
convertExportsAccesses(sourceFile, exports, changes);
|
||||
let moduleExportsChangedToDefault = false;
|
||||
for (const statement of sourceFile.statements) {
|
||||
const moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, quotePreference);
|
||||
let useSitesToUnqualify: ESMap<Node, Node> | undefined;
|
||||
// Process variable statements first to collect use sites that need to be updated inside other transformations
|
||||
for (const statement of filter(sourceFile.statements, isVariableStatement)) {
|
||||
const newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference);
|
||||
if (newUseSites) {
|
||||
copyEntries(newUseSites, useSitesToUnqualify ??= new Map());
|
||||
}
|
||||
}
|
||||
// `convertStatement` will delete entries from `useSitesToUnqualify` when containing statements are replaced
|
||||
for (const statement of filter(sourceFile.statements, s => !isVariableStatement(s))) {
|
||||
const moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports, useSitesToUnqualify, quotePreference);
|
||||
moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged;
|
||||
}
|
||||
// Remaining use sites can be changed directly
|
||||
useSitesToUnqualify?.forEach((replacement, original) => {
|
||||
changes.replaceNode(sourceFile, original, replacement);
|
||||
});
|
||||
|
||||
return moduleExportsChangedToDefault;
|
||||
}
|
||||
|
||||
@@ -98,7 +112,17 @@ namespace ts.codefix {
|
||||
/** Whether `module.exports =` was changed to `export default` */
|
||||
type ModuleExportsChanged = boolean;
|
||||
|
||||
function convertStatement(sourceFile: SourceFile, statement: Statement, checker: TypeChecker, changes: textChanges.ChangeTracker, identifiers: Identifiers, target: ScriptTarget, exports: ExportRenames, quotePreference: QuotePreference): ModuleExportsChanged {
|
||||
function convertStatement(
|
||||
sourceFile: SourceFile,
|
||||
statement: Statement,
|
||||
checker: TypeChecker,
|
||||
changes: textChanges.ChangeTracker,
|
||||
identifiers: Identifiers,
|
||||
target: ScriptTarget,
|
||||
exports: ExportRenames,
|
||||
useSitesToUnqualify: ESMap<Node, Node> | undefined,
|
||||
quotePreference: QuotePreference
|
||||
): ModuleExportsChanged {
|
||||
switch (statement.kind) {
|
||||
case SyntaxKind.VariableStatement:
|
||||
convertVariableStatement(sourceFile, statement as VariableStatement, changes, checker, identifiers, target, quotePreference);
|
||||
@@ -115,7 +139,7 @@ namespace ts.codefix {
|
||||
}
|
||||
case SyntaxKind.BinaryExpression: {
|
||||
const { operatorToken } = expression as BinaryExpression;
|
||||
return operatorToken.kind === SyntaxKind.EqualsToken && convertAssignment(sourceFile, checker, expression as BinaryExpression, changes, exports);
|
||||
return operatorToken.kind === SyntaxKind.EqualsToken && convertAssignment(sourceFile, checker, expression as BinaryExpression, changes, exports, useSitesToUnqualify);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -133,20 +157,20 @@ namespace ts.codefix {
|
||||
identifiers: Identifiers,
|
||||
target: ScriptTarget,
|
||||
quotePreference: QuotePreference,
|
||||
): void {
|
||||
): ESMap<Node, Node> | undefined {
|
||||
const { declarationList } = statement;
|
||||
let foundImport = false;
|
||||
const newNodes = flatMap(declarationList.declarations, decl => {
|
||||
const converted = map(declarationList.declarations, decl => {
|
||||
const { name, initializer } = decl;
|
||||
if (initializer) {
|
||||
if (isExportsOrModuleExportsOrAlias(sourceFile, initializer)) {
|
||||
// `const alias = module.exports;` can be removed.
|
||||
foundImport = true;
|
||||
return [];
|
||||
return convertedImports([]);
|
||||
}
|
||||
else if (isRequireCall(initializer, /*checkArgumentIsStringLiteralLike*/ true)) {
|
||||
foundImport = true;
|
||||
return convertSingleImport(sourceFile, name, initializer.arguments[0], changes, checker, identifiers, target, quotePreference);
|
||||
return convertSingleImport(name, initializer.arguments[0], checker, identifiers, target, quotePreference);
|
||||
}
|
||||
else if (isPropertyAccessExpression(initializer) && isRequireCall(initializer.expression, /*checkArgumentIsStringLiteralLike*/ true)) {
|
||||
foundImport = true;
|
||||
@@ -154,29 +178,37 @@ namespace ts.codefix {
|
||||
}
|
||||
}
|
||||
// Move it out to its own variable statement. (This will not be used if `!foundImport`)
|
||||
return factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([decl], declarationList.flags));
|
||||
return convertedImports([factory.createVariableStatement(/*modifiers*/ undefined, factory.createVariableDeclarationList([decl], declarationList.flags))]);
|
||||
});
|
||||
if (foundImport) {
|
||||
// useNonAdjustedEndPosition to ensure we don't eat the newline after the statement.
|
||||
changes.replaceNodeWithNodes(sourceFile, statement, newNodes);
|
||||
changes.replaceNodeWithNodes(sourceFile, statement, flatMap(converted, c => c.newImports));
|
||||
let combinedUseSites: ESMap<Node, Node> | undefined;
|
||||
forEach(converted, c => {
|
||||
if (c.useSitesToUnqualify) {
|
||||
copyEntries(c.useSitesToUnqualify, combinedUseSites ??= new Map());
|
||||
}
|
||||
});
|
||||
|
||||
return combinedUseSites;
|
||||
}
|
||||
}
|
||||
|
||||
/** Converts `const name = require("moduleSpecifier").propertyName` */
|
||||
function convertPropertyAccessImport(name: BindingName, propertyName: string, moduleSpecifier: StringLiteralLike, identifiers: Identifiers, quotePreference: QuotePreference): readonly Node[] {
|
||||
function convertPropertyAccessImport(name: BindingName, propertyName: string, moduleSpecifier: StringLiteralLike, identifiers: Identifiers, quotePreference: QuotePreference): ConvertedImports {
|
||||
switch (name.kind) {
|
||||
case SyntaxKind.ObjectBindingPattern:
|
||||
case SyntaxKind.ArrayBindingPattern: {
|
||||
// `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;`
|
||||
const tmp = makeUniqueName(propertyName, identifiers);
|
||||
return [
|
||||
return convertedImports([
|
||||
makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference),
|
||||
makeConst(/*modifiers*/ undefined, name, factory.createIdentifier(tmp)),
|
||||
];
|
||||
]);
|
||||
}
|
||||
case SyntaxKind.Identifier:
|
||||
// `const a = require("b").c` --> `import { c as a } from "./b";
|
||||
return [makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)];
|
||||
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
|
||||
default:
|
||||
return Debug.assertNever(name, `Convert to ES6 module got invalid syntax form ${(name as BindingName).kind}`);
|
||||
}
|
||||
@@ -188,6 +220,7 @@ namespace ts.codefix {
|
||||
assignment: BinaryExpression,
|
||||
changes: textChanges.ChangeTracker,
|
||||
exports: ExportRenames,
|
||||
useSitesToUnqualify: ESMap<Node, Node> | undefined,
|
||||
): ModuleExportsChanged {
|
||||
const { left, right } = assignment;
|
||||
if (!isPropertyAccessExpression(left)) {
|
||||
@@ -200,7 +233,7 @@ namespace ts.codefix {
|
||||
changes.delete(sourceFile, assignment.parent);
|
||||
}
|
||||
else {
|
||||
const replacement = isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right)
|
||||
const replacement = isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify)
|
||||
: isRequireCall(right, /*checkArgumentIsStringLiteralLike*/ true) ? convertReExportAll(right.arguments[0], checker)
|
||||
: undefined;
|
||||
if (replacement) {
|
||||
@@ -224,7 +257,7 @@ namespace ts.codefix {
|
||||
* Convert `module.exports = { ... }` to individual exports..
|
||||
* We can't always do this if the module has interesting members -- then it will be a default export instead.
|
||||
*/
|
||||
function tryChangeModuleExportsObject(object: ObjectLiteralExpression): [readonly Statement[], ModuleExportsChanged] | undefined {
|
||||
function tryChangeModuleExportsObject(object: ObjectLiteralExpression, useSitesToUnqualify: ESMap<Node, Node> | undefined): [readonly Statement[], ModuleExportsChanged] | undefined {
|
||||
const statements = mapAllOrFail(object.properties, prop => {
|
||||
switch (prop.kind) {
|
||||
case SyntaxKind.GetAccessor:
|
||||
@@ -235,9 +268,9 @@ namespace ts.codefix {
|
||||
case SyntaxKind.SpreadAssignment:
|
||||
return undefined;
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
return !isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer);
|
||||
return !isIdentifier(prop.name) ? undefined : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify);
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
return !isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [factory.createToken(SyntaxKind.ExportKeyword)], prop);
|
||||
return !isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [factory.createToken(SyntaxKind.ExportKeyword)], prop, useSitesToUnqualify);
|
||||
default:
|
||||
Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${(prop as ObjectLiteralElementLike).kind}`);
|
||||
}
|
||||
@@ -307,7 +340,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
// TODO: GH#22492 this will cause an error if a change has been made inside the body of the node.
|
||||
function convertExportsDotXEquals_replaceNode(name: string | undefined, exported: Expression): Statement {
|
||||
function convertExportsDotXEquals_replaceNode(name: string | undefined, exported: Expression, useSitesToUnqualify: ESMap<Node, Node> | undefined): Statement {
|
||||
const modifiers = [factory.createToken(SyntaxKind.ExportKeyword)];
|
||||
switch (exported.kind) {
|
||||
case SyntaxKind.FunctionExpression: {
|
||||
@@ -321,17 +354,39 @@ namespace ts.codefix {
|
||||
// falls through
|
||||
case SyntaxKind.ArrowFunction:
|
||||
// `exports.f = function() {}` --> `export function f() {}`
|
||||
return functionExpressionToDeclaration(name, modifiers, exported as FunctionExpression | ArrowFunction);
|
||||
return functionExpressionToDeclaration(name, modifiers, exported as FunctionExpression | ArrowFunction, useSitesToUnqualify);
|
||||
case SyntaxKind.ClassExpression:
|
||||
// `exports.C = class {}` --> `export class C {}`
|
||||
return classExpressionToDeclaration(name, modifiers, exported as ClassExpression);
|
||||
return classExpressionToDeclaration(name, modifiers, exported as ClassExpression, useSitesToUnqualify);
|
||||
default:
|
||||
return exportConst();
|
||||
}
|
||||
|
||||
function exportConst() {
|
||||
// `exports.x = 0;` --> `export const x = 0;`
|
||||
return makeConst(modifiers, factory.createIdentifier(name!), exported); // TODO: GH#18217
|
||||
return makeConst(modifiers, factory.createIdentifier(name!), replaceImportUseSites(exported, useSitesToUnqualify)); // TODO: GH#18217
|
||||
}
|
||||
}
|
||||
|
||||
function replaceImportUseSites<T extends Node>(node: T, useSitesToUnqualify: ESMap<Node, Node> | undefined): T;
|
||||
function replaceImportUseSites<T extends Node>(nodes: NodeArray<T>, useSitesToUnqualify: ESMap<Node, Node> | undefined): NodeArray<T>;
|
||||
function replaceImportUseSites<T extends Node>(nodeOrNodes: T | NodeArray<T>, useSitesToUnqualify: ESMap<Node, Node> | undefined) {
|
||||
if (!useSitesToUnqualify || !some(arrayFrom(useSitesToUnqualify.keys()), original => rangeContainsRange(nodeOrNodes, original))) {
|
||||
return nodeOrNodes;
|
||||
}
|
||||
|
||||
return isArray(nodeOrNodes)
|
||||
? getSynthesizedDeepClonesWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode)
|
||||
: getSynthesizedDeepCloneWithReplacements(nodeOrNodes, /*includeTrivia*/ true, replaceNode);
|
||||
|
||||
function replaceNode(original: Node) {
|
||||
// We are replacing `mod.SomeExport` wih `SomeExport`, so we only need to look at PropertyAccessExpressions
|
||||
if (original.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
const replacement = useSitesToUnqualify!.get(original);
|
||||
// Remove entry from `useSitesToUnqualify` so the refactor knows it's taken care of by the parent statement we're replacing
|
||||
useSitesToUnqualify!.delete(original);
|
||||
return replacement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,15 +396,13 @@ namespace ts.codefix {
|
||||
* May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`.
|
||||
*/
|
||||
function convertSingleImport(
|
||||
file: SourceFile,
|
||||
name: BindingName,
|
||||
moduleSpecifier: StringLiteralLike,
|
||||
changes: textChanges.ChangeTracker,
|
||||
checker: TypeChecker,
|
||||
identifiers: Identifiers,
|
||||
target: ScriptTarget,
|
||||
quotePreference: QuotePreference,
|
||||
): readonly Node[] {
|
||||
): ConvertedImports {
|
||||
switch (name.kind) {
|
||||
case SyntaxKind.ObjectBindingPattern: {
|
||||
const importSpecifiers = mapAllOrFail(name.elements, e =>
|
||||
@@ -359,7 +412,7 @@ namespace ts.codefix {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
: makeImportSpecifier(e.propertyName && (e.propertyName as Identifier).text, e.name.text));
|
||||
if (importSpecifiers) {
|
||||
return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)];
|
||||
return convertedImports([makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier, quotePreference)]);
|
||||
}
|
||||
}
|
||||
// falls through -- object destructuring has an interesting pattern and must be a variable declaration
|
||||
@@ -369,13 +422,13 @@ namespace ts.codefix {
|
||||
const [a, b, c] = x;
|
||||
*/
|
||||
const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers);
|
||||
return [
|
||||
return convertedImports([
|
||||
makeImport(factory.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier, quotePreference),
|
||||
makeConst(/*modifiers*/ undefined, getSynthesizedDeepClone(name), factory.createIdentifier(tmp)),
|
||||
];
|
||||
]);
|
||||
}
|
||||
case SyntaxKind.Identifier:
|
||||
return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers, quotePreference);
|
||||
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
|
||||
default:
|
||||
return Debug.assertNever(name, `Convert to ES6 module got invalid name kind ${(name as BindingName).kind}`);
|
||||
}
|
||||
@@ -385,12 +438,13 @@ namespace ts.codefix {
|
||||
* Convert `import x = require("x").`
|
||||
* Also converts uses like `x.y()` to `y()` and uses a named import.
|
||||
*/
|
||||
function convertSingleIdentifierImport(file: SourceFile, name: Identifier, moduleSpecifier: StringLiteralLike, changes: textChanges.ChangeTracker, checker: TypeChecker, identifiers: Identifiers, quotePreference: QuotePreference): readonly Node[] {
|
||||
function convertSingleIdentifierImport(name: Identifier, moduleSpecifier: StringLiteralLike, checker: TypeChecker, identifiers: Identifiers, quotePreference: QuotePreference): ConvertedImports {
|
||||
const nameSymbol = checker.getSymbolAtLocation(name);
|
||||
// Maps from module property name to name actually used. (The same if there isn't shadowing.)
|
||||
const namedBindingsNames = new Map<string, string>();
|
||||
// True if there is some non-property use like `x()` or `f(x)`.
|
||||
let needDefaultImport = false;
|
||||
let useSitesToUnqualify: ESMap<Node, Node> | undefined;
|
||||
|
||||
for (const use of identifiers.original.get(name.text)!) {
|
||||
if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) {
|
||||
@@ -407,7 +461,8 @@ namespace ts.codefix {
|
||||
idName = makeUniqueName(propertyName, identifiers);
|
||||
namedBindingsNames.set(propertyName, idName);
|
||||
}
|
||||
changes.replaceNode(file, parent, factory.createIdentifier(idName));
|
||||
|
||||
(useSitesToUnqualify ??= new Map()).set(parent, factory.createIdentifier(idName));
|
||||
}
|
||||
else {
|
||||
needDefaultImport = true;
|
||||
@@ -420,7 +475,10 @@ namespace ts.codefix {
|
||||
// If it was unused, ensure that we at least import *something*.
|
||||
needDefaultImport = true;
|
||||
}
|
||||
return [makeImport(needDefaultImport ? getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)];
|
||||
return convertedImports(
|
||||
[makeImport(needDefaultImport ? getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier, quotePreference)],
|
||||
useSitesToUnqualify
|
||||
);
|
||||
}
|
||||
|
||||
// Identifiers helpers
|
||||
@@ -476,7 +534,7 @@ namespace ts.codefix {
|
||||
|
||||
// Node helpers
|
||||
|
||||
function functionExpressionToDeclaration(name: string | undefined, additionalModifiers: readonly Modifier[], fn: FunctionExpression | ArrowFunction | MethodDeclaration): FunctionDeclaration {
|
||||
function functionExpressionToDeclaration(name: string | undefined, additionalModifiers: readonly Modifier[], fn: FunctionExpression | ArrowFunction | MethodDeclaration, useSitesToUnqualify: ESMap<Node, Node> | undefined): FunctionDeclaration {
|
||||
return factory.createFunctionDeclaration(
|
||||
getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal.
|
||||
concatenate(additionalModifiers, getSynthesizedDeepClones(fn.modifiers)),
|
||||
@@ -485,17 +543,17 @@ namespace ts.codefix {
|
||||
getSynthesizedDeepClones(fn.typeParameters),
|
||||
getSynthesizedDeepClones(fn.parameters),
|
||||
getSynthesizedDeepClone(fn.type),
|
||||
factory.converters.convertToFunctionBlock(getSynthesizedDeepClone(fn.body!)));
|
||||
factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body!, useSitesToUnqualify)));
|
||||
}
|
||||
|
||||
function classExpressionToDeclaration(name: string | undefined, additionalModifiers: readonly Modifier[], cls: ClassExpression): ClassDeclaration {
|
||||
function classExpressionToDeclaration(name: string | undefined, additionalModifiers: readonly Modifier[], cls: ClassExpression, useSitesToUnqualify: ESMap<Node, Node> | undefined): ClassDeclaration {
|
||||
return factory.createClassDeclaration(
|
||||
getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal.
|
||||
concatenate(additionalModifiers, getSynthesizedDeepClones(cls.modifiers)),
|
||||
name,
|
||||
getSynthesizedDeepClones(cls.typeParameters),
|
||||
getSynthesizedDeepClones(cls.heritageClauses),
|
||||
getSynthesizedDeepClones(cls.members));
|
||||
replaceImportUseSites(cls.members, useSitesToUnqualify));
|
||||
}
|
||||
|
||||
function makeSingleImport(localName: string, propertyName: string, moduleSpecifier: StringLiteralLike, quotePreference: QuotePreference): ImportDeclaration {
|
||||
@@ -524,4 +582,16 @@ namespace ts.codefix {
|
||||
exportSpecifiers && factory.createNamedExports(exportSpecifiers),
|
||||
moduleSpecifier === undefined ? undefined : factory.createStringLiteral(moduleSpecifier));
|
||||
}
|
||||
|
||||
interface ConvertedImports {
|
||||
newImports: readonly Node[];
|
||||
useSitesToUnqualify?: ESMap<Node, Node>;
|
||||
}
|
||||
|
||||
function convertedImports(newImports: readonly Node[], useSitesToUnqualify?: ESMap<Node, Node>): ConvertedImports {
|
||||
return {
|
||||
newImports,
|
||||
useSitesToUnqualify
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace ts.codefix {
|
||||
const fixedExportDeclarations = new Map<string, true>();
|
||||
return codeFixAll(context, errorCodes, (changes, diag) => {
|
||||
const exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile);
|
||||
if (exportSpecifier && !addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) {
|
||||
if (exportSpecifier && addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) {
|
||||
fixSingleExportDeclaration(changes, exportSpecifier, context);
|
||||
}
|
||||
});
|
||||
@@ -35,16 +35,7 @@ namespace ts.codefix {
|
||||
const exportDeclaration = exportClause.parent;
|
||||
const typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context);
|
||||
if (typeExportSpecifiers.length === exportClause.elements.length) {
|
||||
changes.replaceNode(
|
||||
context.sourceFile,
|
||||
exportDeclaration,
|
||||
factory.updateExportDeclaration(
|
||||
exportDeclaration,
|
||||
exportDeclaration.decorators,
|
||||
exportDeclaration.modifiers,
|
||||
/*isTypeOnly*/ true,
|
||||
exportClause,
|
||||
exportDeclaration.moduleSpecifier));
|
||||
changes.insertModifierBefore(context.sourceFile, SyntaxKind.TypeKeyword, exportClause);
|
||||
}
|
||||
else {
|
||||
const valueExportDeclaration = factory.updateExportDeclaration(
|
||||
@@ -61,7 +52,10 @@ namespace ts.codefix {
|
||||
factory.createNamedExports(typeExportSpecifiers),
|
||||
exportDeclaration.moduleSpecifier);
|
||||
|
||||
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration);
|
||||
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
||||
leadingTriviaOption: textChanges.LeadingTriviaOption.IncludeAll,
|
||||
trailingTriviaOption: textChanges.TrailingTriviaOption.Exclude
|
||||
});
|
||||
changes.insertNodeAfter(context.sourceFile, exportDeclaration, typeExportDeclaration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace ts.codefix {
|
||||
return;
|
||||
}
|
||||
|
||||
const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(character, preferences)}}`;
|
||||
const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`;
|
||||
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,6 @@ namespace ts.codefix {
|
||||
else {
|
||||
Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code);
|
||||
}
|
||||
return generateAccessorFromProperty(file, startPosition, endPosition, context, Diagnostics.Generate_get_and_set_accessors.message);
|
||||
return generateAccessorFromProperty(file, context.program, startPosition, endPosition, context, Diagnostics.Generate_get_and_set_accessors.message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace ts.codefix {
|
||||
error: string
|
||||
};
|
||||
|
||||
export function generateAccessorFromProperty(file: SourceFile, start: number, end: number, context: textChanges.TextChangesContext, _actionName: string): FileTextChanges[] | undefined {
|
||||
const fieldInfo = getAccessorConvertiblePropertyAtPosition(file, start, end);
|
||||
export function generateAccessorFromProperty(file: SourceFile, program: Program, start: number, end: number, context: textChanges.TextChangesContext, _actionName: string): FileTextChanges[] | undefined {
|
||||
const fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end);
|
||||
if (!fieldInfo || !fieldInfo.info) return undefined;
|
||||
|
||||
const changeTracker = textChanges.ChangeTracker.fromContext(context);
|
||||
@@ -51,7 +51,7 @@ namespace ts.codefix {
|
||||
}
|
||||
}
|
||||
|
||||
updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers);
|
||||
updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, fieldModifiers);
|
||||
|
||||
const getAccessor = generateGetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic, container);
|
||||
suppressLeadingAndTrailingTrivia(getAccessor);
|
||||
@@ -112,7 +112,7 @@ namespace ts.codefix {
|
||||
return modifierFlags;
|
||||
}
|
||||
|
||||
export function getAccessorConvertiblePropertyAtPosition(file: SourceFile, start: number, end: number, considerEmptySpans = true): InfoOrError | undefined {
|
||||
export function getAccessorConvertiblePropertyAtPosition(file: SourceFile, program: Program, start: number, end: number, considerEmptySpans = true): InfoOrError | undefined {
|
||||
const node = getTokenAtPosition(file, start);
|
||||
const cursorRequest = start === end && considerEmptySpans;
|
||||
const declaration = findAncestor(node.parent, isAcceptedDeclaration);
|
||||
@@ -145,7 +145,7 @@ namespace ts.codefix {
|
||||
info: {
|
||||
isStatic: hasStaticModifier(declaration),
|
||||
isReadonly: hasEffectiveReadonlyModifier(declaration),
|
||||
type: getTypeAnnotationNode(declaration),
|
||||
type: getDeclarationType(declaration, program),
|
||||
container: declaration.kind === SyntaxKind.Parameter ? declaration.parent.parent : declaration.parent,
|
||||
originalName: (<AcceptedNameType>declaration.name).text,
|
||||
declaration,
|
||||
@@ -195,14 +195,14 @@ namespace ts.codefix {
|
||||
);
|
||||
}
|
||||
|
||||
function updatePropertyDeclaration(changeTracker: textChanges.ChangeTracker, file: SourceFile, declaration: PropertyDeclaration, fieldName: AcceptedNameType, modifiers: ModifiersArray | undefined) {
|
||||
function updatePropertyDeclaration(changeTracker: textChanges.ChangeTracker, file: SourceFile, declaration: PropertyDeclaration, type: TypeNode | undefined, fieldName: AcceptedNameType, modifiers: ModifiersArray | undefined) {
|
||||
const property = factory.updatePropertyDeclaration(
|
||||
declaration,
|
||||
declaration.decorators,
|
||||
modifiers,
|
||||
fieldName,
|
||||
declaration.questionToken || declaration.exclamationToken,
|
||||
declaration.type,
|
||||
type,
|
||||
declaration.initializer
|
||||
);
|
||||
changeTracker.replaceNode(file, declaration, property);
|
||||
@@ -213,9 +213,9 @@ namespace ts.codefix {
|
||||
changeTracker.replacePropertyAssignment(file, declaration, assignment);
|
||||
}
|
||||
|
||||
function updateFieldDeclaration(changeTracker: textChanges.ChangeTracker, file: SourceFile, declaration: AcceptedDeclaration, fieldName: AcceptedNameType, modifiers: ModifiersArray | undefined) {
|
||||
function updateFieldDeclaration(changeTracker: textChanges.ChangeTracker, file: SourceFile, declaration: AcceptedDeclaration, type: TypeNode | undefined, fieldName: AcceptedNameType, modifiers: ModifiersArray | undefined) {
|
||||
if (isPropertyDeclaration(declaration)) {
|
||||
updatePropertyDeclaration(changeTracker, file, declaration, fieldName, modifiers);
|
||||
updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers);
|
||||
}
|
||||
else if (isPropertyAssignment(declaration)) {
|
||||
updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName);
|
||||
@@ -251,6 +251,19 @@ namespace ts.codefix {
|
||||
});
|
||||
}
|
||||
|
||||
function getDeclarationType(declaration: AcceptedDeclaration, program: Program): TypeNode | undefined {
|
||||
const typeNode = getTypeAnnotationNode(declaration);
|
||||
if (isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) {
|
||||
const typeChecker = program.getTypeChecker();
|
||||
const type = typeChecker.getTypeFromTypeNode(typeNode);
|
||||
if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type)) {
|
||||
const types = isUnionTypeNode(typeNode) ? typeNode.types : [typeNode];
|
||||
return factory.createUnionTypeNode([...types, factory.createKeywordTypeNode(SyntaxKind.UndefinedKeyword)]);
|
||||
}
|
||||
}
|
||||
return typeNode;
|
||||
}
|
||||
|
||||
export function getAllSupers(decl: ClassOrInterface | undefined, checker: TypeChecker): readonly ClassOrInterface[] {
|
||||
const res: ClassLikeDeclaration[] = [];
|
||||
while (decl) {
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace ts.codefix {
|
||||
const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker));
|
||||
const exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, host, program, useAutoImportProvider);
|
||||
const preferTypeOnlyImport = !!usageIsTypeOnly && compilerOptions.importsNotUsedAsValues === ImportsNotUsedAsValues.Error;
|
||||
const useRequire = shouldUseRequire(sourceFile, compilerOptions);
|
||||
const useRequire = shouldUseRequire(sourceFile, program);
|
||||
const fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, preferTypeOnlyImport, useRequire, host, preferences);
|
||||
addImport({ fixes: [fix], symbolName });
|
||||
}
|
||||
@@ -211,7 +211,7 @@ namespace ts.codefix {
|
||||
): { readonly moduleSpecifier: string, readonly codeAction: CodeAction } {
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
const exportInfos = getAllReExportingModules(sourceFile, exportedSymbol, moduleSymbol, symbolName, host, program, /*useAutoImportProvider*/ true);
|
||||
const useRequire = shouldUseRequire(sourceFile, compilerOptions);
|
||||
const useRequire = shouldUseRequire(sourceFile, program);
|
||||
const preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === ImportsNotUsedAsValues.Error && !isSourceFileJS(sourceFile) && isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position));
|
||||
const moduleSpecifier = first(getNewImportInfos(program, sourceFile, position, preferTypeOnlyImport, useRequire, exportInfos, host, preferences)).moduleSpecifier;
|
||||
const fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, preferTypeOnlyImport, useRequire, host, preferences);
|
||||
@@ -239,7 +239,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
const defaultInfo = getDefaultLikeExportInfo(importingFile, moduleSymbol, checker, compilerOptions);
|
||||
if (defaultInfo && defaultInfo.name === symbolName && skipAlias(defaultInfo.symbol, checker) === exportedSymbol) {
|
||||
if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && skipAlias(defaultInfo.symbol, checker) === exportedSymbol) {
|
||||
result.push({ moduleSymbol, importKind: defaultInfo.kind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(defaultInfo.symbol, checker) });
|
||||
}
|
||||
|
||||
@@ -362,10 +362,31 @@ namespace ts.codefix {
|
||||
});
|
||||
}
|
||||
|
||||
function shouldUseRequire(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean {
|
||||
return isSourceFileJS(sourceFile)
|
||||
&& !sourceFile.externalModuleIndicator
|
||||
&& (!!sourceFile.commonJsModuleIndicator || getEmitModuleKind(compilerOptions) < ModuleKind.ES2015);
|
||||
function shouldUseRequire(sourceFile: SourceFile, program: Program): boolean {
|
||||
// 1. TypeScript files don't use require variable declarations
|
||||
if (!isSourceFileJS(sourceFile)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. If the current source file is unambiguously CJS or ESM, go with that
|
||||
if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) return true;
|
||||
if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) return false;
|
||||
|
||||
// 3. If there's a tsconfig/jsconfig, use its module setting
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions.configFile) {
|
||||
return getEmitModuleKind(compilerOptions) < ModuleKind.ES2015;
|
||||
}
|
||||
|
||||
// 4. Match the first other JS file in the program that's unambiguously CJS or ESM
|
||||
for (const otherFile of program.getSourceFiles()) {
|
||||
if (otherFile === sourceFile || !isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) continue;
|
||||
if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) return true;
|
||||
if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) return false;
|
||||
}
|
||||
|
||||
// 5. Literally nothing to go on
|
||||
return true;
|
||||
}
|
||||
|
||||
function getNewImportInfos(
|
||||
@@ -445,7 +466,7 @@ namespace ts.codefix {
|
||||
const symbol = checker.getAliasedSymbol(umdSymbol);
|
||||
const symbolName = umdSymbol.name;
|
||||
const exportInfos: readonly SymbolExportInfo[] = [{ moduleSymbol: symbol, importKind: getUmdImportKind(sourceFile, program.getCompilerOptions()), exportedSymbolIsTypeOnly: false }];
|
||||
const useRequire = shouldUseRequire(sourceFile, program.getCompilerOptions());
|
||||
const useRequire = shouldUseRequire(sourceFile, program);
|
||||
const fixes = getFixForImport(exportInfos, symbolName, isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*preferTypeOnlyImport*/ false, useRequire, program, sourceFile, host, preferences);
|
||||
return { fixes, symbolName };
|
||||
}
|
||||
@@ -497,8 +518,8 @@ namespace ts.codefix {
|
||||
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
const preferTypeOnlyImport = compilerOptions.importsNotUsedAsValues === ImportsNotUsedAsValues.Error && isValidTypeOnlyAliasUseSite(symbolToken);
|
||||
const useRequire = shouldUseRequire(sourceFile, compilerOptions);
|
||||
const exportInfos = getExportInfos(symbolName, getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, checker, program, useAutoImportProvider, host);
|
||||
const useRequire = shouldUseRequire(sourceFile, program);
|
||||
const exportInfos = getExportInfos(symbolName, getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host);
|
||||
const fixes = arrayFrom(flatMapIterator(exportInfos.entries(), ([_, exportInfos]) =>
|
||||
getFixForImport(exportInfos, symbolName, symbolToken.getStart(sourceFile), preferTypeOnlyImport, useRequire, program, sourceFile, host, preferences)));
|
||||
return { fixes, symbolName };
|
||||
@@ -521,7 +542,6 @@ namespace ts.codefix {
|
||||
currentTokenMeaning: SemanticMeaning,
|
||||
cancellationToken: CancellationToken,
|
||||
sourceFile: SourceFile,
|
||||
checker: TypeChecker,
|
||||
program: Program,
|
||||
useAutoImportProvider: boolean,
|
||||
host: LanguageServiceHost
|
||||
@@ -529,21 +549,23 @@ namespace ts.codefix {
|
||||
// For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once.
|
||||
// Maps symbol id to info for modules providing that symbol (original export + re-exports).
|
||||
const originalSymbolToExportInfos = createMultiMap<SymbolExportInfo>();
|
||||
function addSymbol(moduleSymbol: Symbol, exportedSymbol: Symbol, importKind: ImportKind): void {
|
||||
function addSymbol(moduleSymbol: Symbol, exportedSymbol: Symbol, importKind: ImportKind, checker: TypeChecker): void {
|
||||
originalSymbolToExportInfos.add(getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol, importKind, exportedSymbolIsTypeOnly: isTypeOnlySymbol(exportedSymbol, checker) });
|
||||
}
|
||||
forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, moduleSymbol => {
|
||||
forEachExternalModuleToImportFrom(program, host, sourceFile, /*filterByPackageJson*/ true, useAutoImportProvider, (moduleSymbol, _, program) => {
|
||||
const checker = program.getTypeChecker();
|
||||
cancellationToken.throwIfCancellationRequested();
|
||||
|
||||
const defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, program.getCompilerOptions());
|
||||
if (defaultInfo && defaultInfo.name === symbolName && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) {
|
||||
addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind);
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
const defaultInfo = getDefaultLikeExportInfo(sourceFile, moduleSymbol, checker, compilerOptions);
|
||||
if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) {
|
||||
addSymbol(moduleSymbol, defaultInfo.symbol, defaultInfo.kind, checker);
|
||||
}
|
||||
|
||||
// check exports with the same name
|
||||
const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol);
|
||||
if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) {
|
||||
addSymbol(moduleSymbol, exportSymbolWithIdenticalName, ImportKind.Named);
|
||||
addSymbol(moduleSymbol, exportSymbolWithIdenticalName, ImportKind.Named, checker);
|
||||
}
|
||||
});
|
||||
return originalSymbolToExportInfos;
|
||||
@@ -600,14 +622,20 @@ namespace ts.codefix {
|
||||
|
||||
if (defaultExport.flags & SymbolFlags.Alias) {
|
||||
const aliased = checker.getImmediateAliasedSymbol(defaultExport);
|
||||
return aliased && getDefaultExportInfoWorker(aliased, Debug.checkDefined(aliased.parent, "Alias targets of default exports must have a parent"), checker, compilerOptions);
|
||||
if (aliased && aliased.parent) {
|
||||
// - `aliased` will be undefined if the module is exporting an unresolvable name,
|
||||
// but we can still offer completions for it.
|
||||
// - `aliased.parent` will be undefined if the module is exporting `globalThis.something`,
|
||||
// or another expression that resolves to a global.
|
||||
return getDefaultExportInfoWorker(aliased, aliased.parent, checker, compilerOptions);
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultExport.escapedName !== InternalSymbolName.Default &&
|
||||
defaultExport.escapedName !== InternalSymbolName.ExportEquals) {
|
||||
return { symbolForMeaning: defaultExport, name: defaultExport.getName() };
|
||||
}
|
||||
return { symbolForMeaning: defaultExport, name: moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target!) };
|
||||
return { symbolForMeaning: defaultExport, name: moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) };
|
||||
}
|
||||
|
||||
function getNameForExportDefault(symbol: Symbol): string | undefined {
|
||||
@@ -916,11 +944,11 @@ namespace ts.codefix {
|
||||
|| (!!globalCachePath && startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent));
|
||||
}
|
||||
|
||||
export function moduleSymbolToValidIdentifier(moduleSymbol: Symbol, target: ScriptTarget): string {
|
||||
export function moduleSymbolToValidIdentifier(moduleSymbol: Symbol, target: ScriptTarget | undefined): string {
|
||||
return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(moduleSymbol.name)), target);
|
||||
}
|
||||
|
||||
export function moduleSpecifierToValidIdentifier(moduleSpecifier: string, target: ScriptTarget): string {
|
||||
export function moduleSpecifierToValidIdentifier(moduleSpecifier: string, target: ScriptTarget | undefined): string {
|
||||
const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
|
||||
let res = "";
|
||||
let lastCharWasValid = true;
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace ts.codefix {
|
||||
importAdder: ImportAdder,
|
||||
sourceFile: SourceFile,
|
||||
parameterDeclaration: ParameterDeclaration,
|
||||
containingFunction: FunctionLike,
|
||||
containingFunction: SignatureDeclaration,
|
||||
program: Program,
|
||||
host: LanguageServiceHost,
|
||||
cancellationToken: CancellationToken,
|
||||
@@ -268,7 +268,7 @@ namespace ts.codefix {
|
||||
}
|
||||
}
|
||||
|
||||
function annotateJSDocThis(changes: textChanges.ChangeTracker, sourceFile: SourceFile, containingFunction: FunctionLike, typeNode: TypeNode) {
|
||||
function annotateJSDocThis(changes: textChanges.ChangeTracker, sourceFile: SourceFile, containingFunction: SignatureDeclaration, typeNode: TypeNode) {
|
||||
addJSDocTags(changes, sourceFile, containingFunction, [
|
||||
factory.createJSDocThisTag(/*tagName*/ undefined, factory.createJSDocTypeExpression(typeNode)),
|
||||
]);
|
||||
@@ -409,7 +409,7 @@ namespace ts.codefix {
|
||||
}));
|
||||
}
|
||||
|
||||
function getFunctionReferences(containingFunction: FunctionLike, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): readonly Identifier[] | undefined {
|
||||
function getFunctionReferences(containingFunction: SignatureDeclaration, sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): readonly Identifier[] | undefined {
|
||||
let searchToken;
|
||||
switch (containingFunction.kind) {
|
||||
case SyntaxKind.Constructor:
|
||||
@@ -534,7 +534,7 @@ namespace ts.codefix {
|
||||
return combineTypes(inferTypesFromReferencesSingle(references));
|
||||
}
|
||||
|
||||
function parameters(declaration: FunctionLike): ParameterInference[] | undefined {
|
||||
function parameters(declaration: SignatureDeclaration): ParameterInference[] | undefined {
|
||||
if (references.length === 0 || !declaration.parameters) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+29
-16
@@ -308,7 +308,7 @@ namespace ts.Completions {
|
||||
}
|
||||
|
||||
for (const literal of literals) {
|
||||
entries.push(createCompletionEntryForLiteral(literal, preferences));
|
||||
entries.push(createCompletionEntryForLiteral(sourceFile, preferences, literal));
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -360,13 +360,13 @@ namespace ts.Completions {
|
||||
});
|
||||
}
|
||||
|
||||
function completionNameForLiteral(literal: string | number | PseudoBigInt, preferences: UserPreferences): string {
|
||||
function completionNameForLiteral(sourceFile: SourceFile, preferences: UserPreferences, literal: string | number | PseudoBigInt): string {
|
||||
return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" :
|
||||
isString(literal) ? quote(literal, preferences) : JSON.stringify(literal);
|
||||
isString(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal);
|
||||
}
|
||||
|
||||
function createCompletionEntryForLiteral(literal: string | number | PseudoBigInt, preferences: UserPreferences): CompletionEntry {
|
||||
return { name: completionNameForLiteral(literal, preferences), kind: ScriptElementKind.string, kindModifiers: ScriptElementKindModifier.none, sortText: SortText.LocationPriority };
|
||||
function createCompletionEntryForLiteral(sourceFile: SourceFile, preferences: UserPreferences, literal: string | number | PseudoBigInt): CompletionEntry {
|
||||
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: ScriptElementKind.string, kindModifiers: ScriptElementKindModifier.none, sortText: SortText.LocationPriority };
|
||||
}
|
||||
|
||||
function createCompletionEntry(
|
||||
@@ -391,13 +391,13 @@ namespace ts.Completions {
|
||||
const useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
|
||||
if (origin && originIsThisType(origin)) {
|
||||
insertText = needsConvertPropertyAccess
|
||||
? `this${insertQuestionDot ? "?." : ""}[${quotePropertyName(name, preferences)}]`
|
||||
? `this${insertQuestionDot ? "?." : ""}[${quotePropertyName(sourceFile, preferences, name)}]`
|
||||
: `this${insertQuestionDot ? "?." : "."}${name}`;
|
||||
}
|
||||
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
|
||||
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
|
||||
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
|
||||
insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(name, preferences)}]` : `[${name}]` : name;
|
||||
insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name)}]` : `[${name}]` : name;
|
||||
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
|
||||
insertText = `?.${insertText}`;
|
||||
}
|
||||
@@ -458,12 +458,12 @@ namespace ts.Completions {
|
||||
};
|
||||
}
|
||||
|
||||
function quotePropertyName(name: string, preferences: UserPreferences): string {
|
||||
function quotePropertyName(sourceFile: SourceFile, preferences: UserPreferences, name: string,): string {
|
||||
if (/^\d+$/.test(name)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
return quote(name, preferences);
|
||||
return quote(sourceFile, preferences, name);
|
||||
}
|
||||
|
||||
function isRecommendedCompletionMatch(localSymbol: Symbol, recommendedCompletion: Symbol | undefined, checker: TypeChecker): boolean {
|
||||
@@ -614,7 +614,7 @@ namespace ts.Completions {
|
||||
|
||||
const { symbols, literals, location, completionKind, symbolToOriginInfoMap, previousToken, isJsxInitializer, isTypeOnlyLocation } = completionData;
|
||||
|
||||
const literal = find(literals, l => completionNameForLiteral(l, preferences) === entryId.name);
|
||||
const literal = find(literals, l => completionNameForLiteral(sourceFile, preferences, l) === entryId.name);
|
||||
if (literal !== undefined) return { type: "literal", literal };
|
||||
|
||||
// Find the symbol with the matching entry name.
|
||||
@@ -678,7 +678,7 @@ namespace ts.Completions {
|
||||
}
|
||||
case "literal": {
|
||||
const { literal } = symbolCompletion;
|
||||
return createSimpleDetails(completionNameForLiteral(literal, preferences), ScriptElementKind.string, typeof literal === "string" ? SymbolDisplayPartKind.stringLiteral : SymbolDisplayPartKind.numericLiteral);
|
||||
return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), ScriptElementKind.string, typeof literal === "string" ? SymbolDisplayPartKind.stringLiteral : SymbolDisplayPartKind.numericLiteral);
|
||||
}
|
||||
case "none":
|
||||
// Didn't find a symbol with this name. See if we can find a keyword instead.
|
||||
@@ -1891,10 +1891,12 @@ namespace ts.Completions {
|
||||
let existingMembers: readonly Declaration[] | undefined;
|
||||
|
||||
if (objectLikeContainer.kind === SyntaxKind.ObjectLiteralExpression) {
|
||||
const instantiatedType = typeChecker.getContextualType(objectLikeContainer);
|
||||
const completionsType = instantiatedType && typeChecker.getContextualType(objectLikeContainer, ContextFlags.Completions);
|
||||
if (!instantiatedType || !completionsType) return GlobalsSearch.Fail;
|
||||
isNewIdentifierLocation = hasIndexSignature(instantiatedType || completionsType);
|
||||
const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker);
|
||||
if (instantiatedType === undefined) {
|
||||
return GlobalsSearch.Fail;
|
||||
}
|
||||
const completionsType = typeChecker.getContextualType(objectLikeContainer, ContextFlags.Completions);
|
||||
isNewIdentifierLocation = hasIndexSignature(completionsType || instantiatedType);
|
||||
typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker);
|
||||
existingMembers = objectLikeContainer.properties;
|
||||
}
|
||||
@@ -2585,7 +2587,6 @@ namespace ts.Completions {
|
||||
|| kind === SyntaxKind.ModuleKeyword
|
||||
|| kind === SyntaxKind.TypeKeyword
|
||||
|| kind === SyntaxKind.NamespaceKeyword
|
||||
|| kind === SyntaxKind.AsKeyword
|
||||
|| isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword;
|
||||
case KeywordCompletionFilters.FunctionLikeBodyKeywords:
|
||||
return isFunctionLikeBodyKeyword(kind);
|
||||
@@ -2660,6 +2661,7 @@ namespace ts.Completions {
|
||||
function isFunctionLikeBodyKeyword(kind: SyntaxKind) {
|
||||
return kind === SyntaxKind.AsyncKeyword
|
||||
|| kind === SyntaxKind.AwaitKeyword
|
||||
|| kind === SyntaxKind.AsKeyword
|
||||
|| !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
|
||||
}
|
||||
|
||||
@@ -2830,4 +2832,15 @@ namespace ts.Completions {
|
||||
function isStaticProperty(symbol: Symbol) {
|
||||
return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & ModifierFlags.Static && isClassLike(symbol.valueDeclaration.parent));
|
||||
}
|
||||
|
||||
function tryGetObjectLiteralContextualType(node: ObjectLiteralExpression, typeChecker: TypeChecker) {
|
||||
const type = typeChecker.getContextualType(node);
|
||||
if (type) {
|
||||
return type;
|
||||
}
|
||||
if (isBinaryExpression(node.parent) && node.parent.operatorToken.kind === SyntaxKind.EqualsToken) {
|
||||
return typeChecker.getTypeAtLocation(node.parent);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,11 +558,15 @@ namespace ts.formatting {
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
return childKind !== SyntaxKind.Block;
|
||||
case SyntaxKind.ArrowFunction:
|
||||
if (sourceFile && childKind === SyntaxKind.ParenthesizedExpression) {
|
||||
return rangeIsOnOneLine(sourceFile, child!);
|
||||
}
|
||||
return childKind !== SyntaxKind.Block;
|
||||
case SyntaxKind.ExportDeclaration:
|
||||
return childKind !== SyntaxKind.NamedExports;
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
|
||||
@@ -92,9 +92,16 @@ namespace ts.GoToDefinition {
|
||||
getDefinitionFromSymbol(typeChecker, propertySymbol, node));
|
||||
}
|
||||
}
|
||||
|
||||
return getDefinitionFromSymbol(typeChecker, symbol, node);
|
||||
}
|
||||
|
||||
function isShorthandPropertyAssignmentOfModuleExports(symbol: Symbol): boolean {
|
||||
const shorthandProperty = tryCast(symbol.valueDeclaration, isShorthandPropertyAssignment);
|
||||
const binaryExpression = tryCast(shorthandProperty?.parent.parent, isAssignmentExpression);
|
||||
return !!binaryExpression && getAssignmentDeclarationKind(binaryExpression) === AssignmentDeclarationKind.ModuleExports;
|
||||
}
|
||||
|
||||
/**
|
||||
* True if we should not add definitions for both the signature symbol and the definition symbol.
|
||||
* True for `const |f = |() => 0`, false for `function |f() {} const |g = f;`.
|
||||
@@ -197,15 +204,29 @@ namespace ts.GoToDefinition {
|
||||
}
|
||||
|
||||
function getSymbol(node: Node, checker: TypeChecker): Symbol | undefined {
|
||||
const symbol = checker.getSymbolAtLocation(node);
|
||||
let symbol = checker.getSymbolAtLocation(node);
|
||||
// If this is an alias, and the request came at the declaration location
|
||||
// get the aliased symbol instead. This allows for goto def on an import e.g.
|
||||
// import {A, B} from "mod";
|
||||
// to jump to the implementation directly.
|
||||
if (symbol && symbol.flags & SymbolFlags.Alias && shouldSkipAlias(node, symbol.declarations[0])) {
|
||||
const aliased = checker.getAliasedSymbol(symbol);
|
||||
if (aliased.declarations) {
|
||||
return aliased;
|
||||
while (symbol) {
|
||||
if (symbol.flags & SymbolFlags.Alias && shouldSkipAlias(node, symbol.declarations[0])) {
|
||||
const aliased = checker.getAliasedSymbol(symbol);
|
||||
if (!aliased.declarations) {
|
||||
break;
|
||||
}
|
||||
symbol = aliased;
|
||||
}
|
||||
else if (isShorthandPropertyAssignmentOfModuleExports(symbol)) {
|
||||
// Skip past `module.exports = { Foo }` even though 'Foo' is not a real alias
|
||||
const shorthandTarget = checker.resolveName(symbol.name, symbol.valueDeclaration, SymbolFlags.Value, /*excludeGlobals*/ false);
|
||||
if (!some(shorthandTarget?.declarations)) {
|
||||
break;
|
||||
}
|
||||
symbol = shorthandTarget;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return symbol;
|
||||
|
||||
@@ -329,6 +329,7 @@ namespace ts.JsDoc {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.MethodSignature:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
const { parameters } = commentOwner as FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | MethodSignature;
|
||||
return { commentOwner, parameters };
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace ts.NavigationBar {
|
||||
|
||||
case SyntaxKind.ExportAssignment: {
|
||||
const expression = (<ExportAssignment>node).expression;
|
||||
const child = isObjectLiteralExpression(expression) ? expression :
|
||||
const child = isObjectLiteralExpression(expression) || isCallExpression(expression) ? expression :
|
||||
isArrowFunction(expression) || isFunctionExpression(expression) ? expression.body : undefined;
|
||||
if (child) {
|
||||
startNode(node);
|
||||
@@ -843,16 +843,11 @@ namespace ts.NavigationBar {
|
||||
}
|
||||
|
||||
// Otherwise, we need to aggregate each identifier to build up the qualified name.
|
||||
const result: string[] = [];
|
||||
|
||||
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
|
||||
|
||||
const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)];
|
||||
while (moduleDeclaration.body && moduleDeclaration.body.kind === SyntaxKind.ModuleDeclaration) {
|
||||
moduleDeclaration = <ModuleDeclaration>moduleDeclaration.body;
|
||||
|
||||
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
|
||||
}
|
||||
|
||||
return result.join(".");
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace ts.OutliningElementsCollector {
|
||||
}
|
||||
}
|
||||
|
||||
function functionSpan(node: FunctionLike, body: Block, sourceFile: SourceFile): OutliningSpan | undefined {
|
||||
function functionSpan(node: SignatureDeclaration, body: Block, sourceFile: SourceFile): OutliningSpan | undefined {
|
||||
const openToken = tryGetFunctionOpenToken(node, body, sourceFile);
|
||||
const closeToken = findChildOfKind(body, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
return openToken && closeToken && spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ node.kind !== SyntaxKind.ArrowFunction);
|
||||
@@ -303,7 +303,7 @@ namespace ts.OutliningElementsCollector {
|
||||
return { textSpan, kind, hintSpan, bannerText, autoCollapse };
|
||||
}
|
||||
|
||||
function tryGetFunctionOpenToken(node: FunctionLike, body: Block, sourceFile: SourceFile): Node | undefined {
|
||||
function tryGetFunctionOpenToken(node: SignatureDeclaration, body: Block, sourceFile: SourceFile): Node | undefined {
|
||||
if (isNodeArrayMultiLine(node.parameters, sourceFile)) {
|
||||
const openParenToken = findChildOfKind(node, SyntaxKind.OpenParenToken, sourceFile);
|
||||
if (openParenToken) {
|
||||
|
||||
@@ -73,10 +73,19 @@ namespace ts.refactor.convertStringOrTemplateLiteral {
|
||||
}
|
||||
|
||||
function getParentBinaryExpression(expr: Node) {
|
||||
while (isBinaryExpression(expr.parent) && isNotEqualsOperator(expr.parent)) {
|
||||
expr = expr.parent;
|
||||
}
|
||||
return expr;
|
||||
const container = findAncestor(expr.parent, n => {
|
||||
switch (n.kind) {
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return false;
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return !(isBinaryExpression(n.parent) && isNotEqualsOperator(n.parent));
|
||||
default:
|
||||
return "quit";
|
||||
}
|
||||
});
|
||||
|
||||
return container || expr;
|
||||
}
|
||||
|
||||
function isStringConcatenationValid(node: Node): boolean {
|
||||
|
||||
@@ -51,9 +51,11 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
error: string;
|
||||
};
|
||||
|
||||
type Occurrence = PropertyAccessExpression | ElementAccessExpression | Identifier;
|
||||
|
||||
interface Info {
|
||||
finalExpression: PropertyAccessExpression | CallExpression,
|
||||
occurrences: (PropertyAccessExpression | Identifier)[],
|
||||
finalExpression: PropertyAccessExpression | ElementAccessExpression | CallExpression,
|
||||
occurrences: Occurrence[],
|
||||
expression: ValidExpression,
|
||||
};
|
||||
|
||||
@@ -107,7 +109,7 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
|
||||
if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) {
|
||||
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) };
|
||||
};
|
||||
}
|
||||
|
||||
if ((isPropertyAccessExpression(condition) || isIdentifier(condition))
|
||||
&& getMatchingStart(condition, finalExpression.expression)) {
|
||||
@@ -136,8 +138,8 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
/**
|
||||
* Gets a list of property accesses that appear in matchTo and occur in sequence in expression.
|
||||
*/
|
||||
function getOccurrencesInExpression(matchTo: Expression, expression: Expression): (PropertyAccessExpression | Identifier)[] | undefined {
|
||||
const occurrences: (PropertyAccessExpression | Identifier)[] = [];
|
||||
function getOccurrencesInExpression(matchTo: Expression, expression: Expression): Occurrence[] | undefined {
|
||||
const occurrences: Occurrence[] = [];
|
||||
while (isBinaryExpression(expression) && expression.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {
|
||||
const match = getMatchingStart(skipParentheses(matchTo), skipParentheses(expression.right));
|
||||
if (!match) {
|
||||
@@ -157,9 +159,11 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
/**
|
||||
* Returns subchain if chain begins with subchain syntactically.
|
||||
*/
|
||||
function getMatchingStart(chain: Expression, subchain: Expression): PropertyAccessExpression | Identifier | undefined {
|
||||
return (isIdentifier(subchain) || isPropertyAccessExpression(subchain)) &&
|
||||
chainStartsWith(chain, subchain) ? subchain : undefined;
|
||||
function getMatchingStart(chain: Expression, subchain: Expression): PropertyAccessExpression | ElementAccessExpression | Identifier | undefined {
|
||||
if (!isIdentifier(subchain) && !isPropertyAccessExpression(subchain) && !isElementAccessExpression(subchain)) {
|
||||
return undefined;
|
||||
}
|
||||
return chainStartsWith(chain, subchain) ? subchain : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,14 +171,14 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
*/
|
||||
function chainStartsWith(chain: Node, subchain: Node): boolean {
|
||||
// skip until we find a matching identifier.
|
||||
while (isCallExpression(chain) || isPropertyAccessExpression(chain)) {
|
||||
const subchainName = isPropertyAccessExpression(subchain) ? subchain.name.getText() : subchain.getText();
|
||||
if (isPropertyAccessExpression(chain) && chain.name.getText() === subchainName) break;
|
||||
while (isCallExpression(chain) || isPropertyAccessExpression(chain) || isElementAccessExpression(chain)) {
|
||||
if (getTextOfChainNode(chain) === getTextOfChainNode(subchain)) break;
|
||||
chain = chain.expression;
|
||||
}
|
||||
// check that the chains match at each access. Call chains in subchain are not valid.
|
||||
while (isPropertyAccessExpression(chain) && isPropertyAccessExpression(subchain)) {
|
||||
if (chain.name.getText() !== subchain.name.getText()) return false;
|
||||
// check that the chains match at each access. Call chains in subchain are not valid.
|
||||
while ((isPropertyAccessExpression(chain) && isPropertyAccessExpression(subchain)) ||
|
||||
(isElementAccessExpression(chain) && isElementAccessExpression(subchain))) {
|
||||
if (getTextOfChainNode(chain) !== getTextOfChainNode(subchain)) return false;
|
||||
chain = chain.expression;
|
||||
subchain = subchain.expression;
|
||||
}
|
||||
@@ -182,6 +186,19 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
return isIdentifier(chain) && isIdentifier(subchain) && chain.getText() === subchain.getText();
|
||||
}
|
||||
|
||||
function getTextOfChainNode(node: Node): string | undefined {
|
||||
if (isIdentifier(node) || isStringOrNumericLiteralLike(node)) {
|
||||
return node.getText();
|
||||
}
|
||||
if (isPropertyAccessExpression(node)) {
|
||||
return getTextOfChainNode(node.name);
|
||||
}
|
||||
if (isElementAccessExpression(node)) {
|
||||
return getTextOfChainNode(node.argumentExpression);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the least ancestor of the input node that is a valid type for extraction and contains the input span.
|
||||
*/
|
||||
@@ -229,7 +246,7 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
* it is followed by a different binary operator.
|
||||
* @param node the right child of a binary expression or a call expression.
|
||||
*/
|
||||
function getFinalExpressionInChain(node: Expression): CallExpression | PropertyAccessExpression | undefined {
|
||||
function getFinalExpressionInChain(node: Expression): CallExpression | PropertyAccessExpression | ElementAccessExpression | undefined {
|
||||
// foo && |foo.bar === 1|; - here the right child of the && binary expression is another binary expression.
|
||||
// the rightmost member of the && chain should be the leftmost child of that expression.
|
||||
node = skipParentheses(node);
|
||||
@@ -237,7 +254,7 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
return getFinalExpressionInChain(node.left);
|
||||
}
|
||||
// foo && |foo.bar()()| - nested calls are treated like further accesses.
|
||||
else if ((isPropertyAccessExpression(node) || isCallExpression(node)) && !isOptionalChain(node)) {
|
||||
else if ((isPropertyAccessExpression(node) || isElementAccessExpression(node) || isCallExpression(node)) && !isOptionalChain(node)) {
|
||||
return node;
|
||||
}
|
||||
return undefined;
|
||||
@@ -246,8 +263,8 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
/**
|
||||
* Creates an access chain from toConvert with '?.' accesses at expressions appearing in occurrences.
|
||||
*/
|
||||
function convertOccurrences(checker: TypeChecker, toConvert: Expression, occurrences: (PropertyAccessExpression | Identifier)[]): Expression {
|
||||
if (isPropertyAccessExpression(toConvert) || isCallExpression(toConvert)) {
|
||||
function convertOccurrences(checker: TypeChecker, toConvert: Expression, occurrences: Occurrence[]): Expression {
|
||||
if (isPropertyAccessExpression(toConvert) || isElementAccessExpression(toConvert) || isCallExpression(toConvert)) {
|
||||
const chain = convertOccurrences(checker, toConvert.expression, occurrences);
|
||||
const lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : undefined;
|
||||
const isOccurrence = lastOccurrence?.getText() === toConvert.expression.getText();
|
||||
@@ -262,6 +279,11 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
factory.createPropertyAccessChain(chain, factory.createToken(SyntaxKind.QuestionDotToken), toConvert.name) :
|
||||
factory.createPropertyAccessChain(chain, toConvert.questionDotToken, toConvert.name);
|
||||
}
|
||||
else if (isElementAccessExpression(toConvert)) {
|
||||
return isOccurrence ?
|
||||
factory.createElementAccessChain(chain, factory.createToken(SyntaxKind.QuestionDotToken), toConvert.argumentExpression) :
|
||||
factory.createElementAccessChain(chain, toConvert.questionDotToken, toConvert.argumentExpression);
|
||||
}
|
||||
}
|
||||
return toConvert;
|
||||
}
|
||||
@@ -270,7 +292,7 @@ namespace ts.refactor.convertToOptionalChainExpression {
|
||||
const { finalExpression, occurrences, expression } = info;
|
||||
const firstOccurrence = occurrences[occurrences.length - 1];
|
||||
const convertedChain = convertOccurrences(checker, finalExpression, occurrences);
|
||||
if (convertedChain && (isPropertyAccessExpression(convertedChain) || isCallExpression(convertedChain))) {
|
||||
if (convertedChain && (isPropertyAccessExpression(convertedChain) || isElementAccessExpression(convertedChain) || isCallExpression(convertedChain))) {
|
||||
if (isBinaryExpression(expression)) {
|
||||
changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain);
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace ts.refactor {
|
||||
if (symbol) {
|
||||
const declaration = cast(first(symbol.declarations), isTypeParameterDeclaration);
|
||||
if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) {
|
||||
result.push(declaration);
|
||||
pushIfUnique(result, declaration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor {
|
||||
registerRefactor(actionName, {
|
||||
getEditsForAction(context, actionName) {
|
||||
if (!context.endPosition) return undefined;
|
||||
const info = codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition);
|
||||
const info = codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition);
|
||||
if (!info || !info.info) return undefined;
|
||||
const edits = codefix.generateAccessorFromProperty(context.file, context.startPosition, context.endPosition, context, actionName);
|
||||
const edits = codefix.generateAccessorFromProperty(context.file, context.program, context.startPosition, context.endPosition, context, actionName);
|
||||
if (!edits) return undefined;
|
||||
|
||||
const renameFilename = context.file.fileName;
|
||||
@@ -19,7 +19,7 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor {
|
||||
},
|
||||
getAvailableActions(context: RefactorContext): readonly ApplicableRefactorInfo[] {
|
||||
if (!context.endPosition) return emptyArray;
|
||||
const info = codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.startPosition, context.endPosition, context.triggerReason === "invoked");
|
||||
const info = codefix.getAccessorConvertiblePropertyAtPosition(context.file, context.program, context.startPosition, context.endPosition, context.triggerReason === "invoked");
|
||||
if (!info) return emptyArray;
|
||||
|
||||
if (!info.error) {
|
||||
|
||||
@@ -2077,6 +2077,11 @@ namespace ts {
|
||||
|
||||
// Push all text changes.
|
||||
for (let i = firstLine; i <= lastLine; i++) {
|
||||
// If the range is multiline and ends on a beginning of a line, don't comment/uncomment.
|
||||
if (firstLine !== lastLine && lineStarts[i] === textRange.end) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const lineTextStart = lineTextStarts.get(i.toString());
|
||||
|
||||
// If the line is not an empty line; otherwise no-op.
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace ts.SmartSelectionRange {
|
||||
const prevNode: Node | undefined = children[i - 1];
|
||||
const node: Node = children[i];
|
||||
const nextNode: Node | undefined = children[i + 1];
|
||||
if (node.getStart(sourceFile) > pos) {
|
||||
if (getTokenPosOfNode(node, sourceFile, /*includeJsDoc*/ true) > pos) {
|
||||
break outer;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ namespace ts.SmartSelectionRange {
|
||||
// of things that should be considered independently.
|
||||
// 3. A VariableStatement’s children are just a VaraiableDeclarationList and a semicolon.
|
||||
// 4. A lone VariableDeclaration in a VaraibleDeclaration feels redundant with the VariableStatement.
|
||||
//
|
||||
// Dive in without pushing a selection range.
|
||||
if (isBlock(node)
|
||||
|| isTemplateSpan(node) || isTemplateHead(node) || isTemplateTail(node)
|
||||
|| prevNode && isTemplateHead(prevNode)
|
||||
|| isVariableDeclarationList(node) && isVariableStatement(parentNode)
|
||||
|| isSyntaxList(node) && isVariableDeclarationList(parentNode)
|
||||
|| isVariableDeclaration(node) && isSyntaxList(parentNode) && children.length === 1) {
|
||||
|| isVariableDeclaration(node) && isSyntaxList(parentNode) && children.length === 1
|
||||
|| isJSDocTypeExpression(node) || isJSDocSignature(node) || isJSDocTypeLiteral(node)) {
|
||||
parentNode = node;
|
||||
break;
|
||||
}
|
||||
@@ -44,16 +44,15 @@ namespace ts.SmartSelectionRange {
|
||||
|
||||
// Blocks with braces, brackets, parens, or JSX tags on separate lines should be
|
||||
// selected from open to close, including whitespace but not including the braces/etc. themselves.
|
||||
const isBetweenMultiLineBookends = isSyntaxList(node)
|
||||
&& isListOpener(prevNode)
|
||||
&& isListCloser(nextNode)
|
||||
const isBetweenMultiLineBookends = isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode)
|
||||
&& !positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile);
|
||||
const jsDocCommentStart = hasJSDocNodes(node) && node.jsDoc![0].getStart();
|
||||
const start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart();
|
||||
const end = isBetweenMultiLineBookends ? nextNode.getStart() : node.getEnd();
|
||||
if (isNumber(jsDocCommentStart)) {
|
||||
pushSelectionRange(jsDocCommentStart, end);
|
||||
const end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node);
|
||||
|
||||
if (hasJSDocNodes(node) && node.jsDoc?.length) {
|
||||
pushSelectionRange(first(node.jsDoc).getStart(), end);
|
||||
}
|
||||
|
||||
pushSelectionRange(start, end);
|
||||
|
||||
// String literals should have a stop both inside and outside their quotes.
|
||||
@@ -270,4 +269,17 @@ namespace ts.SmartSelectionRange {
|
||||
|| kind === SyntaxKind.CloseParenToken
|
||||
|| kind === SyntaxKind.JsxClosingElement;
|
||||
}
|
||||
|
||||
function getEndPos(sourceFile: SourceFile, node: Node): number {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.JSDocParameterTag:
|
||||
case SyntaxKind.JSDocCallbackTag:
|
||||
case SyntaxKind.JSDocPropertyTag:
|
||||
case SyntaxKind.JSDocTypedefTag:
|
||||
case SyntaxKind.JSDocThisTag:
|
||||
return sourceFile.getLineEndOfPosition(node.getStart());
|
||||
default:
|
||||
return node.getEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ts {
|
||||
|
||||
function check(node: Node) {
|
||||
if (isJsFile) {
|
||||
if (canBeConvertedToClass(node)) {
|
||||
if (canBeConvertedToClass(node, checker)) {
|
||||
diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) ? node.parent.name : node, Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));
|
||||
}
|
||||
}
|
||||
@@ -190,14 +190,13 @@ namespace ts {
|
||||
return `${exp.pos.toString()}:${exp.end.toString()}`;
|
||||
}
|
||||
|
||||
function canBeConvertedToClass(node: Node): boolean {
|
||||
function canBeConvertedToClass(node: Node, checker: TypeChecker): boolean {
|
||||
if (node.kind === SyntaxKind.FunctionExpression) {
|
||||
if (isVariableDeclaration(node.parent) && node.symbol.members?.size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const decl = getDeclarationOfExpando(node);
|
||||
const symbol = decl?.symbol;
|
||||
const symbol = checker.getSymbolOfExpando(node, /*allowDeclaration*/ false);
|
||||
return !!(symbol && (symbol.exports?.size || symbol.members?.size));
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace ts.SymbolDisplay {
|
||||
else if ((isNameOfFunctionDeclaration(location) && !(symbolFlags & SymbolFlags.Accessor)) || // name of function declaration
|
||||
(location.kind === SyntaxKind.ConstructorKeyword && location.parent.kind === SyntaxKind.Constructor)) { // At constructor keyword of constructor declaration
|
||||
// get the signature from the declaration and write it
|
||||
const functionDeclaration = <FunctionLike>location.parent;
|
||||
const functionDeclaration = <SignatureDeclaration>location.parent;
|
||||
// Use function declaration to write the signatures only if the symbol corresponding to this declaration
|
||||
const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, declaration =>
|
||||
declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration));
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace ts.textChanges {
|
||||
|
||||
export type ThisTypeAnnotatable = FunctionDeclaration | FunctionExpression;
|
||||
|
||||
export function isThisTypeAnnotatable(containingFunction: FunctionLike): containingFunction is ThisTypeAnnotatable {
|
||||
export function isThisTypeAnnotatable(containingFunction: SignatureDeclaration): containingFunction is ThisTypeAnnotatable {
|
||||
return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction);
|
||||
}
|
||||
|
||||
|
||||
+43
-51
@@ -1173,7 +1173,21 @@ namespace ts {
|
||||
}
|
||||
|
||||
const children = n.getChildren(sourceFile);
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const i = binarySearchKey(children, position, (_, i) => i, (middle, _) => {
|
||||
// This last callback is more of a selector than a comparator -
|
||||
// `EqualTo` causes the `middle` result to be returned
|
||||
// `GreaterThan` causes recursion on the left of the middle
|
||||
// `LessThan` causes recursion on the right of the middle
|
||||
if (position < children[middle].end) {
|
||||
// first element whose end position is greater than the input position
|
||||
if (!children[middle - 1] || position >= children[middle - 1].end) {
|
||||
return Comparison.EqualTo;
|
||||
}
|
||||
return Comparison.GreaterThan;
|
||||
}
|
||||
return Comparison.LessThan;
|
||||
});
|
||||
if (i >= 0 && children[i]) {
|
||||
const child = children[i];
|
||||
// Note that the span of a node's tokens is [node.getStart(...), node.end).
|
||||
// Given that `position < child.end` and child has constituent tokens, we distinguish these cases:
|
||||
@@ -1813,7 +1827,9 @@ namespace ts {
|
||||
return preferences.quotePreference === "single" ? QuotePreference.Single : QuotePreference.Double;
|
||||
}
|
||||
else {
|
||||
const firstModuleSpecifier = sourceFile.imports && find(sourceFile.imports, isStringLiteral);
|
||||
// ignore synthetic import added when importHelpers: true
|
||||
const firstModuleSpecifier = sourceFile.imports &&
|
||||
find(sourceFile.imports, n => isStringLiteral(n) && !nodeIsSynthesized(n.parent)) as StringLiteral;
|
||||
return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : QuotePreference.Double;
|
||||
}
|
||||
}
|
||||
@@ -2247,45 +2263,26 @@ namespace ts {
|
||||
return clone;
|
||||
}
|
||||
|
||||
export function getSynthesizedDeepCloneWithRenames<T extends Node>(node: T, includeTrivia = true, renameMap?: ESMap<string, Identifier>, checker?: TypeChecker, callback?: (originalNode: Node, clone: Node) => any): T {
|
||||
let clone;
|
||||
if (renameMap && checker && isBindingElement(node) && isIdentifier(node.name) && isObjectBindingPattern(node.parent)) {
|
||||
const symbol = checker.getSymbolAtLocation(node.name);
|
||||
const renameInfo = symbol && renameMap.get(String(getSymbolId(symbol)));
|
||||
|
||||
if (renameInfo && renameInfo.text !== (node.name || node.propertyName).getText()) {
|
||||
clone = setOriginalNode(
|
||||
factory.createBindingElement(
|
||||
node.dotDotDotToken,
|
||||
node.propertyName || node.name,
|
||||
renameInfo,
|
||||
node.initializer),
|
||||
node);
|
||||
}
|
||||
export function getSynthesizedDeepCloneWithReplacements<T extends Node>(
|
||||
node: T,
|
||||
includeTrivia: boolean,
|
||||
replaceNode: (node: Node) => Node | undefined
|
||||
): T {
|
||||
let clone = replaceNode(node);
|
||||
if (clone) {
|
||||
setOriginalNode(clone, node);
|
||||
}
|
||||
else if (renameMap && checker && isIdentifier(node)) {
|
||||
const symbol = checker.getSymbolAtLocation(node);
|
||||
const renameInfo = symbol && renameMap.get(String(getSymbolId(symbol)));
|
||||
|
||||
if (renameInfo) {
|
||||
clone = setOriginalNode(factory.createIdentifier(renameInfo.text), node);
|
||||
}
|
||||
}
|
||||
|
||||
if (!clone) {
|
||||
clone = getSynthesizedDeepCloneWorker(node as NonNullable<T>, renameMap, checker, callback);
|
||||
else {
|
||||
clone = getSynthesizedDeepCloneWorker(node as NonNullable<T>, replaceNode);
|
||||
}
|
||||
|
||||
if (clone && !includeTrivia) suppressLeadingAndTrailingTrivia(clone);
|
||||
if (callback && clone) callback(node, clone);
|
||||
|
||||
return clone as T;
|
||||
}
|
||||
|
||||
|
||||
function getSynthesizedDeepCloneWorker<T extends Node>(node: T, renameMap?: ESMap<string, Identifier>, checker?: TypeChecker, callback?: (originalNode: Node, clone: Node) => any): T {
|
||||
const visited = (renameMap || checker || callback) ?
|
||||
visitEachChild(node, wrapper, nullTransformationContext) :
|
||||
function getSynthesizedDeepCloneWorker<T extends Node>(node: T, replaceNode?: (node: Node) => Node | undefined): T {
|
||||
const visited = replaceNode ?
|
||||
visitEachChild(node, n => getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode), nullTransformationContext) :
|
||||
visitEachChild(node, getSynthesizedDeepClone, nullTransformationContext);
|
||||
|
||||
if (visited === node) {
|
||||
@@ -2302,10 +2299,6 @@ namespace ts {
|
||||
// would have made.
|
||||
(visited as Mutable<T>).parent = undefined!;
|
||||
return visited;
|
||||
|
||||
function wrapper(node: T) {
|
||||
return getSynthesizedDeepCloneWithRenames(node, /*includeTrivia*/ true, renameMap, checker, callback);
|
||||
}
|
||||
}
|
||||
|
||||
export function getSynthesizedDeepClones<T extends Node>(nodes: NodeArray<T>, includeTrivia?: boolean): NodeArray<T>;
|
||||
@@ -2314,6 +2307,14 @@ namespace ts {
|
||||
return nodes && factory.createNodeArray(nodes.map(n => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma);
|
||||
}
|
||||
|
||||
export function getSynthesizedDeepClonesWithReplacements<T extends Node>(
|
||||
nodes: NodeArray<T>,
|
||||
includeTrivia: boolean,
|
||||
replaceNode: (node: Node) => Node | undefined
|
||||
): NodeArray<T> {
|
||||
return factory.createNodeArray(nodes.map(n => getSynthesizedDeepCloneWithReplacements(n, includeTrivia, replaceNode)), nodes.hasTrailingComma);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets EmitFlags to suppress leading and trailing trivia on the node.
|
||||
*/
|
||||
@@ -2474,20 +2475,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function quote(text: string, preferences: UserPreferences): string {
|
||||
export function quote(sourceFile: SourceFile, preferences: UserPreferences, text: string): string {
|
||||
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
|
||||
const quotePreference = preferences.quotePreference || "auto";
|
||||
const quotePreference = getQuotePreference(sourceFile, preferences);
|
||||
const quoted = JSON.stringify(text);
|
||||
switch (quotePreference) {
|
||||
// TODO use getQuotePreference to infer the actual quote style.
|
||||
case "auto":
|
||||
case "double":
|
||||
return quoted;
|
||||
case "single":
|
||||
return `'${stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"')}'`;
|
||||
default:
|
||||
return Debug.assertNever(quotePreference);
|
||||
}
|
||||
return quotePreference === QuotePreference.Single ? `'${stripQuotes(quoted).replace("'", "\\'").replace('\\"', '"')}'` : quoted;
|
||||
}
|
||||
|
||||
export function isEqualityOperatorKind(kind: SyntaxKind): kind is EqualityOperator {
|
||||
@@ -2528,7 +2520,7 @@ namespace ts {
|
||||
const checker = program.getTypeChecker();
|
||||
let typeIsAccessible = true;
|
||||
const notAccessible = () => { typeIsAccessible = false; };
|
||||
const res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, {
|
||||
const res = checker.typeToTypeNode(type, enclosingScope, NodeBuilderFlags.NoTruncation, {
|
||||
trackSymbol: (symbol, declaration, meaning) => {
|
||||
typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === SymbolAccessibility.Accessible;
|
||||
},
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
"outFile": "../../built/local/shims.js"
|
||||
},
|
||||
"files": [
|
||||
"collectionShims.ts"
|
||||
"collectionShims.ts",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
"unittests/evaluation/asyncArrow.ts",
|
||||
"unittests/evaluation/asyncGenerator.ts",
|
||||
"unittests/evaluation/awaiter.ts",
|
||||
"unittests/evaluation/destructuring.ts",
|
||||
"unittests/evaluation/forAwaitOf.ts",
|
||||
"unittests/evaluation/forOf.ts",
|
||||
"unittests/evaluation/optionalCall.ts",
|
||||
@@ -120,6 +121,7 @@
|
||||
"unittests/tsbuild/inferredTypeFromTransitiveModule.ts",
|
||||
"unittests/tsbuild/javascriptProjectEmit.ts",
|
||||
"unittests/tsbuild/lateBoundSymbol.ts",
|
||||
"unittests/tsbuild/moduleResolution.ts",
|
||||
"unittests/tsbuild/moduleSpecifiers.ts",
|
||||
"unittests/tsbuild/noEmitOnError.ts",
|
||||
"unittests/tsbuild/outFile.ts",
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
describe("unittests:: evaluation:: destructuring", () => {
|
||||
// https://github.com/microsoft/TypeScript/issues/39205
|
||||
describe("correct order for array destructuring evaluation and initializers", () => {
|
||||
it("when element is undefined", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export const output: any[] = [];
|
||||
const order = (n: any): any => output.push(n);
|
||||
let [{ [order(1)]: x } = order(0)] = [];
|
||||
`, { target: ts.ScriptTarget.ES5 });
|
||||
assert.deepEqual(result.output, [0, 1]);
|
||||
});
|
||||
it("when element is defined", async () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export const output: any[] = [];
|
||||
const order = (n: any): any => output.push(n);
|
||||
let [{ [order(1)]: x } = order(0)] = [{}];
|
||||
`, { target: ts.ScriptTarget.ES5 });
|
||||
assert.deepEqual(result.output, [1]);
|
||||
});
|
||||
});
|
||||
describe("correct order for array destructuring evaluation and initializers with spread", () => {
|
||||
it("ES5", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export const output: any[] = [];
|
||||
const order = (n: any): any => output.push(n);
|
||||
let { [order(0)]: { [order(2)]: z } = order(1), ...w } = {} as any;
|
||||
`, { target: ts.ScriptTarget.ES5 });
|
||||
assert.deepEqual(result.output, [0, 1, 2]);
|
||||
});
|
||||
it("ES2015", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
export const output: any[] = [];
|
||||
const order = (n: any): any => output.push(n);
|
||||
let { [order(0)]: { [order(2)]: z } = order(1), ...w } = {} as any;
|
||||
`, { target: ts.ScriptTarget.ES2015 });
|
||||
assert.deepEqual(result.output, [0, 1, 2]);
|
||||
});
|
||||
});
|
||||
describe("correct evaluation for nested rest assignment in destructured object", () => {
|
||||
it("ES5", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
let a: any, b: any, c: any = { x: { a: 1, y: 2 } }, d: any;
|
||||
({ x: { a, ...b } = d } = c);
|
||||
export const output = { a, b };
|
||||
`, { target: ts.ScriptTarget.ES5 });
|
||||
assert.deepEqual(result.output, { a: 1, b: { y: 2 } });
|
||||
});
|
||||
it("ES2015", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
let a: any, b: any, c: any = { x: { a: 1, y: 2 } }, d: any;
|
||||
({ x: { a, ...b } = d } = c);
|
||||
export const output = { a, b };
|
||||
`, { target: ts.ScriptTarget.ES2015 });
|
||||
assert.deepEqual(result.output, { a: 1, b: { y: 2 } });
|
||||
});
|
||||
it("ES2018", () => {
|
||||
const result = evaluator.evaluateTypeScript(`
|
||||
let a: any, b: any, c: any = { x: { a: 1, y: 2 } }, d: any;
|
||||
({ x: { a, ...b } = d } = c);
|
||||
export const output = { a, b };
|
||||
`, { target: ts.ScriptTarget.ES2018 });
|
||||
assert.deepEqual(result.output, { a: 1, b: { y: 2 } });
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1387,8 +1387,8 @@ import b = require("./moduleB");
|
||||
const diagnostics1 = program1.getFileProcessingDiagnostics().getDiagnostics();
|
||||
assert.equal(diagnostics1.length, 1, "expected one diagnostic");
|
||||
|
||||
createProgram(names, {}, compilerHost, program1);
|
||||
assert.isTrue(program1.structureIsReused === StructureIsReused.Completely);
|
||||
const program2 = createProgram(names, {}, compilerHost, program1);
|
||||
assert.isTrue(program2.structureIsReused === StructureIsReused.Completely);
|
||||
const diagnostics2 = program1.getFileProcessingDiagnostics().getDiagnostics();
|
||||
assert.equal(diagnostics2.length, 1, "expected one diagnostic");
|
||||
assert.equal(diagnostics1[0].messageText, diagnostics2[0].messageText, "expected one diagnostic");
|
||||
|
||||
@@ -93,6 +93,33 @@ namespace ts {
|
||||
});
|
||||
});
|
||||
|
||||
describe("No duplicate ref directives when emiting .d.ts->.d.ts", () => {
|
||||
it("without statements", () => {
|
||||
const host = new fakes.CompilerHost(new vfs.FileSystem(true, {
|
||||
files: {
|
||||
"/test.d.ts": `/// <reference types="node" />\n/// <reference path="./src/test.d.ts />\n`
|
||||
}
|
||||
}));
|
||||
const program = createProgram(["/test.d.ts"], { }, host);
|
||||
const file = program.getSourceFile("/test.d.ts")!;
|
||||
const printer = createPrinter({ newLine: NewLineKind.CarriageReturnLineFeed });
|
||||
const output = printer.printFile(file);
|
||||
assert.equal(output.split(/\r?\n/g).length, 3);
|
||||
});
|
||||
it("with statements", () => {
|
||||
const host = new fakes.CompilerHost(new vfs.FileSystem(true, {
|
||||
files: {
|
||||
"/test.d.ts": `/// <reference types="node" />\n/// <reference path="./src/test.d.ts />\nvar a: number;\n`
|
||||
}
|
||||
}));
|
||||
const program = createProgram(["/test.d.ts"], { }, host);
|
||||
const file = program.getSourceFile("/test.d.ts")!;
|
||||
const printer = createPrinter({ newLine: NewLineKind.CarriageReturnLineFeed });
|
||||
const output = printer.printFile(file);
|
||||
assert.equal(output.split(/\r?\n/g).length, 4);
|
||||
});
|
||||
});
|
||||
|
||||
describe("printBundle", () => {
|
||||
const printsCorrectly = makePrintsCorrectly("printsBundleCorrectly");
|
||||
let bundle: Bundle;
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace ts {
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
files[0].text = files[0].text.updateProgram("var x = 100");
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
const program1Diagnostics = program1.getSemanticDiagnostics(program1.getSourceFile("a.ts"));
|
||||
const program2Diagnostics = program2.getSemanticDiagnostics(program1.getSourceFile("a.ts"));
|
||||
assert.equal(program1Diagnostics.length, program2Diagnostics.length);
|
||||
@@ -242,7 +242,7 @@ namespace ts {
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
files[0].text = files[0].text.updateProgram("var x = 100");
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
const program1Diagnostics = program1.getSemanticDiagnostics(program1.getSourceFile("a.ts"));
|
||||
const program2Diagnostics = program2.getSemanticDiagnostics(program1.getSourceFile("a.ts"));
|
||||
assert.equal(program1Diagnostics.length, program2Diagnostics.length);
|
||||
@@ -250,63 +250,63 @@ namespace ts {
|
||||
|
||||
it("fails if change affects tripleslash references", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { target });
|
||||
updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
const newReferences = `/// <reference path='b.ts'/>
|
||||
/// <reference path='c.ts'/>
|
||||
`;
|
||||
files[0].text = files[0].text.updateReferences(newReferences);
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.SafeModules);
|
||||
});
|
||||
|
||||
it("fails if change affects type references", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { types: ["a"] });
|
||||
updateProgram(program1, ["a.ts"], { types: ["b"] }, noop);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Not);
|
||||
const program2 = updateProgram(program1, ["a.ts"], { types: ["b"] }, noop);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
});
|
||||
|
||||
it("succeeds if change doesn't affect type references", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { types: ["a"] });
|
||||
updateProgram(program1, ["a.ts"], { types: ["a"] }, noop);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
const program2 = updateProgram(program1, ["a.ts"], { types: ["a"] }, noop);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
});
|
||||
|
||||
it("fails if change affects imports", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { target });
|
||||
updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
files[2].text = files[2].text.updateImportsAndExports("import x from 'b'");
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.SafeModules);
|
||||
});
|
||||
|
||||
it("fails if change affects type directives", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { target });
|
||||
updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target }, files => {
|
||||
const newReferences = `
|
||||
/// <reference path='b.ts'/>
|
||||
/// <reference path='non-existing-file.ts'/>
|
||||
/// <reference types="typerefs1" />`;
|
||||
files[0].text = files[0].text.updateReferences(newReferences);
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.SafeModules);
|
||||
});
|
||||
|
||||
it("fails if module kind changes", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { target, module: ModuleKind.CommonJS });
|
||||
updateProgram(program1, ["a.ts"], { target, module: ModuleKind.AMD }, noop);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Not);
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target, module: ModuleKind.AMD }, noop);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
});
|
||||
|
||||
it("succeeds if rootdir changes", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { target, module: ModuleKind.CommonJS, rootDir: "/a/b" });
|
||||
updateProgram(program1, ["a.ts"], { target, module: ModuleKind.CommonJS, rootDir: "/a/c" }, noop);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target, module: ModuleKind.CommonJS, rootDir: "/a/c" }, noop);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
});
|
||||
|
||||
it("fails if config path changes", () => {
|
||||
const program1 = newProgram(files, ["a.ts"], { target, module: ModuleKind.CommonJS, configFilePath: "/a/b/tsconfig.json" });
|
||||
updateProgram(program1, ["a.ts"], { target, module: ModuleKind.CommonJS, configFilePath: "/a/c/tsconfig.json" }, noop);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Not);
|
||||
const program2 = updateProgram(program1, ["a.ts"], { target, module: ModuleKind.CommonJS, configFilePath: "/a/c/tsconfig.json" }, noop);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
});
|
||||
|
||||
it("succeeds if missing files remain missing", () => {
|
||||
@@ -318,7 +318,7 @@ namespace ts {
|
||||
const program2 = updateProgram(program1, ["a.ts"], options, noop);
|
||||
assert.deepEqual(program1.getMissingFilePaths(), program2.getMissingFilePaths());
|
||||
|
||||
assert.equal(StructureIsReused.Completely, program1.structureIsReused);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely,);
|
||||
});
|
||||
|
||||
it("fails if missing file is created", () => {
|
||||
@@ -331,7 +331,7 @@ namespace ts {
|
||||
const program2 = updateProgram(program1, ["a.ts"], options, noop, newTexts);
|
||||
assert.lengthOf(program2.getMissingFilePaths(), 0);
|
||||
|
||||
assert.equal(StructureIsReused.Not, program1.structureIsReused);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
});
|
||||
|
||||
it("resolution cache follows imports", () => {
|
||||
@@ -350,7 +350,7 @@ namespace ts {
|
||||
const program2 = updateProgram(program1, ["a.ts"], options, files => {
|
||||
files[0].text = files[0].text.updateProgram("var x = 2");
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
|
||||
// content of resolution cache should not change
|
||||
checkResolvedModulesCache(program1, "a.ts", new Map(getEntries({ b: createResolvedModule("b.ts") })));
|
||||
@@ -360,7 +360,7 @@ namespace ts {
|
||||
const program3 = updateProgram(program2, ["a.ts"], options, files => {
|
||||
files[0].text = files[0].text.updateImportsAndExports("");
|
||||
});
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program3.structureIsReused, StructureIsReused.SafeModules);
|
||||
checkResolvedModulesCache(program3, "a.ts", /*expectedContent*/ undefined);
|
||||
|
||||
const program4 = updateProgram(program3, ["a.ts"], options, files => {
|
||||
@@ -369,7 +369,7 @@ namespace ts {
|
||||
`;
|
||||
files[0].text = files[0].text.updateImportsAndExports(newImports);
|
||||
});
|
||||
assert.equal(program3.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program4.structureIsReused, StructureIsReused.SafeModules);
|
||||
checkResolvedModulesCache(program4, "a.ts", new Map(getEntries({ b: createResolvedModule("b.ts"), c: undefined })));
|
||||
});
|
||||
|
||||
@@ -424,7 +424,7 @@ namespace ts {
|
||||
const program2 = updateProgram(program1, ["/a.ts"], options, files => {
|
||||
files[0].text = files[0].text.updateProgram("var x = 2");
|
||||
});
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
|
||||
// content of resolution cache should not change
|
||||
checkResolvedTypeDirectivesCache(program1, "/a.ts", new Map(getEntries({ typedefs: { resolvedFileName: "/types/typedefs/index.d.ts", primary: true } })));
|
||||
@@ -435,16 +435,16 @@ namespace ts {
|
||||
files[0].text = files[0].text.updateReferences("");
|
||||
});
|
||||
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program3.structureIsReused, StructureIsReused.SafeModules);
|
||||
checkResolvedTypeDirectivesCache(program3, "/a.ts", /*expectedContent*/ undefined);
|
||||
|
||||
updateProgram(program3, ["/a.ts"], options, files => {
|
||||
const program4 = updateProgram(program3, ["/a.ts"], options, files => {
|
||||
const newReferences = `/// <reference types="typedefs"/>
|
||||
/// <reference types="typedefs2"/>
|
||||
`;
|
||||
files[0].text = files[0].text.updateReferences(newReferences);
|
||||
});
|
||||
assert.equal(program3.structureIsReused, StructureIsReused.SafeModules);
|
||||
assert.equal(program4.structureIsReused, StructureIsReused.SafeModules);
|
||||
checkResolvedTypeDirectivesCache(program1, "/a.ts", new Map(getEntries({ typedefs: { resolvedFileName: "/types/typedefs/index.d.ts", primary: true } })));
|
||||
});
|
||||
|
||||
@@ -847,7 +847,7 @@ namespace ts {
|
||||
const program2 = updateRedirectProgram(program1, files => {
|
||||
updateProgramText(files, root, "const x = 1;");
|
||||
}, useGetSourceFileByPath);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Completely);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Completely);
|
||||
assert.lengthOf(program2.getSemanticDiagnostics(), 0);
|
||||
});
|
||||
|
||||
@@ -859,7 +859,7 @@ namespace ts {
|
||||
updateProgramText(files, axIndex, "export default class X { private x: number; private y: number; }");
|
||||
updateProgramText(files, axPackage, JSON.stringify('{ name: "x", version: "1.2.4" }'));
|
||||
}, useGetSourceFileByPath);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Not);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
assert.lengthOf(program2.getSemanticDiagnostics(), 1);
|
||||
});
|
||||
|
||||
@@ -870,7 +870,7 @@ namespace ts {
|
||||
updateProgramText(files, bxIndex, "export default class X { private x: number; private y: number; }");
|
||||
updateProgramText(files, bxPackage, JSON.stringify({ name: "x", version: "1.2.4" }));
|
||||
}, useGetSourceFileByPath);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Not);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
assert.lengthOf(program2.getSemanticDiagnostics(), 1);
|
||||
});
|
||||
|
||||
@@ -881,7 +881,7 @@ namespace ts {
|
||||
updateProgramText(files, bxIndex, "export default class X { private x: number; }");
|
||||
updateProgramText(files, bxPackage, JSON.stringify({ name: "x", version: "1.2.3" }));
|
||||
}, useGetSourceFileByPath);
|
||||
assert.equal(program1.structureIsReused, StructureIsReused.Not);
|
||||
assert.equal(program2.structureIsReused, StructureIsReused.Not);
|
||||
assert.deepEqual(program2.getSemanticDiagnostics(), []);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -902,7 +902,7 @@ function [#|f|](): Promise<string> {
|
||||
}
|
||||
`
|
||||
);
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen", `
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen1", `
|
||||
function [#|f|]() {
|
||||
return Promise.resolve().then(function () {
|
||||
return Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () {
|
||||
@@ -921,6 +921,26 @@ function [#|f|]() {
|
||||
})]).then(res => res.toString());
|
||||
});
|
||||
}
|
||||
`
|
||||
);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen3", `
|
||||
function [#|f|]() {
|
||||
return Promise.resolve().then(() =>
|
||||
Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () {
|
||||
return fetch("https://github.com");
|
||||
}).then(res => res.toString())]));
|
||||
}
|
||||
`
|
||||
);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_PromiseAllAndThen4", `
|
||||
function [#|f|]() {
|
||||
return Promise.resolve().then(() =>
|
||||
Promise.all([fetch("https://typescriptlang.org"), fetch("https://microsoft.com"), Promise.resolve().then(function () {
|
||||
return fetch("https://github.com");
|
||||
})]).then(res => res.toString()));
|
||||
}
|
||||
`
|
||||
);
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_Scope1", `
|
||||
@@ -1124,6 +1144,27 @@ function [#|bar|]<T>(x: T): Promise<T> {
|
||||
`
|
||||
);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_Return1", `
|
||||
function [#|f|](p: Promise<unknown>) {
|
||||
return p.catch((error: Error) => {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
}`
|
||||
);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_Return2", `
|
||||
function [#|f|](p: Promise<unknown>) {
|
||||
return p.catch((error: Error) => Promise.reject(error));
|
||||
}`
|
||||
);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_Return3", `
|
||||
function [#|f|](p: Promise<unknown>) {
|
||||
return p.catch(function (error: Error) {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
}`
|
||||
);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_LocalReturn", `
|
||||
function [#|f|]() {
|
||||
@@ -1352,7 +1393,7 @@ function [#|f|]() {
|
||||
}
|
||||
`);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_noArgs", `
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_noArgs1", `
|
||||
function delay(millis: number): Promise<void> {
|
||||
throw "no"
|
||||
}
|
||||
@@ -1364,7 +1405,21 @@ function [#|main2|]() {
|
||||
.then(() => { console.log("."); return delay(500); })
|
||||
.then(() => { console.log("."); return delay(500); })
|
||||
}
|
||||
`);
|
||||
`);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_noArgs2", `
|
||||
function delay(millis: number): Promise<void> {
|
||||
throw "no"
|
||||
}
|
||||
|
||||
function [#|main2|]() {
|
||||
console.log("Please wait. Loading.");
|
||||
return delay(500)
|
||||
.then(() => delay(500))
|
||||
.then(() => delay(500))
|
||||
.then(() => delay(500))
|
||||
}
|
||||
`);
|
||||
|
||||
_testConvertToAsyncFunction("convertToAsyncFunction_exportModifier", `
|
||||
export function [#|foo|]() {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
namespace ts.tscWatch {
|
||||
describe("unittests:: tsbuild:: moduleResolution:: handles the modules and options from referenced project correctly", () => {
|
||||
function sys(optionsToExtend?: CompilerOptions) {
|
||||
return createWatchedSystem([
|
||||
{
|
||||
path: `${projectRoot}/packages/pkg1/index.ts`,
|
||||
content: Utils.dedent`
|
||||
import type { TheNum } from 'pkg2'
|
||||
export const theNum: TheNum = 42;`
|
||||
},
|
||||
{
|
||||
path: `${projectRoot}/packages/pkg1/tsconfig.json`,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { outDir: "build", ...optionsToExtend },
|
||||
references: [{ path: "../pkg2" }]
|
||||
})
|
||||
},
|
||||
{
|
||||
path: `${projectRoot}/packages/pkg2/const.ts`,
|
||||
content: `export type TheNum = 42;`
|
||||
},
|
||||
{
|
||||
path: `${projectRoot}/packages/pkg2/index.ts`,
|
||||
content: `export type { TheNum } from 'const';`
|
||||
},
|
||||
{
|
||||
path: `${projectRoot}/packages/pkg2/tsconfig.json`,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: {
|
||||
composite: true,
|
||||
outDir: "build",
|
||||
baseUrl: ".",
|
||||
...optionsToExtend
|
||||
}
|
||||
})
|
||||
},
|
||||
{
|
||||
path: `${projectRoot}/packages/pkg2/package.json`,
|
||||
content: JSON.stringify({
|
||||
name: "pkg2",
|
||||
version: "1.0.0",
|
||||
main: "build/index.js",
|
||||
})
|
||||
},
|
||||
{
|
||||
path: `${projectRoot}/node_modules/pkg2`,
|
||||
symLink: `${projectRoot}/packages/pkg2`,
|
||||
},
|
||||
libFile
|
||||
], { currentDirectory: projectRoot });
|
||||
}
|
||||
|
||||
verifyTscWatch({
|
||||
scenario: "moduleResolution",
|
||||
subScenario: `resolves specifier in output declaration file from referenced project correctly`,
|
||||
sys,
|
||||
commandLineArgs: ["-b", "packages/pkg1", "--verbose", "--traceResolution"],
|
||||
changes: emptyArray
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario: "moduleResolution",
|
||||
subScenario: `resolves specifier in output declaration file from referenced project correctly with preserveSymlinks`,
|
||||
sys: () => sys({ preserveSymlinks: true }),
|
||||
commandLineArgs: ["-b", "packages/pkg1", "--verbose", "--traceResolution"],
|
||||
changes: emptyArray
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -43,7 +43,7 @@ namespace ts.tscWatch {
|
||||
return createWatchProgram(compilerHost);
|
||||
}
|
||||
|
||||
const elapsedRegex = /^Elapsed:: [0-9]+ms/;
|
||||
const elapsedRegex = /^Elapsed:: \d+(?:\.\d+)?ms/;
|
||||
const buildVerboseLogRegEx = /^.+ \- /;
|
||||
export enum HostOutputKind {
|
||||
Log,
|
||||
@@ -441,6 +441,7 @@ namespace ts.tscWatch {
|
||||
const options = program.getCompilerOptions();
|
||||
baseline.push(`Program root files: ${JSON.stringify(program.getRootFileNames())}`);
|
||||
baseline.push(`Program options: ${JSON.stringify(options)}`);
|
||||
baseline.push(`Program structureReused: ${(<any>ts).StructureIsReused[program.structureIsReused]}`);
|
||||
baseline.push("Program files::");
|
||||
for (const file of program.getSourceFiles()) {
|
||||
baseline.push(file.fileName);
|
||||
|
||||
@@ -276,5 +276,79 @@ export interface A {
|
||||
],
|
||||
modifyFs: host => host.deleteFile(`${project}/globals.d.ts`)
|
||||
});
|
||||
|
||||
const jsxImportSourceOptions = { module: "commonjs", jsx: "react-jsx", incremental: true, jsxImportSource: "react" };
|
||||
const jsxLibraryContent = `export namespace JSX {
|
||||
interface Element {}
|
||||
interface IntrinsicElements {
|
||||
div: {
|
||||
propA?: boolean;
|
||||
};
|
||||
}
|
||||
}
|
||||
export function jsx(...args: any[]): void;
|
||||
export function jsxs(...args: any[]): void;
|
||||
export const Fragment: unique symbol;
|
||||
`;
|
||||
|
||||
verifyIncrementalWatchEmit({
|
||||
subScenario: "jsxImportSource option changed",
|
||||
files: () => [
|
||||
{ path: libFile.path, content: libContent },
|
||||
{ path: `${project}/node_modules/react/jsx-runtime/index.d.ts`, content: jsxLibraryContent },
|
||||
{ path: `${project}/node_modules/react/package.json`, content: JSON.stringify({ name: "react", version: "0.0.1" }) },
|
||||
{ path: `${project}/node_modules/preact/jsx-runtime/index.d.ts`, content: jsxLibraryContent.replace("propA", "propB") },
|
||||
{ path: `${project}/node_modules/preact/package.json`, content: JSON.stringify({ name: "preact", version: "0.0.1" }) },
|
||||
{ path: `${project}/index.tsx`, content: `export const App = () => <div propA={true}></div>;` },
|
||||
{ path: configFile.path, content: JSON.stringify({ compilerOptions: jsxImportSourceOptions }) }
|
||||
],
|
||||
modifyFs: host => host.writeFile(configFile.path, JSON.stringify({ compilerOptions: { ...jsxImportSourceOptions, jsxImportSource: "preact" } }))
|
||||
});
|
||||
|
||||
verifyIncrementalWatchEmit({
|
||||
subScenario: "jsxImportSource backing types added",
|
||||
files: () => [
|
||||
{ path: libFile.path, content: libContent },
|
||||
{ path: `${project}/index.tsx`, content: `export const App = () => <div propA={true}></div>;` },
|
||||
{ path: configFile.path, content: JSON.stringify({ compilerOptions: jsxImportSourceOptions }) }
|
||||
],
|
||||
modifyFs: host => {
|
||||
host.createDirectory(`${project}/node_modules`);
|
||||
host.createDirectory(`${project}/node_modules/react`);
|
||||
host.createDirectory(`${project}/node_modules/react/jsx-runtime`);
|
||||
host.writeFile(`${project}/node_modules/react/jsx-runtime/index.d.ts`, jsxLibraryContent);
|
||||
host.writeFile(`${project}/node_modules/react/package.json`, JSON.stringify({ name: "react", version: "0.0.1" }));
|
||||
}
|
||||
});
|
||||
|
||||
verifyIncrementalWatchEmit({
|
||||
subScenario: "jsxImportSource backing types removed",
|
||||
files: () => [
|
||||
{ path: libFile.path, content: libContent },
|
||||
{ path: `${project}/node_modules/react/jsx-runtime/index.d.ts`, content: jsxLibraryContent },
|
||||
{ path: `${project}/node_modules/react/package.json`, content: JSON.stringify({ name: "react", version: "0.0.1" }) },
|
||||
{ path: `${project}/index.tsx`, content: `export const App = () => <div propA={true}></div>;` },
|
||||
{ path: configFile.path, content: JSON.stringify({ compilerOptions: jsxImportSourceOptions }) }
|
||||
],
|
||||
modifyFs: host => {
|
||||
host.deleteFile(`${project}/node_modules/react/jsx-runtime/index.d.ts`);
|
||||
host.deleteFile(`${project}/node_modules/react/package.json`);
|
||||
}
|
||||
});
|
||||
|
||||
verifyIncrementalWatchEmit({
|
||||
subScenario: "importHelpers backing types removed",
|
||||
files: () => [
|
||||
{ path: libFile.path, content: libContent },
|
||||
{ path: `${project}/node_modules/tslib/index.d.ts`, content: "export function __assign(...args: any[]): any;" },
|
||||
{ path: `${project}/node_modules/tslib/package.json`, content: JSON.stringify({ name: "tslib", version: "0.0.1" }) },
|
||||
{ path: `${project}/index.tsx`, content: `export const x = {...{}};` },
|
||||
{ path: configFile.path, content: JSON.stringify({ compilerOptions: { importHelpers: true } }) }
|
||||
],
|
||||
modifyFs: host => {
|
||||
host.deleteFile(`${project}/node_modules/tslib/index.d.ts`);
|
||||
host.deleteFile(`${project}/node_modules/tslib/package.json`);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1598,5 +1598,33 @@ import { x } from "../b";`),
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "updates emit on jsx option change",
|
||||
commandLineArgs: ["-w"],
|
||||
sys: () => {
|
||||
const index: File = {
|
||||
path: `${projectRoot}/index.tsx`,
|
||||
content: `declare var React: any;\nconst d = <div />;`
|
||||
};
|
||||
const configFile: File = {
|
||||
path: `${projectRoot}/tsconfig.json`,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: {
|
||||
jsx: "preserve"
|
||||
}
|
||||
})
|
||||
};
|
||||
return createWatchedSystem([index, configFile, libFile], { currentDirectory: projectRoot });
|
||||
},
|
||||
changes: [
|
||||
{
|
||||
caption: "Update 'jsx' to 'react'",
|
||||
change: sys => sys.writeFile(`${projectRoot}/tsconfig.json`, '{ "compilerOptions": { "jsx": "react" } }'),
|
||||
timeouts: runQueuedTimeoutCallbacks,
|
||||
},
|
||||
]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -121,6 +121,126 @@ namespace ts.tscWatch {
|
||||
);
|
||||
const watch = createWatchProgram(watchCompilerHost);
|
||||
checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, otherFile.path, libFile.path]);
|
||||
|
||||
const other2 = `${projectRoot}/other2.vue`;
|
||||
sys.writeFile(other2, otherFile.content);
|
||||
checkSingleTimeoutQueueLengthAndRun(sys);
|
||||
checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, otherFile.path, libFile.path, other2]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("unittests:: tsc-watch:: watchAPI:: when watchHost uses createSemanticDiagnosticsBuilderProgram", () => {
|
||||
function getWatch<T extends BuilderProgram>(config: File, optionsToExtend: CompilerOptions | undefined, sys: System, createProgram: CreateProgram<T>) {
|
||||
const watchCompilerHost = createWatchCompilerHost(config.path, optionsToExtend, sys, createProgram);
|
||||
return createWatchProgram(watchCompilerHost);
|
||||
}
|
||||
|
||||
function setup<T extends BuilderProgram>(createProgram: CreateProgram<T>, configText: string) {
|
||||
const config: File = {
|
||||
path: `${projectRoot}/tsconfig.json`,
|
||||
content: configText
|
||||
};
|
||||
const mainFile: File = {
|
||||
path: `${projectRoot}/main.ts`,
|
||||
content: "export const x = 10;"
|
||||
};
|
||||
const otherFile: File = {
|
||||
path: `${projectRoot}/other.ts`,
|
||||
content: "export const y = 10;"
|
||||
};
|
||||
const sys = createWatchedSystem([config, mainFile, otherFile, libFile]);
|
||||
const watch = getWatch(config, { noEmit: true }, sys, createProgram);
|
||||
return { sys, watch, mainFile, otherFile, config };
|
||||
}
|
||||
|
||||
function verifyOutputs(sys: System, emitSys: System) {
|
||||
for (const output of [`${projectRoot}/main.js`, `${projectRoot}/main.d.ts`, `${projectRoot}/other.js`, `${projectRoot}/other.d.ts`, `${projectRoot}/tsconfig.tsbuildinfo`]) {
|
||||
assert.strictEqual(sys.readFile(output), emitSys.readFile(output), `Output file text for ${output}`);
|
||||
}
|
||||
}
|
||||
|
||||
function verifyBuilder<T extends BuilderProgram, U extends BuilderProgram>(config: File, sys: System, emitSys: System, createProgram: CreateProgram<T>, createEmitProgram: CreateProgram<U>, optionsToExtend?: CompilerOptions) {
|
||||
const watch = getWatch(config, /*optionsToExtend*/ optionsToExtend, sys, createProgram);
|
||||
const emitWatch = getWatch(config, /*optionsToExtend*/ optionsToExtend, emitSys, createEmitProgram);
|
||||
verifyOutputs(sys, emitSys);
|
||||
watch.close();
|
||||
emitWatch.close();
|
||||
}
|
||||
|
||||
it("verifies that noEmit is handled on createSemanticDiagnosticsBuilderProgram and typechecking happens only on affected files", () => {
|
||||
const { sys, watch, mainFile, otherFile } = setup(createSemanticDiagnosticsBuilderProgram, "{}");
|
||||
checkProgramActualFiles(watch.getProgram().getProgram(), [mainFile.path, otherFile.path, libFile.path]);
|
||||
sys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
sys.runQueuedTimeoutCallbacks();
|
||||
const program = watch.getProgram().getProgram();
|
||||
assert.deepEqual(program.getCachedSemanticDiagnostics(program.getSourceFile(mainFile.path)), []);
|
||||
// Should not retrieve diagnostics for other file thats not changed
|
||||
assert.deepEqual(program.getCachedSemanticDiagnostics(program.getSourceFile(otherFile.path)), /*expected*/ undefined);
|
||||
});
|
||||
|
||||
it("noEmit with composite writes the tsbuildinfo with pending affected files correctly", () => {
|
||||
const configText = JSON.stringify({ compilerOptions: { composite: true } });
|
||||
const { sys, watch, config, mainFile } = setup(createSemanticDiagnosticsBuilderProgram, configText);
|
||||
const { sys: emitSys, watch: emitWatch } = setup(createEmitAndSemanticDiagnosticsBuilderProgram, configText);
|
||||
verifyOutputs(sys, emitSys);
|
||||
|
||||
watch.close();
|
||||
emitWatch.close();
|
||||
|
||||
// Emit on both sys should result in same output
|
||||
verifyBuilder(config, sys, emitSys, createEmitAndSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram);
|
||||
|
||||
// Change file
|
||||
sys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
emitSys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
|
||||
// Verify noEmit results in same output
|
||||
verifyBuilder(config, sys, emitSys, createSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram, { noEmit: true });
|
||||
|
||||
// Emit on both sys should result in same output
|
||||
verifyBuilder(config, sys, emitSys, createEmitAndSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram);
|
||||
|
||||
// Change file
|
||||
sys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
emitSys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
|
||||
// Emit on both the builders should result in same files
|
||||
verifyBuilder(config, sys, emitSys, createSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram);
|
||||
});
|
||||
|
||||
it("noEmitOnError with composite writes the tsbuildinfo with pending affected files correctly", () => {
|
||||
const config: File = {
|
||||
path: `${projectRoot}/tsconfig.json`,
|
||||
content: JSON.stringify({ compilerOptions: { composite: true } })
|
||||
};
|
||||
const mainFile: File = {
|
||||
path: `${projectRoot}/main.ts`,
|
||||
content: "export const x: string = 10;"
|
||||
};
|
||||
const otherFile: File = {
|
||||
path: `${projectRoot}/other.ts`,
|
||||
content: "export const y = 10;"
|
||||
};
|
||||
const sys = createWatchedSystem([config, mainFile, otherFile, libFile]);
|
||||
const emitSys = createWatchedSystem([config, mainFile, otherFile, libFile]);
|
||||
|
||||
// Verify noEmit results in same output
|
||||
verifyBuilder(config, sys, emitSys, createSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram, { noEmitOnError: true });
|
||||
|
||||
// Change file
|
||||
sys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
emitSys.appendFile(mainFile.path, "\n// SomeComment");
|
||||
|
||||
// Verify noEmit results in same output
|
||||
verifyBuilder(config, sys, emitSys, createSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram, { noEmitOnError: true });
|
||||
|
||||
// Fix error
|
||||
const fixed = "export const x = 10;";
|
||||
sys.appendFile(mainFile.path, fixed);
|
||||
emitSys.appendFile(mainFile.path, fixed);
|
||||
|
||||
// Emit on both the builders should result in same files
|
||||
verifyBuilder(config, sys, emitSys, createSemanticDiagnosticsBuilderProgram, createEmitAndSemanticDiagnosticsBuilderProgram, { noEmitOnError: true });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -283,6 +283,25 @@ namespace ts.projectSystem {
|
||||
// Project for A is created - ensure it doesn't have an autoImportProvider
|
||||
assert.isUndefined(projectService.configuredProjects.get("/packages/a/tsconfig.json")!.getLanguageService().getAutoImportProvider());
|
||||
});
|
||||
|
||||
it("Does not close when root files are redirects that don't actually exist", () => {
|
||||
const files = [
|
||||
// packages/a
|
||||
{ path: "/packages/a/package.json", content: `{ "dependencies": { "b": "*" } }` },
|
||||
{ path: "/packages/a/tsconfig.json", content: `{ "compilerOptions": { "composite": true }, "references": [{ "path": "./node_modules/b" }] }` },
|
||||
{ path: "/packages/a/index.ts", content: "" },
|
||||
|
||||
// packages/b
|
||||
{ path: "/packages/a/node_modules/b/package.json", content: `{ "types": "dist/index.d.ts" }` },
|
||||
{ path: "/packages/a/node_modules/b/tsconfig.json", content: `{ "compilerOptions": { "composite": true, "outDir": "dist" } }` },
|
||||
{ path: "/packages/a/node_modules/b/index.ts", content: `export class B {}` }
|
||||
];
|
||||
|
||||
const { projectService, session } = setup(files);
|
||||
openFilesForSession([files[2]], session);
|
||||
assert.isDefined(projectService.configuredProjects.get("/packages/a/tsconfig.json")!.getPackageJsonAutoImportProvider());
|
||||
assert.isDefined(projectService.configuredProjects.get("/packages/a/tsconfig.json")!.getPackageJsonAutoImportProvider());
|
||||
});
|
||||
});
|
||||
|
||||
function setup(files: File[]) {
|
||||
|
||||
@@ -429,5 +429,26 @@ namespace ts.projectSystem {
|
||||
configuredRemoved.clear();
|
||||
}
|
||||
});
|
||||
|
||||
it("regression test - should infer typeAcquisition for inferred projects when set undefined", () => {
|
||||
const file1 = { path: "/a/file1.js", content: "" };
|
||||
const host = createServerHost([file1]);
|
||||
|
||||
const projectService = createProjectService(host);
|
||||
|
||||
projectService.openClientFile(file1.path);
|
||||
|
||||
checkNumberOfProjects(projectService, { inferredProjects: 1 });
|
||||
const inferredProject = projectService.inferredProjects[0];
|
||||
checkProjectActualFiles(inferredProject, [file1.path]);
|
||||
inferredProject.setTypeAcquisition(undefined);
|
||||
|
||||
const expected = {
|
||||
enable: true,
|
||||
include: [],
|
||||
exclude: []
|
||||
};
|
||||
assert.deepEqual(inferredProject.getTypeAcquisition(), expected, "typeAcquisition should be inferred for inferred projects");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -172,5 +172,36 @@ function fooB() { }`
|
||||
openFilesForSession([file2], session);
|
||||
checkProjectActualFiles(project, [libFile.path, file2.path, file3.path]);
|
||||
});
|
||||
|
||||
it("should not create autoImportProvider or handle package jsons", () => {
|
||||
const angularFormsDts: File = {
|
||||
path: "/node_modules/@angular/forms/forms.d.ts",
|
||||
content: "export declare class PatternValidator {}",
|
||||
};
|
||||
const angularFormsPackageJson: File = {
|
||||
path: "/node_modules/@angular/forms/package.json",
|
||||
content: `{ "name": "@angular/forms", "typings": "./forms.d.ts" }`,
|
||||
};
|
||||
const tsconfig: File = {
|
||||
path: "/tsconfig.json",
|
||||
content: `{ "compilerOptions": { "module": "commonjs" } }`,
|
||||
};
|
||||
const packageJson: File = {
|
||||
path: "/package.json",
|
||||
content: `{ "dependencies": { "@angular/forms": "*", "@angular/core": "*" } }`
|
||||
};
|
||||
const indexTs: File = {
|
||||
path: "/index.ts",
|
||||
content: ""
|
||||
};
|
||||
const host = createServerHost([angularFormsDts, angularFormsPackageJson, tsconfig, packageJson, indexTs, libFile]);
|
||||
const session = createSession(host, { serverMode: LanguageServiceMode.PartialSemantic, useSingleInferredProject: true });
|
||||
const service = session.getProjectService();
|
||||
openFilesForSession([indexTs], session);
|
||||
const project = service.inferredProjects[0];
|
||||
assert.isFalse(project.autoImportProviderHost);
|
||||
assert.isUndefined(project.getPackageJsonAutoImportProvider());
|
||||
assert.deepEqual(project.getPackageJsonsForAutoImport(), emptyArray);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2189,19 +2189,14 @@ export function bar() {}`
|
||||
verifySolutionScenario({
|
||||
configRefs: ["./tsconfig-indirect1.json", "./tsconfig-indirect2.json"],
|
||||
additionalFiles: [tsconfigIndirect, indirect, tsconfigIndirect2, indirect2],
|
||||
additionalProjects: [{
|
||||
projectName: tsconfigIndirect.path,
|
||||
files: [tsconfigIndirect.path, main.path, helper.path, indirect.path, libFile.path]
|
||||
}],
|
||||
additionalProjects: emptyArray,
|
||||
expectedOpenEvents: [
|
||||
...expectedSolutionLoadAndTelemetry(),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigIndirect.path),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigSrcPath),
|
||||
configFileDiagEvent(main.path, tsconfigSrcPath, [])
|
||||
],
|
||||
expectedReloadEvents: [
|
||||
...expectedReloadEvent(tsconfigPath),
|
||||
...expectedReloadEvent(tsconfigIndirect.path),
|
||||
...expectedReloadEvent(tsconfigSrcPath),
|
||||
],
|
||||
expectedReferences: {
|
||||
@@ -2217,8 +2212,8 @@ export function bar() {}`
|
||||
refs: [
|
||||
...expectedIndirectRefs(fileResolvingToMainDts),
|
||||
...refs,
|
||||
...expectedIndirectRefs(indirect2),
|
||||
...expectedIndirectRefs(indirect),
|
||||
...expectedIndirectRefs(indirect2),
|
||||
],
|
||||
symbolDisplayString: "(alias) const foo: 1\nimport foo",
|
||||
}
|
||||
@@ -2296,8 +2291,6 @@ export function bar() {}`
|
||||
const expectedProjectsOnOpen: VerifyProjects = {
|
||||
configuredProjects: [
|
||||
{ projectName: tsconfigPath, files: [tsconfigPath] },
|
||||
{ projectName: tsconfigIndirect.path, files: [tsconfigIndirect.path, main.path, helper.path, indirect.path, libFile.path] },
|
||||
{ projectName: tsconfigIndirect2.path, files: [tsconfigIndirect2.path, main.path, helper.path, indirect2.path, libFile.path] },
|
||||
{ projectName: tsconfigSrcPath, files: [tsconfigSrcPath, main.path, helper.path, libFile.path] },
|
||||
],
|
||||
inferredProjects: emptyArray
|
||||
@@ -2307,8 +2300,6 @@ export function bar() {}`
|
||||
additionalFiles: [tsconfigIndirect, indirect, tsconfigIndirect2, indirect2],
|
||||
expectedOpenEvents: [
|
||||
...expectedSolutionLoadAndTelemetry(),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigIndirect.path),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigIndirect2.path),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigSrcPath),
|
||||
configFileDiagEvent(main.path, tsconfigSrcPath, [])
|
||||
],
|
||||
@@ -2317,9 +2308,7 @@ export function bar() {}`
|
||||
expectedProjectsOnOpen,
|
||||
expectedReloadEvents: [
|
||||
...expectedReloadEvent(tsconfigPath),
|
||||
...expectedReloadEvent(tsconfigIndirect.path),
|
||||
...expectedReloadEvent(tsconfigSrcPath),
|
||||
...expectedReloadEvent(tsconfigIndirect2.path),
|
||||
]
|
||||
});
|
||||
});
|
||||
@@ -2387,19 +2376,14 @@ bar;`
|
||||
solutionProject: [tsconfigPath, indirect.path, ownMain.path, main.path, libFile.path, helper.path],
|
||||
configRefs: ["./tsconfig-indirect1.json", "./tsconfig-indirect2.json"],
|
||||
additionalFiles: [tsconfigIndirect, indirect, tsconfigIndirect2, indirect2, ownMain],
|
||||
additionalProjects: [{
|
||||
projectName: tsconfigIndirect.path,
|
||||
files: [tsconfigIndirect.path, main.path, helper.path, indirect.path, libFile.path]
|
||||
}],
|
||||
additionalProjects: emptyArray,
|
||||
expectedOpenEvents: [
|
||||
...expectedSolutionLoadAndTelemetry(),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigIndirect.path),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigSrcPath),
|
||||
configFileDiagEvent(main.path, tsconfigSrcPath, [])
|
||||
],
|
||||
expectedReloadEvents: [
|
||||
...expectedReloadEvent(tsconfigPath),
|
||||
...expectedReloadEvent(tsconfigIndirect.path),
|
||||
...expectedReloadEvent(tsconfigSrcPath),
|
||||
],
|
||||
expectedReferences: {
|
||||
@@ -2415,8 +2399,8 @@ bar;`
|
||||
refs: [
|
||||
...expectedIndirectRefs(fileResolvingToMainDts),
|
||||
...refs,
|
||||
...expectedIndirectRefs(indirect2),
|
||||
...expectedIndirectRefs(indirect),
|
||||
...expectedIndirectRefs(indirect2),
|
||||
],
|
||||
symbolDisplayString: "(alias) const foo: 1\nimport foo",
|
||||
}
|
||||
@@ -2502,8 +2486,6 @@ bar;`
|
||||
const expectedProjectsOnOpen: VerifyProjects = {
|
||||
configuredProjects: [
|
||||
{ projectName: tsconfigPath, files: [tsconfigPath, indirect.path, ownMain.path, main.path, libFile.path, helper.path] },
|
||||
{ projectName: tsconfigIndirect.path, files: [tsconfigIndirect.path, main.path, helper.path, indirect.path, libFile.path] },
|
||||
{ projectName: tsconfigIndirect2.path, files: [tsconfigIndirect2.path, main.path, helper.path, indirect2.path, libFile.path] },
|
||||
{ projectName: tsconfigSrcPath, files: [tsconfigSrcPath, main.path, helper.path, libFile.path] },
|
||||
],
|
||||
inferredProjects: emptyArray
|
||||
@@ -2518,8 +2500,6 @@ bar;`
|
||||
additionalFiles: [tsconfigIndirect, indirect, tsconfigIndirect2, indirect2, ownMain],
|
||||
expectedOpenEvents: [
|
||||
...expectedSolutionLoadAndTelemetry(),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigIndirect.path),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigIndirect2.path),
|
||||
...expectedProjectReferenceLoadAndTelemetry(tsconfigSrcPath),
|
||||
configFileDiagEvent(main.path, tsconfigSrcPath, [])
|
||||
],
|
||||
@@ -2528,9 +2508,7 @@ bar;`
|
||||
expectedProjectsOnOpen,
|
||||
expectedReloadEvents: [
|
||||
...expectedReloadEvent(tsconfigPath),
|
||||
...expectedReloadEvent(tsconfigIndirect.path),
|
||||
...expectedReloadEvent(tsconfigSrcPath),
|
||||
...expectedReloadEvent(tsconfigIndirect2.path),
|
||||
]
|
||||
});
|
||||
});
|
||||
@@ -2645,5 +2623,75 @@ bar;`
|
||||
verifyAutoImport(/*built*/ true, /*disableSourceOfProjectReferenceRedirect*/ true);
|
||||
});
|
||||
});
|
||||
|
||||
it("when files from two projects are open and one project references", () => {
|
||||
function getPackageAndFile(packageName: string, references?: string[], optionsToExtend?: CompilerOptions): [file: File, config: File] {
|
||||
const file: File = {
|
||||
path: `${tscWatch.projectRoot}/${packageName}/src/file1.ts`,
|
||||
content: `export const ${packageName}Const = 10;`
|
||||
};
|
||||
const config: File = {
|
||||
path: `${tscWatch.projectRoot}/${packageName}/tsconfig.json`,
|
||||
content: JSON.stringify({
|
||||
compilerOptions: { composite: true, ...optionsToExtend || {} },
|
||||
references: references?.map(path => ({ path: `../${path}` }))
|
||||
})
|
||||
};
|
||||
return [file, config];
|
||||
}
|
||||
const [mainFile, mainConfig] = getPackageAndFile("main", ["core", "indirect", "noCoreRef1", "indirectDisabledChildLoad1", "indirectDisabledChildLoad2", "refToCoreRef3", "indirectNoCoreRef"]);
|
||||
const [coreFile, coreConfig] = getPackageAndFile("core");
|
||||
const [noCoreRef1File, noCoreRef1Config] = getPackageAndFile("noCoreRef1");
|
||||
const [indirectFile, indirectConfig] = getPackageAndFile("indirect", ["coreRef1"]);
|
||||
const [coreRef1File, coreRef1Config] = getPackageAndFile("coreRef1", ["core"]);
|
||||
const [indirectDisabledChildLoad1File, indirectDisabledChildLoad1Config] = getPackageAndFile("indirectDisabledChildLoad1", ["coreRef2"], { disableReferencedProjectLoad: true });
|
||||
const [coreRef2File, coreRef2Config] = getPackageAndFile("coreRef2", ["core"]);
|
||||
const [indirectDisabledChildLoad2File, indirectDisabledChildLoad2Config] = getPackageAndFile("indirectDisabledChildLoad2", ["coreRef3"], { disableReferencedProjectLoad: true });
|
||||
const [coreRef3File, coreRef3Config] = getPackageAndFile("coreRef3", ["core"]);
|
||||
const [refToCoreRef3File, refToCoreRef3Config] = getPackageAndFile("refToCoreRef3", ["coreRef3"]);
|
||||
const [indirectNoCoreRefFile, indirectNoCoreRefConfig] = getPackageAndFile("indirectNoCoreRef", ["noCoreRef2"]);
|
||||
const [noCoreRef2File, noCoreRef2Config] = getPackageAndFile("noCoreRef2");
|
||||
|
||||
const host = createServerHost([
|
||||
libFile, mainFile, mainConfig, coreFile, coreConfig, noCoreRef1File, noCoreRef1Config,
|
||||
indirectFile, indirectConfig, coreRef1File, coreRef1Config,
|
||||
indirectDisabledChildLoad1File, indirectDisabledChildLoad1Config, coreRef2File, coreRef2Config,
|
||||
indirectDisabledChildLoad2File, indirectDisabledChildLoad2Config, coreRef3File, coreRef3Config,
|
||||
refToCoreRef3File, refToCoreRef3Config,
|
||||
indirectNoCoreRefFile, indirectNoCoreRefConfig, noCoreRef2File, noCoreRef2Config
|
||||
], { useCaseSensitiveFileNames: true });
|
||||
const session = createSession(host);
|
||||
const service = session.getProjectService();
|
||||
openFilesForSession([mainFile, coreFile], session);
|
||||
|
||||
verifyProject(mainConfig);
|
||||
verifyProject(coreConfig);
|
||||
|
||||
// Find all refs in coreFile
|
||||
session.executeCommandSeq<protocol.ReferencesRequest>({
|
||||
command: protocol.CommandTypes.References,
|
||||
arguments: protocolFileLocationFromSubstring(coreFile, `coreConst`)
|
||||
});
|
||||
verifyProject(mainConfig);
|
||||
verifyProject(coreConfig);
|
||||
verifyNoProject(noCoreRef1Config); // Should not be loaded
|
||||
verifyProject(indirectConfig);
|
||||
verifyProject(coreRef1Config);
|
||||
verifyProject(indirectDisabledChildLoad1Config);
|
||||
verifyNoProject(coreRef2Config); // Should not be loaded
|
||||
verifyProject(indirectDisabledChildLoad2Config);
|
||||
verifyProject(coreRef3Config);
|
||||
verifyProject(refToCoreRef3Config);
|
||||
verifyNoProject(indirectNoCoreRefConfig); // Should not be loaded
|
||||
verifyNoProject(noCoreRef2Config); // Should not be loaded
|
||||
|
||||
function verifyProject(config: File) {
|
||||
assert.isDefined(service.configuredProjects.get(config.path), `Expected to find ${config.path}`);
|
||||
}
|
||||
|
||||
function verifyNoProject(config: File) {
|
||||
assert.isUndefined(service.configuredProjects.get(config.path), `Expected to not find ${config.path}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1481,6 +1481,48 @@ namespace ts.projectSystem {
|
||||
]);
|
||||
});
|
||||
|
||||
it("synchronizeProjectList returns correct information when base configuration file cannot be resolved", () => {
|
||||
const file: File = {
|
||||
path: `${tscWatch.projectRoot}/index.ts`,
|
||||
content: "export const foo = 5;"
|
||||
};
|
||||
const config: File = {
|
||||
path: `${tscWatch.projectRoot}/tsconfig.json`,
|
||||
content: JSON.stringify({ extends: "./tsconfig_base.json" })
|
||||
};
|
||||
const host = createServerHost([file, config, libFile]);
|
||||
const projectService = createProjectService(host);
|
||||
projectService.openClientFile(file.path);
|
||||
const knownProjects = projectService.synchronizeProjectList([], /*includeProjectReferenceRedirectInfo*/ false);
|
||||
assert.deepEqual(knownProjects[0].files, [
|
||||
libFile.path,
|
||||
file.path,
|
||||
config.path,
|
||||
`${tscWatch.projectRoot}/tsconfig_base.json`,
|
||||
]);
|
||||
});
|
||||
|
||||
it("synchronizeProjectList returns correct information when base configuration file cannot be resolved and redirect info is requested", () => {
|
||||
const file: File = {
|
||||
path: `${tscWatch.projectRoot}/index.ts`,
|
||||
content: "export const foo = 5;"
|
||||
};
|
||||
const config: File = {
|
||||
path: `${tscWatch.projectRoot}/tsconfig.json`,
|
||||
content: JSON.stringify({ extends: "./tsconfig_base.json" })
|
||||
};
|
||||
const host = createServerHost([file, config, libFile]);
|
||||
const projectService = createProjectService(host);
|
||||
projectService.openClientFile(file.path);
|
||||
const knownProjects = projectService.synchronizeProjectList([], /*includeProjectReferenceRedirectInfo*/ true);
|
||||
assert.deepEqual(knownProjects[0].files, [
|
||||
{ fileName: libFile.path, isSourceOfProjectReferenceRedirect: false },
|
||||
{ fileName: file.path, isSourceOfProjectReferenceRedirect: false },
|
||||
{ fileName: config.path, isSourceOfProjectReferenceRedirect: false },
|
||||
{ fileName: `${tscWatch.projectRoot}/tsconfig_base.json`, isSourceOfProjectReferenceRedirect: false },
|
||||
]);
|
||||
});
|
||||
|
||||
it("handles delayed directory watch invoke on file creation", () => {
|
||||
const projectRootPath = "/users/username/projects/project";
|
||||
const fileB: File = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user