mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Port master into release-2.6 10/19 (#19348)
* Adding test case where opened file included in project is not added to ref count of configured project * Fix the way configured project's reference is managed so that the open file * Do not watch root folders for failed lookup locations and effective type roots Fixes #19170 * LEGO: check in for master to temporary branch. * LEGO: check in for master to temporary branch. * Mark fresh spread objects w/ContainsObjectLiteral * Test excess property checks of spreads of unions. * Add exported members of all project files in the global completion list (#19069) * checker.ts: Remove null check on symbols * tsserverProjectSystem.ts: add two tests * client.ts, completions.ts, types.ts: Add codeActions member to CompletionEntryDetails * protocol.ts, session.ts: Add codeActions member to CompletionEntryDetails protocol * protocol.ts, session.ts, types.ts: add hasAction to CompletionEntry * session.ts, services.ts, types.ts: Add formattingOptions parameter to getCompletionEntryDetails * completions.ts: define SymbolOriginInfo type * completions.ts, services.ts: Add allSourceFiles parameter to getCompletionsAtPosition * completions.ts, services.ts: Plumb allSourceFiles into new function getSymbolsFromOtherSourceFileExports inside getCompletionData * completions.ts: add symbolToOriginInfoMap parameter to getCompletionEntriesFromSymbols and to return value of getCompletionData * utilities.ts: Add getOtherModuleSymbols, getUniqueSymbolIdAsString, getUniqueSymbolId * completions.ts: Set CompletionEntry.hasAction when symbol is found in symbolToOriginInfoMap (meaning there's an import action) * completions.ts: Populate list with possible exports (implement getSymbolsFromOtherSourceFileExports) * completions.ts, services.ts: Plumb host and rulesProvider into getCompletionEntryDetails * completions.ts: Add TODO comment * importFixes.ts: Add types ImportDeclarationMap and ImportCodeFixContext * Move getImportDeclarations into getCodeActionForImport, immediately after the implementation * importFixes.ts: Move createChangeTracker into getCodeActionForImport, immediately after getImportDeclarations * importFixes.ts: Add convertToImportCodeFixContext function and reference it from the getCodeActions lambda * importFixes.ts: Add context: ImportCodeFixContext parameter to getCodeActionForImport, update call sites, destructure it, use compilerOptions in getModuleSpecifierForNewImport * importFixes.ts: Remove moduleSymbol parameter from getImportDeclarations and use the ambient one * importFixes.ts: Use cachedImportDeclarations from context in getCodeActionForImport * importFixes.ts: Move createCodeAction out, immediately above convertToImportCodeFixContext * Move the declaration for lastImportDeclaration out of the getCodeActions lambda into getCodeActionForImport * importFixes.ts: Use symbolToken in getCodeActionForImport * importFixes.ts: Remove useCaseSensitiveFileNames altogether from getCodeActions lambda * importFixes.ts: Remove local getUniqueSymbolId function and add checker parameter to calls to it * importFixes.ts: Move getCodeActionForImport out into an export, immediately below convertToImportCodeFixContext * completions.ts: In getCompletionEntryDetails, if there's symbolOriginInfo, call getCodeActionForImport * importFixes.ts: Create and use importFixContext within getCodeActions lambda * importFixes.ts: Use local newLineCharacter instead of context.newLineCharacter in getCodeActionForImport * importFixes.ts: Use local host instead of context.host in getCodeActionForImport * importFixes.ts: Remove dummy getCanonicalFileName line * Filter symbols after gathering exports instead of before * Lint * Test, fix bugs, refactor * Suggestions from code review * Update api baseline * Fix bug if previousToken is not an Identifier * Replace `startsWith` with `stringContainsCharactersInOrder` * Dont try to run unit tests with rwc tests again (#19240) * In tsserver, indent logged JSON (#19080) * noUnusedLocals: Warn for recursive call to private method (#18920) * Added test for windows style paths watched directories * Handle when directory watcher is invoked on file change Fixes #19206 * Add quickfix and refactoring to install @types packages (#19130) * Add quickfix and refactoring to install @types packages * Move `validatePackageName` to `jsTyping.ts` * Remove combinePaths overloads * Respond to code review * Update api baselines * Use native PromiseConstructor * Return false instead of undefined * Remove getProjectRootPath * Update api * This wasnt required before... (#19262) * Collapse jsdoc annotation refactors to one Previously there were two, and two always fired. * Update baselines * Fix #19257: Ensure a generated signature has a return type (#19264) * Fix #19257: Ensure a generated signature has a return type * Ensure generated properties have types * Use the same context for multiple inferences to the same property access * Respect newLine compiler option in language service output (#19279) * LEGO: check in for master to temporary branch. * LEGO: check in for master to temporary branch. * LEGO: check in for master to temporary branch. * Disambiguate same-named refactors using description (#19267) Disambiguate same-named refactors using actionName * Set the scriptKind from the host configuration if present * Update API baselines * Remove erroneous error for JSDoc object literals appears with checkJS. * Update annotateWithTypeFromJSDoc tests 1. Object literals are single-line now. 2. Index signatures transform to TS index signatures. 3. The refactoring is only available when it could add types. * Add a better test for jsdoc index signatures. The test case shows that the errorenous error no longer appears. * Fix bugs in jsdoc annotation refactor 1. Transform index signatures to TS index signatures. 2. Print object literals on a single line. 3. Only offer the refactor when it could add types. (There must not be a type annotation already, and there must be a JSDoc that applies.) * Move isJSDocIndexSignature to utilities * Add failing testcase where when d.ts file is in program, the files get emitted multiple times with --out setting * Modify api to emit affected files using callback instead of generating in memory output Also marking few apis introduced during watch improvements changes that are suppose to be internal for now * Use get files affected by internally and hence use file paths as input * Simplify emit changed files further Also use source file version as the signature of declaration file instead of computing it from text * Do not cache the semantic diagnostics when compiler options has --out since we would anyways get all fresh diagnostics * make getCurrentDirectory required (#19303) * LEGO: check in for master to temporary branch. * Actually use cached semantic diagnostics * Fix tsc-instrumented 1. Make recursiveCreateDirectory correctly handle relative paths. 2. Remove dependency on Harness 3. Correctly increment iocapture0, iocapture1, ... iocaptureN. 4. Stop double-nesting baseline files. * Fix lint * Fix https://github.com/Microsoft/TypeScript/issues/19270: ensure output name is a valid locale name (#19308) * Fix https://github.com/Microsoft/TypeScript/issues/19270: ensure output name is a valid locale name * Use const instead of var * Add comment * Fix typo * Split the concat logic for generatedLCGFile * findAllRefs: Support anonymous default export (#19302) * Fix undefined error using `getEffectiveTypeRoots` (#19300) * Remove extra blank line in logs (#19307) * Use Promise instead of PromiseLike (#19305) * Workaround for nonnull operator on indexed accesses (#19275) * Quick and dirty workaround * Add third case to show current behavior * Rename variable, replace elaboration from comment with links * Remove some unnecessary `undefined` checks in extractSymbol (#19256) * Fix "noStringLiteral" lint errors (#19310) * LEGO: check in for master to temporary branch. * Rename locale outputs * Update LKG
This commit is contained in:
+38
-23
@@ -87,7 +87,7 @@ function possiblyQuote(cmd: string) {
|
||||
}
|
||||
|
||||
let useDebugMode = true;
|
||||
let host = cmdLineOptions["host"];
|
||||
let host = cmdLineOptions.host;
|
||||
|
||||
// Constants
|
||||
const compilerDirectory = "src/compiler/";
|
||||
@@ -180,6 +180,23 @@ const libraryTargets = librarySourceMap.map(function(f) {
|
||||
return path.join(builtLocalDirectory, f.target);
|
||||
});
|
||||
|
||||
/**
|
||||
* .lcg file is what localization team uses to know what messages to localize.
|
||||
* The file is always generated in 'enu\diagnosticMessages.generated.json.lcg'
|
||||
*/
|
||||
const generatedLCGFile = path.join(builtLocalDirectory, "enu", "diagnosticMessages.generated.json.lcg");
|
||||
|
||||
/**
|
||||
* The localization target produces the two following transformations:
|
||||
* 1. 'src\loc\lcl\<locale>\diagnosticMessages.generated.json.lcl' => 'built\local\<locale>\diagnosticMessages.generated.json'
|
||||
* convert localized resources into a .json file the compiler can understand
|
||||
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
|
||||
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
|
||||
*/
|
||||
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"].map(function (f) {
|
||||
return path.join(builtLocalDirectory, f, "diagnosticMessages.generated.json");
|
||||
}).concat(generatedLCGFile);
|
||||
|
||||
for (const i in libraryTargets) {
|
||||
const entry = librarySourceMap[i];
|
||||
const target = libraryTargets[i];
|
||||
@@ -398,7 +415,6 @@ gulp.task(generateLocalizedDiagnosticMessagesJs, /*help*/ false, [], () => {
|
||||
});
|
||||
|
||||
// Localize diagnostics
|
||||
const generatedLCGFile = path.join(builtLocalDirectory, "enu", "diagnosticMessages.generated.json.lcg");
|
||||
gulp.task(generatedLCGFile, [generateLocalizedDiagnosticMessagesJs, diagnosticInfoMapTs], (done) => {
|
||||
if (fs.existsSync(builtLocalDirectory) && needsUpdate(generatedDiagnosticMessagesJSON, generatedLCGFile)) {
|
||||
exec(host, [generateLocalizedDiagnosticMessagesJs, lclDirectory, builtLocalDirectory, generatedDiagnosticMessagesJSON], done, done);
|
||||
@@ -576,8 +592,7 @@ gulp.task("dontUseDebugMode", /*help*/ false, [], (done) => { useDebugMode = fal
|
||||
gulp.task("VerifyLKG", /*help*/ false, [], () => {
|
||||
const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, typingsInstallerJs, cancellationTokenJs].concat(libraryTargets);
|
||||
const missingFiles = expectedFiles.
|
||||
concat(fs.readdirSync(lclDirectory).map(function (d) { return path.join(builtLocalDirectory, d, "diagnosticMessages.generated.json"); })).
|
||||
concat(generatedLCGFile).
|
||||
concat(localizationTargets).
|
||||
filter(f => !fs.existsSync(f));
|
||||
if (missingFiles.length > 0) {
|
||||
throw new Error("Cannot replace the LKG unless all built targets are present in directory " + builtLocalDirectory +
|
||||
@@ -636,15 +651,15 @@ function restoreSavedNodeEnv() {
|
||||
}
|
||||
|
||||
function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void) {
|
||||
const lintFlag = cmdLineOptions["lint"];
|
||||
const lintFlag = cmdLineOptions.lint;
|
||||
cleanTestDirs((err) => {
|
||||
if (err) { console.error(err); failWithStatus(err, 1); }
|
||||
let testTimeout = cmdLineOptions["timeout"];
|
||||
const debug = cmdLineOptions["debug"];
|
||||
const inspect = cmdLineOptions["inspect"];
|
||||
const tests = cmdLineOptions["tests"];
|
||||
const light = cmdLineOptions["light"];
|
||||
const stackTraceLimit = cmdLineOptions["stackTraceLimit"];
|
||||
let testTimeout = cmdLineOptions.timeout;
|
||||
const debug = cmdLineOptions.debug;
|
||||
const inspect = cmdLineOptions.inspect;
|
||||
const tests = cmdLineOptions.tests;
|
||||
const light = cmdLineOptions.light;
|
||||
const stackTraceLimit = cmdLineOptions.stackTraceLimit;
|
||||
const testConfigFile = "test.config";
|
||||
if (fs.existsSync(testConfigFile)) {
|
||||
fs.unlinkSync(testConfigFile);
|
||||
@@ -660,7 +675,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
|
||||
} while (fs.existsSync(taskConfigsFolder));
|
||||
fs.mkdirSync(taskConfigsFolder);
|
||||
|
||||
workerCount = cmdLineOptions["workers"];
|
||||
workerCount = cmdLineOptions.workers;
|
||||
}
|
||||
|
||||
if (tests || light || taskConfigsFolder) {
|
||||
@@ -671,8 +686,8 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
|
||||
testTimeout = 400000;
|
||||
}
|
||||
|
||||
const colors = cmdLineOptions["colors"];
|
||||
const reporter = cmdLineOptions["reporter"] || defaultReporter;
|
||||
const colors = cmdLineOptions.colors;
|
||||
const reporter = cmdLineOptions.reporter || defaultReporter;
|
||||
|
||||
// timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally
|
||||
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
|
||||
@@ -860,7 +875,7 @@ function cleanTestDirs(done: (e?: any) => void) {
|
||||
|
||||
// used to pass data from jake command line directly to run.js
|
||||
function writeTestConfigFile(tests: string, light: boolean, taskConfigsFolder?: string, workerCount?: number, stackTraceLimit?: string) {
|
||||
const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light, workerCount, stackTraceLimit, taskConfigsFolder, noColor: !cmdLineOptions["colors"] });
|
||||
const testConfigContents = JSON.stringify({ test: tests ? [tests] : undefined, light, workerCount, stackTraceLimit, taskConfigsFolder, noColor: !cmdLineOptions.colors });
|
||||
console.log("Running tests with config: " + testConfigContents);
|
||||
fs.writeFileSync("test.config", testConfigContents);
|
||||
}
|
||||
@@ -870,8 +885,8 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
|
||||
cleanTestDirs((err) => {
|
||||
if (err) { console.error(err); done(err); process.exit(1); }
|
||||
host = "node";
|
||||
const tests = cmdLineOptions["tests"];
|
||||
const light = cmdLineOptions["light"];
|
||||
const tests = cmdLineOptions.tests;
|
||||
const light = cmdLineOptions.light;
|
||||
const testConfigFile = "test.config";
|
||||
if (fs.existsSync(testConfigFile)) {
|
||||
fs.unlinkSync(testConfigFile);
|
||||
@@ -881,8 +896,8 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
|
||||
}
|
||||
|
||||
const args = [nodeServerOutFile];
|
||||
if (cmdLineOptions["browser"]) {
|
||||
args.push(cmdLineOptions["browser"]);
|
||||
if (cmdLineOptions.browser) {
|
||||
args.push(cmdLineOptions.browser);
|
||||
}
|
||||
if (tests) {
|
||||
args.push(JSON.stringify(tests));
|
||||
@@ -892,13 +907,13 @@ gulp.task("runtests-browser", "Runs the tests using the built run.js file like '
|
||||
});
|
||||
|
||||
gulp.task("generate-code-coverage", "Generates code coverage data via istanbul", ["tests"], (done) => {
|
||||
const testTimeout = cmdLineOptions["timeout"];
|
||||
const testTimeout = cmdLineOptions.timeout;
|
||||
exec("istanbul", ["cover", "node_modules/mocha/bin/_mocha", "--", "-R", "min", "-t", testTimeout.toString(), run], done, done);
|
||||
});
|
||||
|
||||
|
||||
function getDiffTool() {
|
||||
const program = process.env["DIFF"];
|
||||
const program = process.env.DIFF;
|
||||
if (!program) {
|
||||
console.error("Add the 'DIFF' environment variable to the path of the program you want to use.");
|
||||
process.exit(1);
|
||||
@@ -1019,7 +1034,7 @@ gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
|
||||
});
|
||||
|
||||
gulp.task("tsc-instrumented", "Builds an instrumented tsc.js - run with --test=[testname]", ["local", loggedIOJsPath, instrumenterJsPath, servicesFile], (done) => {
|
||||
const test = cmdLineOptions["tests"] || "iocapture";
|
||||
const test = cmdLineOptions.tests || "iocapture";
|
||||
exec(host, [instrumenterJsPath, "record", test, builtLocalCompiler], done, done);
|
||||
});
|
||||
|
||||
@@ -1088,7 +1103,7 @@ function spawnLintWorker(files: {path: string}[], callback: (failures: number) =
|
||||
|
||||
gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => {
|
||||
if (fold.isTravis()) console.log(fold.start("lint"));
|
||||
const fileMatcher = cmdLineOptions["files"];
|
||||
const fileMatcher = cmdLineOptions.files;
|
||||
const files = fileMatcher
|
||||
? `src/**/${fileMatcher}`
|
||||
: "Gulpfile.ts 'scripts/generateLocalizedDiagnosticMessages.ts' 'scripts/tslint/**/*.ts' 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
|
||||
|
||||
+19
-3
@@ -154,6 +154,7 @@ var harnessSources = harnessCoreSources.concat([
|
||||
"symbolWalker.ts",
|
||||
"languageService.ts",
|
||||
"publicApi.ts",
|
||||
"hostNewLineSupport.ts",
|
||||
].map(function (f) {
|
||||
return path.join(unittestsDirectory, f);
|
||||
})).concat([
|
||||
@@ -238,6 +239,23 @@ var libraryTargets = librarySourceMap.map(function (f) {
|
||||
return path.join(builtLocalDirectory, f.target);
|
||||
});
|
||||
|
||||
/**
|
||||
* .lcg file is what localization team uses to know what messages to localize.
|
||||
* The file is always generated in 'enu\diagnosticMessages.generated.json.lcg'
|
||||
*/
|
||||
var generatedLCGFile = path.join(builtLocalDirectory, "enu", "diagnosticMessages.generated.json.lcg");
|
||||
|
||||
/**
|
||||
* The localization target produces the two following transformations:
|
||||
* 1. 'src\loc\lcl\<locale>\diagnosticMessages.generated.json.lcl' => 'built\local\<locale>\diagnosticMessages.generated.json'
|
||||
* convert localized resources into a .json file the compiler can understand
|
||||
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
|
||||
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
|
||||
*/
|
||||
var localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"].map(function (f) {
|
||||
return path.join(builtLocalDirectory, f);
|
||||
}).concat(path.dirname(generatedLCGFile));
|
||||
|
||||
// Prepends the contents of prefixFile to destinationFile
|
||||
function prependFile(prefixFile, destinationFile) {
|
||||
if (!fs.existsSync(prefixFile)) {
|
||||
@@ -443,7 +461,6 @@ compileFile(generateLocalizedDiagnosticMessagesJs,
|
||||
/*useBuiltCompiler*/ false, { noOutFile: true, types: ["node", "xml2js"] });
|
||||
|
||||
// Localize diagnostics
|
||||
var generatedLCGFile = path.join(builtLocalDirectory, "enu", "diagnosticMessages.generated.json.lcg");
|
||||
file(generatedLCGFile, [generateLocalizedDiagnosticMessagesJs, diagnosticInfoMapTs, generatedDiagnosticMessagesJSON], function () {
|
||||
var cmd = host + " " + generateLocalizedDiagnosticMessagesJs + " " + lclDirectory + " " + builtLocalDirectory + " " + generatedDiagnosticMessagesJSON;
|
||||
console.log(cmd);
|
||||
@@ -735,8 +752,7 @@ desc("Makes a new LKG out of the built js files");
|
||||
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function () {
|
||||
var expectedFiles = [tscFile, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, cancellationTokenFile, typingsInstallerFile, buildProtocolDts, watchGuardFile].
|
||||
concat(libraryTargets).
|
||||
concat(fs.readdirSync(lclDirectory).map(function (d) { return path.join(builtLocalDirectory, d) })).
|
||||
concat(path.dirname(generatedLCGFile));
|
||||
concat(localizationTargets);
|
||||
var missingFiles = expectedFiles.filter(function (f) {
|
||||
return !fs.existsSync(f);
|
||||
});
|
||||
|
||||
+11
-2
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Výraz yield je povolený jenom v těle generátoru.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "K abstraktní metodě {0} ve třídě {1} nejde získat přístup prostřednictvím výrazu super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Abstraktní metody se můžou vyskytovat jenom v abstraktní třídě.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "K abstraktní vlastnosti {0} ve třídě {1} nelze získat přístup v konstruktoru.",
|
||||
"Accessibility_modifier_already_seen_1028": "Modifikátor dostupnosti se už jednou vyskytl.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Přístupové objekty jsou dostupné, jenom když je cílem ECMAScript 5 a vyšší verze.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Přistupující objekty musí být abstraktní nebo neabstraktní.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Člen objektu nemůže být deklarovaný jako nepovinný.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "Signatura přetížení nemůže být deklarovaný jako generátor.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Unární výraz s operátorem {0} se na levé straně výrazu umocnění nepovoluje. Zvažte možnost uzavření výrazu do závorek.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Přidat poznámku s typem z JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Přidat poznámky s typy z JSDoc",
|
||||
"Argument_expression_expected_1135": "Očekává se výraz argumentu.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "Argument možnosti {0} musí být {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Argument typu {0} nejde přiřadit k parametru typu {1}.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "Očekává se binární číslice.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "Element vazby {0} má implicitně typ {1}.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "Proměnná bloku {0} se používá před vlastní deklarací.",
|
||||
"Call_decorator_expression_90028": "Výraz pro volání dekoratéru",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Signatura volání s chybějící anotací návratového typu má implicitně návratový typ any.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "Cíl volání neobsahuje žádné signatury.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "K {0}.{1} nelze získat přístup, protože {0} je typ, nikoli názvový prostor. Chtěli jste načíst typ vlastnosti {1} v {0} pomocí {0}[{1}]?",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "Třída {0} nesprávně rozšiřuje základní třídu {1}.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "Třída {0} nesprávně implementuje rozhraní {1}.",
|
||||
"Class_0_used_before_its_declaration_2449": "Třída {0} se používá dříve, než se deklaruje.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklarace tříd nemůžou obsahovat více než jednu značku @augments nebo @extends.",
|
||||
"Class_name_cannot_be_0_2414": "Třída nemůže mít název {0}.",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Statická strana třídy {0} nesprávně rozšiřuje statickou stranu základní třídy {1}.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Třídy můžou rozšířit jenom jednu třídu.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "V typu {0} chybí signatura indexu.",
|
||||
"Index_signatures_are_incompatible_2330": "Signatury indexu jsou nekompatibilní.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Jednotlivé deklarace ve sloučené deklaraci {0} musí být všechny exportované nebo všechny místní.",
|
||||
"Infer_parameter_types_from_usage_95012": "Odvodit typy parametrů z používání",
|
||||
"Infer_type_of_0_from_usage_95011": "Odvodit typ {0} z používání",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Inicializovat vlastnost {0} v konstruktoru",
|
||||
"Initialize_static_property_0_90021": "Inicializovat statickou vlastnost {0}",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Inicializátor instance členské proměnné {0} nemůže odkazovat na identifikátor {1} deklarovaný v konstruktoru.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Neplatné použití {0} ve striktním režimu",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Neplatná hodnota pro jsxFactory. {0} není platný identifikátor nebo kvalifikovaný název.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Neplatná hodnota --reactNamespace. {0} není platný identifikátor.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "Značka JSDoc @augments {0} neodpovídá klauzuli extends {1}.",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "Značka JSDoc @augments není připojená k deklaraci třídy.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "Značka JSDoc @{0} {1} neodpovídá klauzuli extends {2}.",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "Značka JSDoc @{0} není připojená k třídě.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "Značka JSDoc @param má název {0}, ale žádný parametr s tímto názvem neexistuje.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "Značka JSDoc @typedef by měla mít anotaci typu nebo by za ní měla následovat značka @property nebo @member.",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Typy JSDoc se můžou používat jenom v dokumentačních komentářích.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Typ iterovaných elementů yield* musí být buď platný příslib, nebo nesmí obsahovat člen then, který se dá volat.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Typ operandu yield v asynchronním generátoru musí být buď platný příslib, nebo nesmí obsahovat člen then, který se dá volat.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Parametr typu {0} má cyklické omezení.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "Parametr typu {0} má cyklickou výchozí hodnotu.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "Parametr typu {0} signatury volání z exportovaného rozhraní má nebo používá privátní název {1}.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "Parametr typu {0} signatury konstruktoru z exportovaného rozhraní má nebo používá privátní název {1}.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "Parametr typu {0} exportované třídy má nebo používá privátní název {1}.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Sledovat vstupní soubory",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "Nejde přejmenovat elementy definované ve standardní knihovně TypeScriptu.",
|
||||
"You_cannot_rename_this_element_8000": "Tento element nejde přejmenovat.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "Objekt {0} přijímá málo argumentů k tomu, aby se dal použít jako dekoratér. Nechtěli jste ho nejprve volat a napsat @{0}()?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "Položka {0} je zadána dvakrát. Atribut s názvem {0} se přepíše.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "{0} se dá použít jenom v souboru .ts.",
|
||||
"_0_expected_1005": "Očekával se: {0}.",
|
||||
+14
-6
@@ -246,6 +246,7 @@
|
||||
"Declare_method_0_90023": "Methode \"{0}\" deklarieren.",
|
||||
"Declare_property_0_90016": "Eigenschaft \"{0}\" deklarieren.",
|
||||
"Declare_static_method_0_90024": "Statische Methode \"{0}\" deklarieren.",
|
||||
"Declare_static_property_0_90027": "Deklarieren Sie die statische Eigenschaft \"{0}\".",
|
||||
"Decorators_are_not_valid_here_1206": "Decorators sind hier ungültig.",
|
||||
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Decorators dürfen nicht auf mehrere get-/set-Zugriffsmethoden mit dem gleichen Namen angewendet werden.",
|
||||
"Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Der Standardexport des Moduls besitzt oder verwendet den privaten Namen \"{0}\".",
|
||||
@@ -293,6 +294,7 @@
|
||||
"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151": "Geben Sie eine einzelne Datei mit Quellzuordnungen anstelle einer separaten Datei aus.",
|
||||
"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152": "Geben Sie die Quelle zusammen mit den Quellzuordnungen innerhalb einer einzelnen Datei aus; hierfür muss \"--inlineSourceMap\" oder \"--sourceMap\" festgelegt sein.",
|
||||
"Enable_all_strict_type_checking_options_6180": "Aktivieren Sie alle strengen Typüberprüfungsoptionen.",
|
||||
"Enable_strict_checking_of_function_types_6186": "Aktivieren Sie die strenge Überprüfung für Funktionstypen.",
|
||||
"Enable_strict_null_checks_6113": "Strenge NULL-Überprüfungen aktivieren.",
|
||||
"Enable_tracing_of_the_name_resolution_process_6085": "Ablaufverfolgung des Namensauflösungsvorgangs aktivieren.",
|
||||
"Enables_experimental_support_for_ES7_async_functions_6068": "Ermöglicht experimentelle Unterstützung für asynchrone ES7-Funktionen.",
|
||||
@@ -333,8 +335,12 @@
|
||||
"Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521": "Der Ausdruck wird in die Variablendeklaration \"{0}\" aufgelöst, die der Compiler verwendet, um asynchrone Funktionen zu unterstützen.",
|
||||
"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544": "Der Ausdruck wird in die Variablendeklaration \"_newTarget\" aufgelöst, die der Compiler zum Erfassen der Metaeigenschaftenreferenz \"new.target\" verwendet.",
|
||||
"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "Der Ausdruck wird in die Variablendeklaration \"_this\" aufgelöst, die der Compiler verwendet, um den this-Verweis zu erfassen.",
|
||||
"Extract_function_95003": "Funktion extrahieren",
|
||||
"Extract_to_0_95004": "Extrahieren in {0}",
|
||||
"Extract_constant_95006": "Konstante extrahieren",
|
||||
"Extract_function_95005": "Funktion extrahieren",
|
||||
"Extract_symbol_95003": "Symbol extrahieren",
|
||||
"Extract_to_0_in_1_95004": "Nach {0} in {1} extrahieren",
|
||||
"Extract_to_0_in_1_scope_95008": "Nach {0} in {1}-Bereich extrahieren",
|
||||
"Extract_to_0_in_enclosing_scope_95007": "Nach {0} in einschließenden Bereich extrahieren",
|
||||
"FILE_6035": "DATEI",
|
||||
"FILE_OR_DIRECTORY_6040": "DATEI ODER VERZEICHNIS",
|
||||
"Failed_to_parse_file_0_Colon_1_5014": "Fehler beim Analysieren der Datei \"{0}\": {1}.",
|
||||
@@ -424,6 +430,10 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Ungültige Verwendung von \"{0}\" im Strict-Modus.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Ungültiger Wert für \"jsxFactory\". \"{0}\" ist kein gültiger Bezeichner oder qualifizierter Name.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Ungültiger Wert für \"-reactNamespace\". \"{0}\" ist kein gültiger Bezeichner.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "\"@augments {0}\" in JSDoc entspricht nicht der Klausel \"extends {1}\".",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "\"@augments\" in JSDoc ist keiner Klassendeklaration zugeordnet.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "Das JSDoc-Tag \"@param\" weist den Namen \"{0}\" auf, es gibt jedoch keinen Parameter dieses Namens.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "Das JSDoc-Tag \"@typedef\" muss entweder eine Typanmerkung aufweisen, oder die Tags \"@property\" oder \"@member\" müssen darauf folgen.",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc-Typen können nur innerhalb von Dokumentationskommentaren verwendet werden.",
|
||||
"JSX_attribute_expected_17003": "Ein JSX-Attribut wurde erwartet.",
|
||||
"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": "JSX-Attributen darf nur ein nicht leeres expression-Objekt zugewiesen werden.",
|
||||
@@ -468,7 +478,6 @@
|
||||
"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498": "Das Modul \"{0}\" verwendet \"export =\" und darf nicht mit \"export *\" verwendet werden.",
|
||||
"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145": "Das Modul \"{0}\" wurde als in \"{1}\" deklariertes Umgebungsmodul aufgelöst, weil diese Datei nicht geändert wurde.",
|
||||
"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144": "Das Modul \"{0}\" wurde als lokal deklariertes Umgebungsmodul in der Datei \"{1}\" aufgelöst.",
|
||||
"Module_0_was_resolved_to_1_but_allowJs_is_not_set_6143": "Das Modul \"{0}\" wurde zu \"{1}\" aufgelöst, aber \"--allowJs\" wurde nicht festgelegt.",
|
||||
"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142": "Das Modul \"{0}\" wurde zu \"{1}\" aufgelöst, aber \"--jsx\" wurde nicht festgelegt.",
|
||||
"Module_Resolution_Options_6174": "Modulauflösungsoptionen",
|
||||
"Module_name_0_matched_pattern_1_6092": "Modulname \"{0}\", übereinstimmendes Muster \"{1}\".",
|
||||
@@ -656,7 +665,7 @@
|
||||
"Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "ECMAScript-Zielversion angeben: ES3 (Standard), ES5, ES2015, ES2016, ES2017 oder ESNEXT.",
|
||||
"Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "JSX-Codegenerierung angeben: \"preserve\", \"react-native\" oder \"react\".",
|
||||
"Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Geben Sie Bibliotheksdateien an, die in die Kompilierung eingeschlossen werden sollen: ",
|
||||
"Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Codeerstellung für das Modul angeben: \"none\", \"commonjs\", \"amd\", \"system\", \"umd\" \"es2015\" oder \"ESNext\".",
|
||||
"Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Geben Sie die Codegenerierung für das Modul an: \"none\", \"commonjs\", \"amd\", \"system\", \"umd\", \"es2015\" oder \"ESNext\".",
|
||||
"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Geben Sie die Modulauflösungsstrategie an: \"node\" (Node.js) oder \"classic\" (TypeScript vor Version 1.6).",
|
||||
"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Geben Sie die JSX-Factoryfunktion an, die für eine react-JSX-Ausgabe verwendet werden soll, z. B. \"React.createElement\" oder \"h\".",
|
||||
"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060": "Geben Sie die Zeilenendesequenz an, die beim Ausgeben von Dateien verwendet werden soll: \"CRLF\" (DOS) oder \"LF\" (Unix).",
|
||||
@@ -691,10 +700,9 @@
|
||||
"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "Auf das Objekt \"arguments\" darf in einer asynchronen Funktion oder Methode in ES3 und ES5 nicht verwiesen werden. Verwenden Sie ggf. eine Standardfunktion oder -methode.",
|
||||
"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "Der Text einer \"if\"-Anweisung kann keine leere Anweisung sein.",
|
||||
"The_character_set_of_the_input_files_6163": "Der Zeichensatz der Eingabedateien.",
|
||||
"The_config_file_0_found_doesn_t_contain_any_source_files_6129": "Die gefundene Konfigurationsdatei \"{0}\" enthält keine Quelldateien.",
|
||||
"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "Der beinhaltende Funktions- oder Modulkörper ist zu groß für eine Ablaufsteuerungsanalyse.",
|
||||
"The_current_host_does_not_support_the_0_option_5001": "Der aktuelle Host unterstützt die Option \"{0}\" nicht.",
|
||||
"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714": "The expression of an export assignment must be an identifier or qualified name in an ambient context.",
|
||||
"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714": "Der Ausdruck einer Exportzuweisung muss ein Bezeichner oder ein qualifizierter Name in einem Umgebungskontext sein.",
|
||||
"The_files_list_in_config_file_0_is_empty_18002": "Die Liste \"files\" in der Konfigurationsdatei \"{0}\" ist leer.",
|
||||
"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060": "Der erste Parameter der \"then\"-Methode einer Zusage muss ein Rückruf sein.",
|
||||
"The_global_type_JSX_0_may_not_have_more_than_one_property_2608": "Der globale Typ \"JSX.{0}\" darf nur eine Eigenschaft aufweisen.",
|
||||
@@ -533,7 +533,7 @@
|
||||
</Item>
|
||||
<Item ItemId=";Add_0_to_existing_import_declaration_from_1_90015" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Add {0} to existing import declaration from {1}.]]></Val>
|
||||
<Val><![CDATA[Add '{0}' to existing import declaration from "{1}".]]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -2399,7 +2399,7 @@
|
||||
</Item>
|
||||
<Item ItemId=";Import_0_from_1_90013" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Import {0} from {1}.]]></Val>
|
||||
<Val><![CDATA[Import '{0}' from "{1}".]]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Una expresión \"yield\" solo se permite en un cuerpo de generador.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "No se puede acceder al método abstracto '{0}' de la clase '{1}' mediante una expresión super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Los métodos abstractos solo pueden aparecer en una clase abstracta.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "No se puede acceder a la propiedad abstracta \"{0}\" de la clase \"{1}\" en el constructor.",
|
||||
"Accessibility_modifier_already_seen_1028": "El modificador de accesibilidad ya se ha visto.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Los descriptores de acceso solo están disponibles cuando el destino es ECMAScript 5 y versiones posteriores.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Los descriptores de acceso deben ser los dos abstractos o los dos no abstractos.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Un miembro de objeto no se puede declarar como opcional.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "Una signatura de sobrecarga no se puede declarar como generador.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "No se admite una expresión unaria con el operador '{0}' en el lado izquierdo de una expresión de exponenciación. Considere la posibilidad de incluir la expresión entre paréntesis.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Anotar con tipo de JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Anotar con tipos de JSDoc",
|
||||
"Argument_expression_expected_1135": "Se esperaba una expresión de argumento.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "El argumento para la opción '{0}' debe ser: {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "No se puede asignar un argumento de tipo '{0}' al parámetro de tipo '{1}'.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "Se esperaba un dígito binario.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "El elemento de enlace '{0}' tiene un tipo '{1}' implícito.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "Variable con ámbito de bloque '{0}' usada antes de su declaración.",
|
||||
"Call_decorator_expression_90028": "Llame a la expresión decorador.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signatura de llamada, que carece de una anotación de tipo de valor devuelto, tiene implícitamente un tipo de valor devuelto \"any\".",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "El destino de llamada no contiene signaturas.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "No se puede acceder a \"{0}.{1}\" porque \"{0}\" es un tipo, no un espacio de nombres. ¿Su intención era recuperar el tipo de la propiedad \"{1}\" en \"{0}\" con \"{0}[\"{1}\"]\"?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "No se puede escribir en el archivo '{0}' porque sobrescribiría el archivo de entrada.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "La variable de la cláusula catch no puede tener una anotación de tipo.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "La variable de la cláusula catch no puede tener un inicializador.",
|
||||
"Change_0_to_1_90014": "Cambia {0} a {1}.",
|
||||
"Change_0_to_1_90014": "Cambie \"{0}\" a \"{1}\".",
|
||||
"Change_extends_to_implements_90003": "Cambiar \"extends\" por \"implements\".",
|
||||
"Change_spelling_to_0_90022": "Cambiar la ortografía a \"{0}\".",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Comprobando si '{0}' es el prefijo coincidente más largo para '{1}' - '{2}'.",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "La clase '{0}' extiende la clase base '{1}' de forma incorrecta.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "La clase '{0}' implementa la interfaz '{1}' de forma incorrecta.",
|
||||
"Class_0_used_before_its_declaration_2449": "Se ha usado la clase \"{0}\" antes de declararla.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Las declaraciones de clase no pueden tener más de una etiqueta \"@augments\" o \"@extends\".",
|
||||
"Class_name_cannot_be_0_2414": "El nombre de la clase no puede ser \"{0}\".",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "El lado estático de la clase '{0}' extiende el lado estático de la clase base '{1}' de forma incorrecta.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Las clases solo pueden extender una clase única.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "Falta la signatura de índice en el tipo '{0}'.",
|
||||
"Index_signatures_are_incompatible_2330": "Las signaturas de índice no son compatibles.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Las declaraciones individuales de la declaración '{0}' combinada deben ser todas exportadas o todas locales.",
|
||||
"Infer_parameter_types_from_usage_95012": "Infiera los tipos de parámetro del uso.",
|
||||
"Infer_type_of_0_from_usage_95011": "Infiera el tipo de \"{0}\" del uso.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Inicialice la propiedad \"{0}\" en el constructor.",
|
||||
"Initialize_static_property_0_90021": "Inicialice la propiedad estática \"{0}\".",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "El inicializador de la variable miembro de instancia '{0}' no puede hacer referencia al identificador '{1}' declarado en el constructor.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Uso no válido de '{0}' en modo strict.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Valor no válido para \"jsxFactory\". \"{0}\" no es un nombre calificado o un identificador válido.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Valor no válido para '--reactNamespace'. '{0}' no es un identificador válido.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "La etiqueta \"@augments {0}\" de JSDoc no coincide con la cláusula \"extends {1}\".",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "La etiqueta \"@augments\" de JSDoc no está asociada a una declaración de clase.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "La etiqueta \"@{0} {1}\" de JSDoc no coincide con la cláusula \"extends {2}\".",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "La etiqueta \"@{0}\" de JSDoc no está asociada a una clase.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "La etiqueta \"@param\" de JSDoc tiene el nombre \"{0}\", pero no hay ningún parámetro con ese nombre.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "La etiqueta \"@typedef\" de JSDoc debe tener una anotación de tipo o ir seguida de las etiquetas \"@property\" o \"@member\".",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Los tipos JSDoc solo se pueden usar en los comentarios de la documentación.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "El tipo de elementos iterados de un operando \"yield*\" debe ser una promesa válida o no debe contener un miembro \"then\" invocable.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "El tipo de operando \"yield\" en un generador asincrónico debe ser una promesa válida o no debe contener un miembro \"then\" invocable.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "El parámetro de tipo '{0}' tiene una restricción circular.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "El parámetro de tipo \"{0}\" tiene un valor circular predeterminado.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "El parámetro de tipo '{0}' de la signatura de llamada de la interfaz exportada tiene o usa el nombre privado '{1}'.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "El parámetro de tipo '{0}' de la signatura de constructor de la interfaz exportada tiene o usa el nombre privado '{1}'.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "El parámetro de tipo '{0}' de la clase exportada tiene o usa el nombre privado '{1}'.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Inspeccionar archivos de entrada.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "No se puede cambiar el nombre de elementos definidos en la biblioteca TypeScript estándar.",
|
||||
"You_cannot_rename_this_element_8000": "No se puede cambiar el nombre a este elemento.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "\"{0}\" no acepta suficientes argumentos para utilizarse como decorador aquí. ¿Pretendía llamar primero y escribir \"@{0}()\"?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "\"{0}\" se especifica dos veces. El atributo denominado \"{0}\" se sobrescribirá.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}' solo se puede usar en un archivo .ts.",
|
||||
"_0_expected_1005": "Se esperaba '{0}'.",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Une expression 'yield' est autorisée uniquement dans le corps d'un générateur.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "La méthode abstraite '{0}' de la classe '{1}' n'est pas accessible au moyen de l'expression super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Les méthodes abstraites peuvent uniquement apparaître dans une classe abstraite.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "La propriété abstraite '{0}' de la classe '{1}' n'est pas accessible dans le constructeur.",
|
||||
"Accessibility_modifier_already_seen_1028": "Modificateur d'accessibilité déjà rencontré.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Les accesseurs sont uniquement disponibles quand EcmaScript 5 ou version supérieure est ciblé.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Les accesseurs doivent être abstraits ou non abstraits.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Impossible de déclarer un membre d'objet comme étant facultatif.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "Une signature de surcharge ne peut pas être déclarée en tant que générateur.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Une expression unaire avec l'opérateur '{0}' n'est pas autorisée dans la partie gauche d'une expression d'élévation à une puissance. Mettez l'expression entre parenthèses.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Annoter avec le type de JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Annoter avec les types de JSDoc",
|
||||
"Argument_expression_expected_1135": "Expression d'argument attendue.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "L'argument de l'option '{0}' doit être {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "L'argument de type '{0}' n'est pas attribuable au paramètre de type '{1}'.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "Chiffre binaire attendu.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "L'élément de liaison '{0}' possède implicitement un type '{1}'.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "Variable de portée de bloc '{0}' utilisée avant sa déclaration.",
|
||||
"Call_decorator_expression_90028": "Appelez l'expression de l'élément décoratif.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signature d'appel, qui ne dispose pas d'annotation de type de retour, possède implicitement un type de retour 'any'.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "La cible de l'appel ne contient aucune signature.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Impossible d'accéder à '{0}.{1}', car '{0}' est un type, mais pas un espace de noms. Voulez-vous plutôt récupérer le type de la propriété '{1}' dans '{0}' avec '{0}[\"{1}\"]' ?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Impossible d'écrire le fichier '{0}', car cela entraînerait le remplacement du fichier d'entrée.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "Une variable de clause catch ne peut pas avoir d'annotation de type.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "Une variable de clause catch ne peut pas avoir d'initialiseur.",
|
||||
"Change_0_to_1_90014": "Changez {0} en {1}.",
|
||||
"Change_0_to_1_90014": "Changez '{0}' en '{1}'.",
|
||||
"Change_extends_to_implements_90003": "Changez 'extends' en 'implements'.",
|
||||
"Change_spelling_to_0_90022": "Changez l'orthographe en '{0}'.",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Vérification en cours pour déterminer si '{0}' est le préfixe correspondant le plus long pour '{1}' - '{2}'.",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "La classe '{0}' étend de manière incorrecte la classe de base '{1}'.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "La classe '{0}' implémente de manière incorrecte l'interface '{1}'.",
|
||||
"Class_0_used_before_its_declaration_2449": "Classe '{0}' utilisée avant sa déclaration.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Les déclarations de classes ne peuvent pas avoir plusieurs balises '@augments' ou '@extends'.",
|
||||
"Class_name_cannot_be_0_2414": "Le nom de la classe ne peut pas être '{0}'.",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Le côté statique de la classe '{0}' étend de manière incorrecte le côté statique de la classe de base '{1}'.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Les classes ne peuvent étendre qu'une seule classe.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "Signature d'index manquante dans le type '{0}'.",
|
||||
"Index_signatures_are_incompatible_2330": "Les signatures d'index sont incompatibles.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Les déclarations individuelles de la déclaration fusionnée '{0}' doivent toutes être exportées ou locales.",
|
||||
"Infer_parameter_types_from_usage_95012": "Déduisez les types des paramètres à partir de l'utilisation.",
|
||||
"Infer_type_of_0_from_usage_95011": "Déduisez le type de '{0}' à partir de l'utilisation.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Initialisez la propriété '{0}' dans le constructeur.",
|
||||
"Initialize_static_property_0_90021": "Initialisez la propriété statique '{0}'.",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "L'initialiseur de la variable membre d'instance '{0}' ne peut pas référencer l'identificateur '{1}' déclaré dans le constructeur.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Utilisation non valide de '{0}' en mode strict.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Valeur non valide pour 'jsxFactory'. '{0}' n'est pas un identificateur valide ou un nom qualifié.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Valeur non valide pour '--reactNamespace'. '{0}' n'est pas un identificateur valide.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "La balise JSDoc '@augments {0}' ne correspond pas à la clause 'extends {1}'.",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "La balise JSDoc '@augments' n'est pas attaché à une déclaration de classe.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "La balise JSDoc '@{0} {1}' ne correspond pas à la clause 'extends {2}'.",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "La balise JSDoc '@{0}' n'est pas attachée à une classe.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "La balise JSDoc '@param' se nomme '{0}', mais il n'existe aucun paramètre portant ce nom.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "La balise JSDoc '@typedef' doit avoir une annotation de type ou être suivie des balises '@property' ou '@member'.",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Les types JSDoc peuvent uniquement être utilisés dans les commentaires de la documentation.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Le type des éléments itérés d'un opérande 'yield*' doit être une promesse valide ou ne doit contenir aucun membre 'then' pouvant être appelé.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Le type d'un opérande 'yield' dans un générateur asynchrone doit être une promesse valide ou ne doit contenir aucun membre 'then' pouvant être appelé.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Le paramètre de type '{0}' possède une contrainte circulaire.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "Le paramètre de type '{0}' a une valeur par défaut circulaire.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "Le paramètre de type '{0}' de la signature d'appel de l'interface exportée possède ou utilise le nom privé '{1}'.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "Le paramètre de type '{0}' de la signature de constructeur de l'interface exportée possède ou utilise le nom privé '{1}'.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "Le paramètre de type '{0}' de la classe exportée possède ou utilise le nom privé '{1}'.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Fichiers d'entrée d'espion.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "Vous ne pouvez pas renommer des éléments définis dans la bibliothèque TypeScript standard.",
|
||||
"You_cannot_rename_this_element_8000": "Vous ne pouvez pas renommer cet élément.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "'{0}' accepte trop peu d'arguments pour pouvoir être utilisé ici en tant qu'élément décoratif. Voulez-vous vraiment l'appeler d'abord et écrire '@{0}()' ?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "'{0}' spécifié deux fois. L'attribut nommé '{0}' va être remplacé.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}' peut uniquement être utilisé dans un fichier .ts.",
|
||||
"_0_expected_1005": "'{0}' attendu.",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Un'espressione 'yield' è consentita solo nel corpo di un generatore.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "Non è possibile accedere al metodo astratto '{0}' nella classe '{1}' tramite l'espressione super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "I metodi astratti possono essere inclusi solo in una classe astratta.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "Non è possibile accedere alla proprietà astratta '{0}' nella classe '{1}' nel costruttore.",
|
||||
"Accessibility_modifier_already_seen_1028": "Il modificatore di accessibilità è già presente.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Le funzioni di accesso sono disponibili solo se destinate a ECMAScript 5 e versioni successive.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Le funzioni di accesso devono essere tutte astratte o tutte non astratte.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Un membro di oggetto non può essere dichiarato come facoltativo.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "Non è possibile dichiarare come generatore una firma di overload.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Nella parte sinistra di un'espressione di elevamento a potenza non è consentita un'espressione unaria con l'operatore '{0}'. Provare a racchiudere l'espressione tra parentesi.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Annota con tipo di JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Annota con tipi di JSDoc",
|
||||
"Argument_expression_expected_1135": "È prevista l'espressione di argomento.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "L'argomento per l'opzione '{0}' deve essere {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "L'argomento di tipo '{0}' non è assegnabile al parametro di tipo '{1}'.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "È prevista una cifra binaria.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "L'elemento di binding '{0}' contiene implicitamente un tipo '{1}'.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "La variabile con ambito blocco '{0}' è stata usata prima di essere stata dichiarata.",
|
||||
"Call_decorator_expression_90028": "Chiama l'espressione Decorator.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La firma di chiamata, in cui manca l'annotazione di tipo restituito, contiene implicitamente un tipo restituito 'any'.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "La destinazione della chiamata non contiene alcuna firma.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Non è possibile accedere a '{0}.{1}' perché '{0}' è un tipo ma non uno spazio dei nomi. Si intendeva recuperare il tipo della proprietà '{1}' in '{0}' con '{0}[\"{1}\"]'?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Non è possibile scrivere il file '{0}' perché sovrascriverebbe il file di input.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "La variabile della clausola catch non può contenere un'annotazione di tipo.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "La variabile della clausola catch non può contenere un inizializzatore.",
|
||||
"Change_0_to_1_90014": "Cambia {0} in {1}.",
|
||||
"Change_0_to_1_90014": "Cambia '{0}' in '{1}'.",
|
||||
"Change_extends_to_implements_90003": "Cambia 'extends' in 'implements'.",
|
||||
"Change_spelling_to_0_90022": "Modificare l'ortografia in '{0}'.",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Verrà verificato se '{0}' è il prefisso di corrispondenza più lungo per '{1}' - '{2}'.",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "La classe '{0}' estende in modo errato la classe di base '{1}'.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "La classe '{0}' implementa in modo errato l'interfaccia '{1}'.",
|
||||
"Class_0_used_before_its_declaration_2449": "La classe '{0}' è stata usata prima di essere stata dichiarata.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Le dichiarazioni di classe non possono contenere più di un tag `@augments` o `@extends`.",
|
||||
"Class_name_cannot_be_0_2414": "Il nome della classe non può essere '{0}'.",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Il lato statico '{0}' della classe estende in modo errato il lato statico '{1}' della classe di base.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Le classi possono estendere solo un'unica classe.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "Nel tipo '{0}' manca la firma dell'indice.",
|
||||
"Index_signatures_are_incompatible_2330": "Le firme dell'indice sono incompatibili.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Le singole dichiarazioni della dichiarazione sottoposta a merge '{0}' devono essere tutte esportate o tutte locali.",
|
||||
"Infer_parameter_types_from_usage_95012": "Deriva i tipi di parametro dall'utilizzo.",
|
||||
"Infer_type_of_0_from_usage_95011": "Deriva il tipo di '{0}' dall'utilizzo.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Inizializza la proprietà '{0}' nel costruttore.",
|
||||
"Initialize_static_property_0_90021": "Inizializza la proprietà statica '{0}'.",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "L'inizializzatore della variabile del membro di istanza '{0}' non può fare riferimento all'identificatore '{1}' dichiarato nel costruttore.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Uso non valido di '{0}' in modalità strict.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Il valore non è valido per 'jsxFactory'. '{0}' non è un identificatore o un nome qualificato valido.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Il valore di '--reactNamespace' non è valido. '{0}' non è un identificatore valido",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "Il tag '@augments {0}' di JSDoc non corrisponde alla clausola 'extends {1}'.",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "Il tag '@augments' di JSDoc non è collegato a una dichiarazione di classe.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "Il tag '@{0} {1}' di JSDoc non corrisponde alla clausola 'extends {2}'.",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "Il tag '@{0}' di JSDoc non è collegato a una classe.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "Il nome del tag '@param' di JSDoc è '{0}', ma non esiste alcun parametro con questo nome.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "Il tag '@typedef' di JSDoc deve contenere un'annotazione di tipo o essere seguito dal tag '@property' o '@member'.",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "I tipi JSDoc possono essere usati solo nei commenti della documentazione.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Il tipo di elementi iterati di un operando 'yield*' deve essere una promessa valida oppure non deve contenere un membro 'then' chiamabile.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Il tipo dell'operando 'yield' in un generatore asincrono deve essere una promessa valida oppure non deve contenere un membro 'then' chiamabile.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Il parametro di tipo '{0}' contiene un vincolo circolare.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "Il parametro di tipo '{0}' contiene un'impostazione predefinita circolare.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "Il parametro di tipo '{0}' della firma di chiamata dell'interfaccia esportata contiene o usa il nome privato '{1}'.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "Il parametro di tipo '{0}' della firma del costruttore dell'interfaccia esportata contiene o usa il nome privato '{1}'.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "Il parametro di tipo '{0}' della classe esportata contiene o usa il nome privato '{1}'.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Controlla i file di input.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "Non è possibile rinominare elementi definiti nella libreria TypeScript standard.",
|
||||
"You_cannot_rename_this_element_8000": "Non è possibile rinominare questo elemento.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "'{0}' accetta un numero troppo ridotto di argomenti da usare come espressione Decorator in questo punto. Si intendeva chiamarlo prima e scrivere '@{0}()'?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "Gli attributi '{0}' sono stati specificati due volte. L'attributo denominato '{0}' verrà sovrascritto.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}' può essere usato solo in un file con estensione ts.",
|
||||
"_0_expected_1005": "È previsto '{0}'.",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "'yield' 式は、ジェネレーター本文でのみ使用できます。",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "クラス '{1}' の抽象メソッド '{0}' には super 式を介してアクセスできません。",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "抽象メソッドは抽象クラス内でのみ使用できます。",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "コンストラクター内でクラス '{1}' の抽象プロパティ '{0}' にアクセスできません。",
|
||||
"Accessibility_modifier_already_seen_1028": "アクセシビリティ修飾子は既に存在します。",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "アクセサーは ECMAScript 5 以上をターゲットにする場合にのみ使用できます。",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "アクセサーはどちらも抽象または非抽象である必要があります。",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "オブジェクト メンバーを省略可能として宣言することはできません。",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "オーバーロード シグネチャをジェネレーターとして宣言することはできません。",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "累乗式の左辺で '{0}' 演算子を含む単項式を使用することはできません。式を括弧で囲むことを検討してください。",
|
||||
"Annotate_with_type_from_JSDoc_95009": "JSDoc の型で注釈を付けます",
|
||||
"Annotate_with_types_from_JSDoc_95010": "JSDoc の型で注釈を付けます",
|
||||
"Argument_expression_expected_1135": "引数式が必要です。",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "'{0}' オプションの引数は {1} である必要があります。",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "型 '{0}' の引数を型 '{1}' のパラメーターに割り当てることはできません。",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "2 進の数字が必要です。",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "バインド要素 '{0}' には暗黙的に '{1}' 型が含まれます。",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "ブロック スコープの変数 '{0}' が、宣言の前に使用されています。",
|
||||
"Call_decorator_expression_90028": "デコレーター式を呼び出します。",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "戻り値の型の注釈がない呼び出しシグネチャの戻り値の型は、暗黙的に 'any' になります。",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "呼び出しターゲットにシグネチャが含まれていません。",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}.{1}' にアクセスできません。'{0}' は型で、名前空間ではありません。'{0}[\"{1}\"]' で '{0}' のプロパティ '{1}' の型を取得するつもりでしたか?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "入力ファイルを上書きすることになるため、ファイル '{0}' を書き込めません。",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "catch 句の変数に型の注釈を指定することはできません。",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "catch 句の変数に初期化子を指定することはできません。",
|
||||
"Change_0_to_1_90014": "{0} を {1} に変更します。",
|
||||
"Change_0_to_1_90014": "'{0}' を '{1}' に変更します。",
|
||||
"Change_extends_to_implements_90003": "'extends' を 'implements' に変更します。",
|
||||
"Change_spelling_to_0_90022": "スペルを '{0}' に変更してください。",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "'{0}' が '{1}' - '{2}' の最長一致のプレフィックスであるかを確認しています。",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "クラス '{0}' は基底クラス '{1}' を正しく拡張していません。",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "クラス '{0}' はインターフェイス '{1}' を正しく実装していません。",
|
||||
"Class_0_used_before_its_declaration_2449": "クラス '{0}' は宣言の前に使用されました。",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "クラス宣言で複数の '@augments' または `@extends` タグを使用することはできません。",
|
||||
"Class_name_cannot_be_0_2414": "クラス名を '{0}' にすることはできません。",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "クラス側の静的な '{0}' が基底クラス側の静的な '{1}' を正しく拡張していません。",
|
||||
"Classes_can_only_extend_a_single_class_1174": "クラスで拡張できるクラスは 1 つのみです。",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "型 '{0}' のインデックス シグネチャがありません。",
|
||||
"Index_signatures_are_incompatible_2330": "インデックスの署名に互換性がありません。",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "マージされた宣言 '{0}' の個々の宣言はすべてエクスポートされるか、すべてローカルであるかのどちらかである必要があります。",
|
||||
"Infer_parameter_types_from_usage_95012": "使用状況からパラメーターの型を推論します。",
|
||||
"Infer_type_of_0_from_usage_95011": "使用状況から型 '{0}' を推論します。",
|
||||
"Initialize_property_0_in_the_constructor_90020": "コンストラクターのプロパティ '{0}' を初期化します。",
|
||||
"Initialize_static_property_0_90021": "静的プロパティ '{0}' を初期化します。",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "インスタンス メンバー変数 '{0}' の初期化子はコンストラクターで宣言された識別子 '{1}' を参照できません。",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "厳格モードでは '{0}' の使用は無効です。",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory' の値が無効です。'{0}' が有効な識別子または修飾名ではありません。",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace' の値が無効です。'{0}' は有効な識別子ではありません。",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "JSDoc '@augments {0}' は 'extends {1}' 句と一致しません。",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "JSDoc '@augments' はクラス宣言にアタッチされていません。",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "JSDoc '@{0} {1}' が 'extends {2}' 句と一致しません。",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "JSDoc '@{0}' はクラスにアタッチされていません。",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "JSDoc '@param' タグの名前は '{0}' ですが、その名前のパラメーターはありません。",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc '@typedef' タグには、型の注釈を指定するか、後に '@property' タグや '@member' タグを付ける必要があります。",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc の種類は、ドキュメント コメント内でのみ使用できます。",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*' オペランドの反復要素の型は、有効な Promise であるか、呼び出し可能な 'then' メンバーを含んでいないかのどちらかであることが必要です。",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "非同期ジェネレーター内の 'yield' オペランドの型は、有効な Promise であるか、呼び出し可能な 'then' メンバーを含んでいないかのどちらかであることが必要です。",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "型パラメーター '{0}' に循環制約があります。",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "型パラメーター '{0}' に循環既定値があります。",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "エクスポートされたインターフェイスの呼び出しシグネチャの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "エクスポートされたインターフェイスのコンストラクター シグネチャの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "エクスポートされたクラスの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "入力ファイルを監視します。",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "標準の TypeScript ライブラリで定義された要素の名前を変更することはできません。",
|
||||
"You_cannot_rename_this_element_8000": "この要素の名前を変更することはできません。",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "'{0}' は受け入れる引数が少なすぎるので、ここでデコレーターとして使用することができません。最初にこれを呼び出してから、'@{0}()' を書き込むつもりでしたか?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "'{0}' は 2 回指定されています。'{0}' という名前の属性は上書きされます。",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}' を使用できるのは .ts ファイル内のみです。",
|
||||
"_0_expected_1005": "'{0}' が必要です。",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "'yield' 식은 생성기 본문에서만 사용할 수 있습니다.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "super 식을 통해 '{1}' 클래스의 추상 메서드 '{0}'에 액세스할 수 없습니다.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "추상 메서드는 추상 클래스 내에서만 사용할 수 있습니다.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "생성자에서 '{1}' 클래스의 추상 속성 '{0}'에 액세스할 수 없습니다.",
|
||||
"Accessibility_modifier_already_seen_1028": "액세스 가능성 한정자가 이미 있습니다.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "접근자는 ECMAScript 5 이상을 대상으로 지정할 때만 사용할 수 있습니다.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "접근자는 모두 추상이거나 비추상이어야 합니다.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "개체 멤버는 선택적으로 선언될 수 없습니다.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "오버로드 시그니처는 생성기로 선언할 수 없습니다.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "지수 식의 왼쪽에는 '{0}' 연산자가 있는 단항 식을 사용할 수 없습니다. 식을 괄호로 묶는 것이 좋습니다.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "JSDoc의 형식을 사용하여 주석 추가",
|
||||
"Annotate_with_types_from_JSDoc_95010": "JSDoc의 형식을 사용하여 주석 추가",
|
||||
"Argument_expression_expected_1135": "인수 식이 필요합니다.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "'{0}' 옵션의 인수는 {1}이어야(여야) 합니다.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "'{0}' 형식의 인수는 '{1}' 형식의 매개 변수에 할당될 수 없습니다.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "이진수가 있어야 합니다.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "바인딩 요소 '{0}'에 암시적으로 '{1}' 형식이 있습니다.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "선언 전에 사용된 블록 범위 변수 '{0}'입니다.",
|
||||
"Call_decorator_expression_90028": "decorator 식을 호출합니다.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "반환 형식 주석이 없는 호출 시그니처에는 암시적으로 'any' 반환 형식이 포함됩니다.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "호출 대상에 시그니처가 포함되어 있지 않습니다.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}'이(가) 네임스페이스가 아니라 형식이므로 '{0}.{1}'에 액세스할 수 없습니다. '{0}'에서 '{0}[\"{1}\"]'과(와) 함께 '{1}' 속성의 형식을 검색하려고 했나요?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "'{0}' 파일은 입력 파일을 덮어쓰므로 쓸 수 없습니다.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch 절 변수에 형식 주석을 사용할 수 없습니다.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "Catch 절 변수에 이니셜라이저를 사용할 수 없습니다.",
|
||||
"Change_0_to_1_90014": "{0}을(를) {1}(으)로 변경합니다.",
|
||||
"Change_0_to_1_90014": "'{0}'을(를) '{1}'(으)로 변경합니다.",
|
||||
"Change_extends_to_implements_90003": "'extends'를 'implements'로 변경하세요.",
|
||||
"Change_spelling_to_0_90022": "철자를 '{0}'(으)로 변경하세요.",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "'{0}'이(가) '{1}' - '{2}'에 대해 일치하는 가장 긴 접두사인지 확인하는 중입니다.",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "'{0}' 클래스가 기본 클래스 '{1}'을(를) 잘못 확장합니다.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "'{0}' 클래스가 '{1}' 인터페이스를 잘못 구현합니다.",
|
||||
"Class_0_used_before_its_declaration_2449": "선언 전에 사용된 '{0}' 클래스입니다.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "클래스 선언은 '@augments' 또는 `@extends` 태그를 둘 이상 가질 수 없습니다.",
|
||||
"Class_name_cannot_be_0_2414": "클래스 이름은 '{0}'일 수 없습니다.",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "클래스 정적 측면 '{0}'이(가) 기본 클래스 정적 측면 '{1}'을(를) 잘못 확장합니다.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "클래스는 단일 클래스만 확장할 수 있습니다.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "'{0}' 형식에 인덱스 시그니처가 없습니다.",
|
||||
"Index_signatures_are_incompatible_2330": "인덱스 시그니처가 호환되지 않습니다.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "병합된 선언 '{0}'의 개별 선언은 모두 내보내 졌거나 모두 로컬이어야 합니다.",
|
||||
"Infer_parameter_types_from_usage_95012": "사용량에서 매개 변수 형식을 유추합니다.",
|
||||
"Infer_type_of_0_from_usage_95011": "사용량에서 '{0}'의 형식을 유추합니다.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "생성자에서 속성 '{0}'을(를) 초기화합니다.",
|
||||
"Initialize_static_property_0_90021": "정적 속성 '{0}'을(를) 초기화합니다.",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "인스턴스 멤버 변수 '{0}'의 이니셜라이저는 생성자에 선언된 식별자 '{1}'을(를) 참조할 수 없습니다.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "strict 모드에서 '{0}'을(를) 잘못 사용했습니다.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory'에 대한 값이 잘못되었습니다. '{0}'이(가) 올바른 식별자 또는 정규화된 이름이 아닙니다.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace'의 값이 잘못되었습니다. '{0}'은(는) 올바른 식별자가 아닙니다.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "JSDoc '@augments {0}'이(가) 'extends {1}' 절과 일치하지 않습니다.",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "JSDoc '@augments'가 클래스 선언에 연결되어 있지 않습니다.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "JSDoc '@{0} {1}'이(가) 'extends {2}' 절과 일치하지 않습니다.",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "JSDoc '@{0}'이(가) 클래스에 연결되어 있지 않습니다.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "JSDoc '@param' 태그의 이름이 '{0}'인데 해당 이름의 매개 변수가 없습니다.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc '@typedef' 태그는 형식 주석을 포함하거나, '@property' 또는 '@member' 태그 앞에 와야 합니다.",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc 유형은 문서 주석 내에서만 사용될 수 있습니다.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*'의 반복되는 요소 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "비동기 생성기에 있는 'yield' 형식의 피연산자는 유효한 프라미스여야 하거나 호출 가능 'then' 멤버를 포함하지 않아야 합니다.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "형식 매개 변수 '{0}'에 순환 제약 조건이 있습니다.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "형식 매개 변수 '{0}'에 순환 기본값이 있습니다.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "내보낸 인터페이스에 있는 호출 시그니처의 형식 매개 변수 '{0}'이(가) 전용 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "내보낸 인터페이스에 있는 생성자 시그니처의 형식 매개 변수 '{0}'이(가) 전용 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "내보낸 클래스의 형식 매개 변수 '{0}'이(가) 전용 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "조사식 입력 파일입니다.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "표준 TypeScript 라이브러리에 정의된 요소의 이름을 바꿀 수 없습니다.",
|
||||
"You_cannot_rename_this_element_8000": "이 요소의 이름을 바꿀 수 없습니다.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "'{0}'이(가) 여기에서 decorator로 사용할 인수를 너무 적게 허용합니다. 먼저 이를 호출하고 '@{0}()'을(를) 작성하시겠습니까?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "'{0}'이(가) 두 번 지정되었습니다. 이름이 '{0}'인 특성을 덮어씁니다.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}'은(는) .ts 파일에서만 사용할 수 있습니다.",
|
||||
"_0_expected_1005": "'{0}'이(가) 필요합니다.",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Wyrażenie „yield” jest dozwolone tylko w treści generatora.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "Nie można uzyskać dostępu do metody abstrakcyjnej „{0}” w klasie „{1}” za pomocą wyrażenia super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Metody abstrakcyjne mogą występować tylko w klasie abstrakcyjnej.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "Właściwość abstrakcyjna „{0}” w klasie „{1}” jest niedostępna w konstruktorze.",
|
||||
"Accessibility_modifier_already_seen_1028": "Napotkano już modyfikator dostępności.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Metody dostępu są dostępne tylko wtedy, gdy jest używany język ECMAScript 5 lub nowszy.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Obie metody dostępu muszą być abstrakcyjne lub nieabstrakcyjne.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Element członkowski obiektu nie może być zadeklarowany jako opcjonalny.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "Sygnatura przeciążenia nie może być zadeklarowana jako generator.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Wyrażenie jednoargumentowe z operatorem „{0}” jest niedozwolone po lewej stronie wyrażenia potęgowania. Zastanów się nad zamknięciem wyrażenia w nawiasach.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Dodaj adnotację przy użyciu typu z JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Dodaj adnotację przy użyciu typów z JSDoc",
|
||||
"Argument_expression_expected_1135": "Oczekiwano wyrażenia argumentu.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "Argumentem opcji „{0}” musi być: {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Nie można przypisać argumentu typu „{0}” do parametru typu „{1}”.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "Oczekiwano bitu.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "Dla elementu powiązania „{0}” niejawnie określono typ „{1}”.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "Zmienna „{0}” o zakresie bloku została użyta przed jej deklaracją.",
|
||||
"Call_decorator_expression_90028": "Wywołaj wyrażenie dekoratora.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dla sygnatury wywołania bez adnotacji zwracanego typu niejawnie określono zwracany typ „any”.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "Cel wywołania nie zawiera żadnych podpisów.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Nie można uzyskać dostępu do elementu „{0}.{1}”, ponieważ element „{0}” jest typem, ale nie przestrzenią nazw. Czy chcesz pobrać typ właściwości „{1}” w lokalizacji „{0}” za pomocą elementu „{0}[„{1}”]”?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Nie można zapisać pliku „{0}”, ponieważ nadpisałby plik wejściowy.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "Zmienna klauzuli catch nie może mieć adnotacji typu.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "Zmienna klauzuli catch nie może mieć inicjatora.",
|
||||
"Change_0_to_1_90014": "Zmień {0} na {1}.",
|
||||
"Change_0_to_1_90014": "Zmień element „{0}” na „{1}”.",
|
||||
"Change_extends_to_implements_90003": "Zmień atrybut „extends” na „implements”.",
|
||||
"Change_spelling_to_0_90022": "Zmiana pisowni na „{0}”.",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Sprawdzanie, czy „{0}” to najdłuższy zgodny prefiks dla „{1}” — „{2}”.",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "Klasa „{0}” niepoprawnie rozszerza klasę podstawową „{1}”.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "Klasa „{0}” zawiera niepoprawną implementację interfejsu „{1}”.",
|
||||
"Class_0_used_before_its_declaration_2449": "Klasa „{0}” została użyta przed zadeklarowaniem.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklaracje klas nie mogą mieć więcej niż jeden tag „@augments” lub „@extends”.",
|
||||
"Class_name_cannot_be_0_2414": "Klasa nie może mieć nazwy „{0}”.",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Strona statyczna klasy „{0}” niepoprawnie rozszerza stronę statyczną klasy podstawowej „{1}”.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Klasy mogą rozszerzać tylko pojedynczą klasę.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "Brak sygnatury indeksu w typie „{0}”.",
|
||||
"Index_signatures_are_incompatible_2330": "Sygnatury indeksów są niezgodne.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Wszystkie poszczególne deklaracje w scalonej deklaracji „{0}” muszą być wyeksportowane lub lokalne.",
|
||||
"Infer_parameter_types_from_usage_95012": "Wywnioskuj typy parametrów na podstawie użycia.",
|
||||
"Infer_type_of_0_from_usage_95011": "Wywnioskuj typ elementu „{0}” na podstawie użycia.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Zainicjuj właściwość „{0}” w konstruktorze.",
|
||||
"Initialize_static_property_0_90021": "Zainicjuj właściwość statyczną „{0}”.",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Inicjator zmiennej elementu członkowskiego wystąpienia „{0}” nie może przywoływać identyfikatora „{1}” zadeklarowanego w konstruktorze.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Nieprawidłowe użycie elementu „{0}” w trybie z ograniczeniami.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Nieprawidłowa wartość elementu „jsxFactory”. „{0}” to nie jest prawidłowy identyfikator ani kwalifikowana nazwa.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Nieprawidłowa wartość opcji „--reactNamespace”. Element „{0}” nie jest prawidłowym identyfikatorem.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "Element JSDoc „@augments {0}” jest niezgodny z klauzulą „extends {1}”.",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "Element JSDoc „@augments” nie został dołączony do deklaracji klasy.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "Element JSDoc „@{0} {1}” nie pasuje do klauzuli „extends {2}”.",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "Element JSDoc „@{0}” nie został dołączony do klasy.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "Tag JSDoc „@param” tag ma nazwę „{0}”, ale nie ma parametru o tej nazwie.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "Tag JSDoc „@typedef” powinien mieć adnotację typu albo powinien następować po nim tag „@property” lub „@member”.",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Typy JSDoc mogą być używane wyłącznie w komentarzach dokumentacji.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Typ iterowanych elementów operandu „yield*” musi być prawidłową obietnicą lub nie może zawierać wywoływalnego elementu członkowskiego „then”.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Typ operandu „yield” w generatorze asynchronicznym musi być prawidłową obietnicą lub nie może zawierać wywoływalnego elementu członkowskiego „then”.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Parametr typu „{0}” zawiera ograniczenie cykliczne.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "Parametr typu „{0}” ma cykliczną wartość domyślną.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "Parametr typu „{0}” sygnatury wywołania z wyeksportowanego interfejsu ma nazwę prywatną „{1}” lub używa tej nazwy.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "Parametr typu „{0}” sygnatury konstruktora z wyeksportowanego interfejsu ma nazwę prywatną „{1}” lub używa tej nazwy.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "Parametr typu „{0}” wyeksportowanej klasy ma nazwę prywatną „{1}” lub używa tej nazwy.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Obserwuj pliki wejściowe.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "Nie można zmienić nazw elementów zdefiniowanych w standardowej bibliotece TypeScript.",
|
||||
"You_cannot_rename_this_element_8000": "Nie można zmienić nazwy tego elementu.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "Element „{0}” akceptuje za mało argumentów, aby można go było użyć w tym miejscu jako dekorator. Czy chcesz najpierw go wywołać i zapisać tag „@{0}()”?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "Element „{0}” został określony dwa razy. Atrybut o nazwie „{0}” zostanie przesłonięty.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "Elementu „{0}” można użyć tylko w pliku .ts.",
|
||||
"_0_expected_1005": "Oczekiwano elementu „{0}”.",
|
||||
Vendored
+27
-1
@@ -47,6 +47,7 @@ declare namespace ts.server.protocol {
|
||||
DocCommentTemplate = "docCommentTemplate",
|
||||
CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
|
||||
GetCodeFixes = "getCodeFixes",
|
||||
ApplyCodeActionCommand = "applyCodeActionCommand",
|
||||
GetSupportedCodeFixes = "getSupportedCodeFixes",
|
||||
GetApplicableRefactors = "getApplicableRefactors",
|
||||
GetEditsForRefactor = "getEditsForRefactor",
|
||||
@@ -68,6 +69,7 @@ declare namespace ts.server.protocol {
|
||||
* Client-initiated request message
|
||||
*/
|
||||
interface Request extends Message {
|
||||
type: "request";
|
||||
/**
|
||||
* The command to execute
|
||||
*/
|
||||
@@ -87,6 +89,7 @@ declare namespace ts.server.protocol {
|
||||
* Server-initiated event message
|
||||
*/
|
||||
interface Event extends Message {
|
||||
type: "event";
|
||||
/**
|
||||
* Name of event
|
||||
*/
|
||||
@@ -100,6 +103,7 @@ declare namespace ts.server.protocol {
|
||||
* Response by server to client request message.
|
||||
*/
|
||||
interface Response extends Message {
|
||||
type: "response";
|
||||
/**
|
||||
* Sequence number of the request message.
|
||||
*/
|
||||
@@ -113,7 +117,8 @@ declare namespace ts.server.protocol {
|
||||
*/
|
||||
command: string;
|
||||
/**
|
||||
* Contains error message if success === false.
|
||||
* If success === false, this should always be provided.
|
||||
* Otherwise, may (or may not) contain a success message.
|
||||
*/
|
||||
message?: string;
|
||||
/**
|
||||
@@ -389,6 +394,12 @@ declare namespace ts.server.protocol {
|
||||
command: CommandTypes.GetCodeFixes;
|
||||
arguments: CodeFixRequestArgs;
|
||||
}
|
||||
interface ApplyCodeActionCommandRequest extends Request {
|
||||
command: CommandTypes.ApplyCodeActionCommand;
|
||||
arguments: ApplyCodeActionCommandRequestArgs;
|
||||
}
|
||||
interface ApplyCodeActionCommandResponse extends Response {
|
||||
}
|
||||
interface FileRangeRequestArgs extends FileRequestArgs {
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
@@ -416,6 +427,9 @@ declare namespace ts.server.protocol {
|
||||
*/
|
||||
errorCodes?: number[];
|
||||
}
|
||||
interface ApplyCodeActionCommandRequestArgs extends FileRequestArgs {
|
||||
command: {};
|
||||
}
|
||||
/**
|
||||
* Response for GetCodeFixes request.
|
||||
*/
|
||||
@@ -1154,6 +1168,8 @@ declare namespace ts.server.protocol {
|
||||
description: string;
|
||||
/** Text changes to apply to each file as part of the code action */
|
||||
changes: FileCodeEdits[];
|
||||
/** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
|
||||
commands?: {}[];
|
||||
}
|
||||
/**
|
||||
* Format and format on key response message.
|
||||
@@ -1260,6 +1276,11 @@ declare namespace ts.server.protocol {
|
||||
* this span should be used instead of the default one.
|
||||
*/
|
||||
replacementSpan?: TextSpan;
|
||||
/**
|
||||
* Indicates whether commiting this completion entry will require additional code actions to be
|
||||
* made to avoid errors. The CompletionEntryDetails will have these actions.
|
||||
*/
|
||||
hasAction?: true;
|
||||
}
|
||||
/**
|
||||
* Additional completion entry details, available on demand
|
||||
@@ -1289,6 +1310,10 @@ declare namespace ts.server.protocol {
|
||||
* JSDoc tags for the symbol.
|
||||
*/
|
||||
tags: JSDocTagInfo[];
|
||||
/**
|
||||
* The associated code actions for this entry
|
||||
*/
|
||||
codeActions?: CodeAction[];
|
||||
}
|
||||
interface CompletionsResponse extends Response {
|
||||
body?: CompletionEntry[];
|
||||
@@ -2113,6 +2138,7 @@ declare namespace ts.server.protocol {
|
||||
interface JsFileExtensionInfo {
|
||||
extension: string;
|
||||
isMixedContent: boolean;
|
||||
scriptKind?: ScriptKind;
|
||||
}
|
||||
|
||||
interface JSDocTagInfo {
|
||||
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "A expressão 'yield' só é permitida em um corpo gerador.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "O método abstrato '{0}' na classe '{1}' não pode ser acessado por meio da expressão super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Os métodos abstratos só podem aparecer dentro de uma classe abstrata.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "A propriedade abstrata '{0}' na classe '{1}' não pode ser acessada no construtor.",
|
||||
"Accessibility_modifier_already_seen_1028": "O modificador de acessibilidade já foi visto.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Os acessadores somente estão disponíveis no direcionamento para ECMAScript 5 e superior.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Acessadores devem ser abstratos ou não abstratos.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Um membro de objeto não pode ser declarado como opcional.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "A assinatura de sobrecarga não pode ser declarada como geradora.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Uma expressão unária com o operador '{0}' não é permitida no lado esquerdo de uma expressão de exponenciação. Considere delimitar a expressão em parênteses.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Anotar com o tipo do JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Anotar com os tipos do JSDoc",
|
||||
"Argument_expression_expected_1135": "Expressão de argumento esperada.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "O argumento para a opção '{0}' deve ser: {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "O argumento do tipo '{0}' não é atribuível ao parâmetro do tipo '{1}'.",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "Dígito binário esperado.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "O elemento de associação '{0}' tem implicitamente um tipo '{1}'.",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "Variável de escopo de bloco '{0}' usada antes da sua declaração.",
|
||||
"Call_decorator_expression_90028": "Chamar expressão decoradora.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Assinatura de chamada, que não tem a anotação de tipo de retorno, implicitamente tem um tipo de retorno 'any'.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "O destino da chamada não contém nenhuma assinatura.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Não foi possível acessar '{0}.{1}' porque '{0}' é um tipo, mas não um namespace. Você quis dizer recuperar o tipo da propriedade '{1}' em '{0}' com '{0}[\"{1}\"]'?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Não é possível gravar o arquivo '{0}' porque ele substituiria o arquivo de entrada.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "A variável de cláusula catch não pode ter uma anotação de tipo.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "A variável de cláusula catch não pode ter um inicializador.",
|
||||
"Change_0_to_1_90014": "Alterar {0} para {1}.",
|
||||
"Change_0_to_1_90014": "Alterar '{0}' para '{1}'.",
|
||||
"Change_extends_to_implements_90003": "Altere 'extends' para 'implements'.",
|
||||
"Change_spelling_to_0_90022": "Alterar ortografia para '{0}'.",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Verificando se '{0}' é o maior prefixo correspondente para '{1}' - '{2}'.",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "A classe '{0}' estende incorretamente a classe base '{1}'.",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "A classe '{0}' implementa incorretamente a interface '{1}'.",
|
||||
"Class_0_used_before_its_declaration_2449": "Classe '{0}' usada antes de sua declaração.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Declarações de classe não podem ter mais de uma marca `@augments` ou `@extends`.",
|
||||
"Class_name_cannot_be_0_2414": "O nome de classe não pode ser '{0}'.",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "O lado estático da classe '{0}' incorretamente estende o lado estático da classe base '{1}'.",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Classes só podem estender uma única classe.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "Assinatura de índice ausente no tipo '{0}'.",
|
||||
"Index_signatures_are_incompatible_2330": "As assinaturas de índice são incompatíveis.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Todas as declarações individuais na declaração mesclada '{0}' devem ser exportadas ou ficar no local.",
|
||||
"Infer_parameter_types_from_usage_95012": "Inferir os tipos de parâmetro do uso.",
|
||||
"Infer_type_of_0_from_usage_95011": "Inferir o tipo de '{0}' do uso.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Inicializar a propriedade '{0}' no construtor.",
|
||||
"Initialize_static_property_0_90021": "Inicializar a propriedade estática '{0}'.",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "O inicializador da variável de membro de instância '{0}' não pode referenciar o identificador '{1}' declarado no construtor.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Uso inválido de '{0}' no modo estrito.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Valor inválido para 'jsxFactory'. '{0}' não é um identificador válido ou nome qualificado.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Valor inválido para '--reactNamespace'. '{0}' não é um identificador válido.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "JSDoc \"@augments {0}\" não corresponde à cláusula \"extends {1}\".",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "JSDoc \"@augments\" não está anexado à declaração de classe.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "O '@{0} {1}' do JSDoc não corresponde à cláusula 'extends {2}'.",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "O '@{0}' do JSDoc não está anexado a uma classe.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "A marcação do JSDoc \"@param\" tem o nome \"{0}\", mas não há nenhum parâmetro com esse nome.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "A marca JSDoc \"@typedef\" deve ter uma anotação de tipo ou ser seguida pelas marcas \"@property\" or \"@member\".",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Os tipos de JSDoc podem ser usados somente dentro dos comentários de documentação.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "O tipo de elementos iterados de um operando \"yield*\" deve ser uma promessa válida ou não deve conter um membro \"then\" que pode ser chamado.",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "O tipo do operando \"yield\" em um gerador assíncrono deve ser uma promessa válida ou não deve conter um membro \"then\" que pode ser chamado.",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "O parâmetro de tipo '{0}' tem uma restrição circular.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "O parâmetro de tipo '{0}' tem um padrão circular.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "O parâmetro de tipo '{0}' da assinatura de chamada da interface exportada tem ou está usando o nome particular '{1}'.",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "O parâmetro de tipo '{0}' da assinatura de construtor da interface exportada tem ou está usando o nome particular '{1}'.",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "O parâmetro de tipo '{0}' da classe exportada tem ou está usando o nome particular '{1}'.",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Observe os arquivos de entrada.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "Não é possível renomear elementos que são definidos na biblioteca TypeScript padrão.",
|
||||
"You_cannot_rename_this_element_8000": "Você não pode renomear este elemento.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "'{0}' aceita muito poucos argumentos para serem usados como um decorador aqui. Você quis dizer para chamá-lo primeiro e gravar '@{0}()'?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "'{0}' são especificados duas vezes. O atributo chamado '{0}' será substituído.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}' só pode ser usado em um arquivo .ts.",
|
||||
"_0_expected_1005": "'{0}' esperado.",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Выражение yield разрешено использовать только в теле генератора.",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "Невозможно получить доступ к абстрактному методу \"{0}\" класса \"{1}\" с помощью выражения super.",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Абстрактные методы могут использоваться только в абстрактных классах.",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "Абстрактное свойство \"{0}\" в классе \"{1}\" недоступно в конструкторе.",
|
||||
"Accessibility_modifier_already_seen_1028": "Модификатор специальных возможностей уже встречался.",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Методы доступа доступны только при разработке для ECMAScript 5 и более поздних версий.",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "Методы доступа должны быть абстрактными или неабстрактными.",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "Элемент объекта не может быть объявлен необязательным.",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "Сигнатура перегрузки не может быть объявлена в качестве генератора.",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Унарное выражение с оператором \"{0}\" не допускается в левой части выражения, возводимого в степень. Попробуйте заключить выражение в скобки.",
|
||||
"Annotate_with_type_from_JSDoc_95009": "Заметка с типом из JSDoc",
|
||||
"Annotate_with_types_from_JSDoc_95010": "Заметки с типами из JSDoc",
|
||||
"Argument_expression_expected_1135": "Ожидалось выражение аргумента.",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "Аргумент для параметра \"{0}\" должен быть {1}.",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Аргумент типа \"{0}\" нельзя назначить параметру типа \"{1}\".",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "Ожидался бит.",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "Элемент привязки \"{0}\" имеет неявный тип \"{1}\".",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "Переменная \"{0}\" с областью видимости, ограниченной блоком, использована перед своим объявлением.",
|
||||
"Call_decorator_expression_90028": "Вызов выражения-декоратора.",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Сигнатура вызова, у которой нет аннотации типа возвращаемого значения, неявно имеет тип возвращаемого значения any.",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "Объект вызова не содержит сигнатуры.",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Не удается получить доступ к {0}.{1}, так как {0} является типом, но не является пространством имен. Вы хотели получить тип свойства {1} в {0} с использованием {0}[\"{1}\"]?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Не удается записать файл \"{0}\", так как это привело бы к перезаписи входного файла.",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "Переменная оператора catch не может иметь аннотацию типа.",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "Переменная оператора catch не может иметь инициализатор.",
|
||||
"Change_0_to_1_90014": "Измените {0} на {1}.",
|
||||
"Change_0_to_1_90014": "Замена \"{0}\" на \"{1}\".",
|
||||
"Change_extends_to_implements_90003": "Измените \"extends\" на \"implements\".",
|
||||
"Change_spelling_to_0_90022": "Изменить правописание на \"{0}\".",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Идет проверка того, является ли \"{0}\" самым длинным соответствующим префиксом для \"{1}\" — \"{2}\".",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "Класс \"{0}\" неправильно расширяет базовый класс \"{1}\".",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "Класс \"{0}\" неправильно реализует интерфейс \"{1}\".",
|
||||
"Class_0_used_before_its_declaration_2449": "Класс \"{0}\" использован прежде, чем объявлен.",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "В объявлении класса не может использоваться более одного тега \"@augments\" или \"@extends\".",
|
||||
"Class_name_cannot_be_0_2414": "Имя класса не может иметь значение \"{0}\".",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Статическая сторона класса \"{0}\" неправильно расширяет статическую сторону базового класса \"{1}\".",
|
||||
"Classes_can_only_extend_a_single_class_1174": "Классы могут расширить только один класс.",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "В типе \"{0}\" отсутствует сигнатура индекса.",
|
||||
"Index_signatures_are_incompatible_2330": "Сигнатуры индекса несовместимы.",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Все отдельные объявления в объединенном объявлении \"{0}\" должны быть экспортированными или локальными.",
|
||||
"Infer_parameter_types_from_usage_95012": "Вывод типов параметров на основе использования.",
|
||||
"Infer_type_of_0_from_usage_95011": "Вывод типа \"{0}\" на основе использования.",
|
||||
"Initialize_property_0_in_the_constructor_90020": "Инициализировать свойство \"{0}\" в конструкторе.",
|
||||
"Initialize_static_property_0_90021": "Инициализировать статическое свойство \"{0}\".",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Инициализатор переменной-элемента экземпляра \"{0}\" не может ссылаться на идентификатор \"{1}\", объявленный в конструкторе.",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "Недопустимое использование \"{0}\" в строгом режиме.",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "Недопустимое значение для jsxFactory. \"{0}\" не является допустимым идентификатором или полным именем.",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "Недопустимое значение для \"--reactNamespace\". \"{0}\" не является допустимым идентификатором.",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "Параметр \"@augments {0}\" JSDoc не соответствует предложению \"extends {1}\".",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "Параметр \"@augments\" JSDoc не связан с объявлением класса.",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "Параметр \"@{0} {1}\" JSDoc не соответствует предложению \"extends {2}\".",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "Параметр \"@{0}\" JSDoc не связан с классом.",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "У тега \"@param\" JSDoc есть имя \"{0}\", но параметр с таким именем отсутствует.",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "У тега \"@typedef\" JSDoc должна быть аннотация типа, или после него должны стоять теги \"@property\" или \"@member\".",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Типы JSDoc можно использовать только в комментариях в документации.",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "Тип элементов итерации для операнда \"yield*\" должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "Тип операнда \"yield\" в асинхронном генераторе должен быть допустимым обещанием либо не должен содержать вызываемый элемент \"then\".",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "Параметр типа \"{0}\" содержит циклическое ограничение.",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "Параметр типа \"{0}\" по умолчанию является циклическим.",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "Параметр типа \"{0}\" сигнатуры вызова из экспортированного интерфейса имеет или использует закрытое имя \"{1}\".",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "Параметр типа \"{0}\" сигнатуры конструктора из экспортированного интерфейса имеет или использует закрытое имя \"{1}\".",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "Параметр типа \"{0}\" экспортированного класса имеет или использует закрытое имя \"{1}\".",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "Просмотр входных файлов.",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "Невозможно переименовать элементы, определенные в стандартной библиотеке TypeScript.",
|
||||
"You_cannot_rename_this_element_8000": "Этот элемент переименовать нельзя.",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "\"{0}\" принимает слишком мало аргументов для использования в качестве декоратора. Вы хотели сначала вызвать его и записать \"@{0}()\"?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "\"{0}\" указаны дважды. Атрибут \"{0}\" будет перезаписан.",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "\"{0}\" может использоваться только в TS-файле.",
|
||||
"_0_expected_1005": "Ожидалось \"{0}\".",
|
||||
+309
-216
@@ -165,8 +165,8 @@ var ts;
|
||||
ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0;
|
||||
function createDictionaryObject() {
|
||||
var map = Object.create(null);
|
||||
map["__"] = undefined;
|
||||
delete map["__"];
|
||||
map.__ = undefined;
|
||||
delete map.__;
|
||||
return map;
|
||||
}
|
||||
function createMap() {
|
||||
@@ -287,6 +287,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
ts.forEach = forEach;
|
||||
function firstDefined(array, callback) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var result = callback(array[i], i);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.firstDefined = firstDefined;
|
||||
function findAncestor(node, callback) {
|
||||
while (node) {
|
||||
var result = callback(node);
|
||||
@@ -340,6 +350,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
ts.find = find;
|
||||
function findLast(array, predicate) {
|
||||
for (var i = array.length - 1; i >= 0; i--) {
|
||||
var value = array[i];
|
||||
if (predicate(value, i)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.findLast = findLast;
|
||||
function findIndex(array, predicate) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (predicate(array[i], i)) {
|
||||
@@ -1064,6 +1084,15 @@ var ts;
|
||||
return result;
|
||||
}
|
||||
ts.arrayToMap = arrayToMap;
|
||||
function arrayToNumericMap(array, makeKey) {
|
||||
var result = [];
|
||||
for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
|
||||
var value = array_7[_i];
|
||||
result[makeKey(value)] = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ts.arrayToNumericMap = arrayToNumericMap;
|
||||
function arrayToSet(array, makeKey) {
|
||||
return arrayToMap(array, makeKey || (function (s) { return s; }), function () { return true; });
|
||||
}
|
||||
@@ -2264,6 +2293,14 @@ var ts;
|
||||
return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); });
|
||||
}
|
||||
ts.tryGetExtensionFromPath = tryGetExtensionFromPath;
|
||||
function getAnyExtensionFromPath(path) {
|
||||
var baseFileName = getBaseFileName(path);
|
||||
var extensionIndex = baseFileName.lastIndexOf(".");
|
||||
if (extensionIndex >= 0) {
|
||||
return baseFileName.substring(extensionIndex);
|
||||
}
|
||||
}
|
||||
ts.getAnyExtensionFromPath = getAnyExtensionFromPath;
|
||||
function isCheckJsEnabledForFile(sourceFile, compilerOptions) {
|
||||
return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs;
|
||||
}
|
||||
@@ -2406,8 +2443,13 @@ var ts;
|
||||
if (parentResult) {
|
||||
var baseName = getBaseNameOfFileName(fileOrDirectory);
|
||||
if (parentResult) {
|
||||
updateFilesOfFileSystemEntry(parentResult, baseName, host.fileExists(fileOrDirectoryPath));
|
||||
updateFileSystemEntry(parentResult.directories, baseName, host.directoryExists(fileOrDirectoryPath));
|
||||
var fsQueryResult = {
|
||||
fileExists: host.fileExists(fileOrDirectoryPath),
|
||||
directoryExists: host.directoryExists(fileOrDirectoryPath)
|
||||
};
|
||||
updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists);
|
||||
updateFileSystemEntry(parentResult.directories, baseName, fsQueryResult.directoryExists);
|
||||
return fsQueryResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2465,7 +2507,7 @@ var ts;
|
||||
var _path = require("path");
|
||||
var _os = require("os");
|
||||
var _crypto = require("crypto");
|
||||
var useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"];
|
||||
var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER;
|
||||
function createWatchedFileSet() {
|
||||
var dirWatchers = ts.createMap();
|
||||
var fileWatcherCallbacks = ts.createMultiMap();
|
||||
@@ -2819,7 +2861,7 @@ var ts;
|
||||
}
|
||||
function recursiveCreateDirectory(directoryPath, sys) {
|
||||
var basePath = ts.getDirectoryPath(directoryPath);
|
||||
var shouldCreateParent = directoryPath !== basePath && !sys.directoryExists(basePath);
|
||||
var shouldCreateParent = basePath !== "" && directoryPath !== basePath && !sys.directoryExists(basePath);
|
||||
if (shouldCreateParent) {
|
||||
recursiveCreateDirectory(basePath, sys);
|
||||
}
|
||||
@@ -3774,9 +3816,9 @@ var ts;
|
||||
Add_this_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, "Add_this_to_unresolved_variable_90008", "Add 'this.' to unresolved variable."),
|
||||
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(90009, ts.DiagnosticCategory.Error, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
|
||||
Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(90010, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),
|
||||
Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import {0} from {1}."),
|
||||
Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import '{0}' from \"{1}\"."),
|
||||
Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'."),
|
||||
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add {0} to existing import declaration from {1}."),
|
||||
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\"."),
|
||||
Declare_property_0: diag(90016, ts.DiagnosticCategory.Message, "Declare_property_0_90016", "Declare property '{0}'."),
|
||||
Add_index_signature_for_property_0: diag(90017, ts.DiagnosticCategory.Message, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'."),
|
||||
Disable_checking_for_this_file: diag(90018, ts.DiagnosticCategory.Message, "Disable_checking_for_this_file_90018", "Disable checking for this file."),
|
||||
@@ -5814,6 +5856,16 @@ var ts;
|
||||
}
|
||||
}
|
||||
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
|
||||
function isAnyImportSyntax(node) {
|
||||
switch (node.kind) {
|
||||
case 238:
|
||||
case 237:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ts.isAnyImportSyntax = isAnyImportSyntax;
|
||||
function getEnclosingBlockScopeContainer(node) {
|
||||
var current = node.parent;
|
||||
while (current) {
|
||||
@@ -6542,6 +6594,14 @@ var ts;
|
||||
return node && !!(node.flags & 1048576);
|
||||
}
|
||||
ts.isInJSDoc = isInJSDoc;
|
||||
function isJSDocIndexSignature(node) {
|
||||
return ts.isTypeReferenceNode(node) &&
|
||||
ts.isIdentifier(node.typeName) &&
|
||||
node.typeName.escapedText === "Object" &&
|
||||
node.typeArguments && node.typeArguments.length === 2 &&
|
||||
(node.typeArguments[0].kind === 136 || node.typeArguments[0].kind === 133);
|
||||
}
|
||||
ts.isJSDocIndexSignature = isJSDocIndexSignature;
|
||||
function isRequireCall(callExpression, checkArgumentIsStringLiteral) {
|
||||
if (callExpression.kind !== 181) {
|
||||
return false;
|
||||
@@ -6561,6 +6621,10 @@ var ts;
|
||||
return charCode === 39 || charCode === 34;
|
||||
}
|
||||
ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote;
|
||||
function isStringDoubleQuoted(string, sourceFile) {
|
||||
return getSourceTextOfNodeFromSourceFile(sourceFile, string).charCodeAt(0) === 34;
|
||||
}
|
||||
ts.isStringDoubleQuoted = isStringDoubleQuoted;
|
||||
function isDeclarationOfFunctionOrClassExpression(s) {
|
||||
if (s.valueDeclaration && s.valueDeclaration.kind === 226) {
|
||||
var declaration = s.valueDeclaration;
|
||||
@@ -15088,8 +15152,8 @@ var ts;
|
||||
array._children = undefined;
|
||||
array.pos += delta;
|
||||
array.end += delta;
|
||||
for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
|
||||
var node = array_7[_i];
|
||||
for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
|
||||
var node = array_8[_i];
|
||||
visitNode(node);
|
||||
}
|
||||
}
|
||||
@@ -15161,8 +15225,8 @@ var ts;
|
||||
array.intersectsChange = true;
|
||||
array._children = undefined;
|
||||
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
||||
for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
|
||||
var node = array_8[_i];
|
||||
for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
|
||||
var node = array_9[_i];
|
||||
visitNode(node);
|
||||
}
|
||||
return;
|
||||
@@ -18795,6 +18859,7 @@ var ts;
|
||||
}
|
||||
return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
|
||||
}
|
||||
ts.getPackageName = getPackageName;
|
||||
function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) {
|
||||
return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache);
|
||||
}
|
||||
@@ -18837,18 +18902,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
var mangledScopedPackageSeparator = "__";
|
||||
function mangleScopedPackage(moduleName, state) {
|
||||
if (ts.startsWith(moduleName, "@")) {
|
||||
var replaceSlash = moduleName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
|
||||
if (replaceSlash !== moduleName) {
|
||||
var mangled = replaceSlash.slice(1);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled);
|
||||
}
|
||||
return mangled;
|
||||
function mangleScopedPackage(packageName, state) {
|
||||
var mangled = getMangledNameForScopedPackage(packageName);
|
||||
if (state.traceEnabled && mangled !== packageName) {
|
||||
trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled);
|
||||
}
|
||||
return mangled;
|
||||
}
|
||||
function getTypesPackageName(packageName) {
|
||||
return "@types/" + getMangledNameForScopedPackage(packageName);
|
||||
}
|
||||
ts.getTypesPackageName = getTypesPackageName;
|
||||
function getMangledNameForScopedPackage(packageName) {
|
||||
if (ts.startsWith(packageName, "@")) {
|
||||
var replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
|
||||
if (replaceSlash !== packageName) {
|
||||
return replaceSlash.slice(1);
|
||||
}
|
||||
}
|
||||
return moduleName;
|
||||
return packageName;
|
||||
}
|
||||
function getPackageNameFromAtTypesDirectory(mangledName) {
|
||||
var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/");
|
||||
@@ -19189,6 +19261,7 @@ var ts;
|
||||
var enumNumberIndexInfo = createIndexInfo(stringType, true);
|
||||
var jsObjectLiteralIndexInfo = createIndexInfo(anyType, false);
|
||||
var globals = ts.createSymbolTable();
|
||||
var ambientModulesCache;
|
||||
var patternAmbientModules;
|
||||
var globalObjectType;
|
||||
var globalFunctionType;
|
||||
@@ -24529,13 +24602,11 @@ var ts;
|
||||
function getIntendedTypeFromJSDocTypeReference(node) {
|
||||
if (ts.isIdentifier(node.typeName)) {
|
||||
if (node.typeName.escapedText === "Object") {
|
||||
if (node.typeArguments && node.typeArguments.length === 2) {
|
||||
if (ts.isJSDocIndexSignature(node)) {
|
||||
var indexed = getTypeFromTypeNode(node.typeArguments[0]);
|
||||
var target = getTypeFromTypeNode(node.typeArguments[1]);
|
||||
var index = createIndexInfo(target, false);
|
||||
if (indexed === stringType || indexed === numberType) {
|
||||
return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index);
|
||||
}
|
||||
return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index);
|
||||
}
|
||||
return anyType;
|
||||
}
|
||||
@@ -25302,7 +25373,7 @@ var ts;
|
||||
}
|
||||
var spread = createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo);
|
||||
spread.flags |= propagatedFlags;
|
||||
spread.flags |= 1048576;
|
||||
spread.flags |= 1048576 | 4194304;
|
||||
spread.objectFlags |= 128;
|
||||
spread.symbol = symbol;
|
||||
return spread;
|
||||
@@ -28056,6 +28127,14 @@ var ts;
|
||||
return 8388607;
|
||||
}
|
||||
function getTypeWithFacts(type, include) {
|
||||
if (type.flags & 524288) {
|
||||
var baseConstraint = getBaseConstraintOfType(type) || emptyObjectType;
|
||||
var result = filterType(baseConstraint, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
||||
if (result !== baseConstraint) {
|
||||
return result;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
||||
}
|
||||
function getTypeWithDefault(type, defaultExpression) {
|
||||
@@ -30730,7 +30809,7 @@ var ts;
|
||||
return unknownType;
|
||||
}
|
||||
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
||||
markPropertyAsReferenced(prop, node);
|
||||
markPropertyAsReferenced(prop, node, left.kind === 99);
|
||||
getNodeLinks(node).resolvedSymbol = prop;
|
||||
checkPropertyAccessibility(node, left, apparentType, prop);
|
||||
var propType = getDeclaredOrApparentType(prop, node);
|
||||
@@ -30879,12 +30958,18 @@ var ts;
|
||||
}
|
||||
return bestCandidate;
|
||||
}
|
||||
function markPropertyAsReferenced(prop, nodeForCheckWriteOnly) {
|
||||
function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) {
|
||||
if (prop &&
|
||||
noUnusedIdentifiers &&
|
||||
(prop.flags & 106500) &&
|
||||
prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8)
|
||||
&& !(nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly))) {
|
||||
if (isThisAccess) {
|
||||
var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration);
|
||||
if (containingMethod && containingMethod.symbol === prop) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ts.getCheckFlags(prop) & 1) {
|
||||
getSymbolLinks(prop).target.isReferenced = true;
|
||||
}
|
||||
@@ -33763,7 +33848,9 @@ var ts;
|
||||
if (produceDiagnostics) {
|
||||
var symbol = getNodeLinks(node).resolvedSymbol;
|
||||
if (!symbol) {
|
||||
error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type));
|
||||
if (!ts.isJSDocIndexSignature(node)) {
|
||||
error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type));
|
||||
}
|
||||
return;
|
||||
}
|
||||
var typeParameters = symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters;
|
||||
@@ -34856,7 +34943,7 @@ var ts;
|
||||
var parentType = getTypeForBindingElementParent(parent);
|
||||
var name = node.propertyName || node.name;
|
||||
var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name));
|
||||
markPropertyAsReferenced(property, undefined);
|
||||
markPropertyAsReferenced(property, undefined, false);
|
||||
if (parent.initializer && property) {
|
||||
checkPropertyAccessibility(parent, parent.initializer, parentType, property);
|
||||
}
|
||||
@@ -38663,13 +38750,15 @@ var ts;
|
||||
}
|
||||
}
|
||||
function getAmbientModules() {
|
||||
var result = [];
|
||||
globals.forEach(function (global, sym) {
|
||||
if (ambientModuleSymbolRegex.test(ts.unescapeLeadingUnderscores(sym))) {
|
||||
result.push(global);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
if (!ambientModulesCache) {
|
||||
ambientModulesCache = [];
|
||||
globals.forEach(function (global, sym) {
|
||||
if (ambientModuleSymbolRegex.test(sym)) {
|
||||
ambientModulesCache.push(global);
|
||||
}
|
||||
});
|
||||
}
|
||||
return ambientModulesCache;
|
||||
}
|
||||
function checkGrammarImportCallExpression(node) {
|
||||
if (modulekind === ts.ModuleKind.ES2015) {
|
||||
@@ -56580,14 +56669,14 @@ var ts;
|
||||
var newMissingFilePathMap = ts.arrayToSet(missingFilePaths);
|
||||
ts.mutateMap(missingFileWatches, newMissingFilePathMap, {
|
||||
createNewValue: createMissingFileWatch,
|
||||
onDeleteValue: ts.closeFileWatcher
|
||||
onDeleteValue: closeFileWatcher
|
||||
});
|
||||
}
|
||||
ts.updateMissingFilePathsWatch = updateMissingFilePathsWatch;
|
||||
function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) {
|
||||
ts.mutateMap(existingWatchedForWildcards, wildcardDirectories, {
|
||||
createNewValue: createWildcardDirectoryWatcher,
|
||||
onDeleteValue: ts.closeFileWatcherOf,
|
||||
onDeleteValue: closeFileWatcherOf,
|
||||
onExistingValue: updateWildcardDirectoryWatcher
|
||||
});
|
||||
function createWildcardDirectoryWatcher(directory, flags) {
|
||||
@@ -56605,8 +56694,6 @@ var ts;
|
||||
}
|
||||
}
|
||||
ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories;
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
function addFileWatcher(host, file, cb) {
|
||||
return host.watchFile(file, cb);
|
||||
}
|
||||
@@ -56683,40 +56770,26 @@ var ts;
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
(function (ts) {
|
||||
function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, isDetailed, cancellationToken, customTransformers) {
|
||||
function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) {
|
||||
var outputFiles = [];
|
||||
var emittedSourceFiles;
|
||||
var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
||||
if (!isDetailed) {
|
||||
return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped };
|
||||
}
|
||||
return {
|
||||
outputFiles: outputFiles,
|
||||
emitSkipped: emitResult.emitSkipped,
|
||||
diagnostics: emitResult.diagnostics,
|
||||
sourceMaps: emitResult.sourceMaps,
|
||||
emittedSourceFiles: emittedSourceFiles
|
||||
};
|
||||
function writeFile(fileName, text, writeByteOrderMark, _onError, sourceFiles) {
|
||||
return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped };
|
||||
function writeFile(fileName, text, writeByteOrderMark) {
|
||||
outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text });
|
||||
if (isDetailed) {
|
||||
emittedSourceFiles = ts.addRange(emittedSourceFiles, sourceFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.getFileEmitOutput = getFileEmitOutput;
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
function createBuilder(options) {
|
||||
var isModuleEmit;
|
||||
var fileInfos = ts.createMap();
|
||||
var semanticDiagnosticsPerFile = ts.createMap();
|
||||
var changedFileNames = ts.createMap();
|
||||
var changedFilesSet = ts.createMap();
|
||||
var hasShapeChanged = ts.createMap();
|
||||
var allFilesExcludingDefaultLibraryFile;
|
||||
var emitHandler;
|
||||
return {
|
||||
updateProgram: updateProgram,
|
||||
getFilesAffectedBy: getFilesAffectedBy,
|
||||
emitFile: emitFile,
|
||||
emitChangedFiles: emitChangedFiles,
|
||||
getSemanticDiagnostics: getSemanticDiagnostics,
|
||||
clear: clear
|
||||
@@ -56729,33 +56802,36 @@ var ts;
|
||||
fileInfos.clear();
|
||||
semanticDiagnosticsPerFile.clear();
|
||||
}
|
||||
hasShapeChanged.clear();
|
||||
allFilesExcludingDefaultLibraryFile = undefined;
|
||||
ts.mutateMap(fileInfos, ts.arrayToMap(program.getSourceFiles(), function (sourceFile) { return sourceFile.path; }), {
|
||||
createNewValue: function (_path, sourceFile) { return addNewFileInfo(program, sourceFile); },
|
||||
onDeleteValue: removeExistingFileInfo,
|
||||
onExistingValue: function (existingInfo, sourceFile) { return updateExistingFileInfo(program, existingInfo, sourceFile); }
|
||||
});
|
||||
}
|
||||
function registerChangedFile(path, fileName) {
|
||||
changedFileNames.set(path, fileName);
|
||||
function registerChangedFile(path) {
|
||||
changedFilesSet.set(path, true);
|
||||
semanticDiagnosticsPerFile.delete(path);
|
||||
}
|
||||
function addNewFileInfo(program, sourceFile) {
|
||||
registerChangedFile(sourceFile.path, sourceFile.fileName);
|
||||
registerChangedFile(sourceFile.path);
|
||||
emitHandler.onAddSourceFile(program, sourceFile);
|
||||
return { fileName: sourceFile.fileName, version: sourceFile.version, signature: undefined };
|
||||
return { version: sourceFile.version, signature: undefined };
|
||||
}
|
||||
function removeExistingFileInfo(existingFileInfo, path) {
|
||||
registerChangedFile(path, existingFileInfo.fileName);
|
||||
function removeExistingFileInfo(_existingFileInfo, path) {
|
||||
changedFilesSet.delete(path);
|
||||
semanticDiagnosticsPerFile.delete(path);
|
||||
emitHandler.onRemoveSourceFile(path);
|
||||
}
|
||||
function updateExistingFileInfo(program, existingInfo, sourceFile) {
|
||||
if (existingInfo.version !== sourceFile.version) {
|
||||
registerChangedFile(sourceFile.path, sourceFile.fileName);
|
||||
registerChangedFile(sourceFile.path);
|
||||
existingInfo.version = sourceFile.version;
|
||||
emitHandler.onUpdateSourceFile(program, sourceFile);
|
||||
}
|
||||
else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) {
|
||||
registerChangedFile(sourceFile.path, sourceFile.fileName);
|
||||
registerChangedFile(sourceFile.path);
|
||||
}
|
||||
}
|
||||
function ensureProgramGraph(program) {
|
||||
@@ -56770,87 +56846,73 @@ var ts;
|
||||
}
|
||||
function getFilesAffectedBy(program, path) {
|
||||
ensureProgramGraph(program);
|
||||
var sourceFile = program.getSourceFile(path);
|
||||
var singleFileResult = sourceFile && options.shouldEmitFile(sourceFile) ? [sourceFile.fileName] : [];
|
||||
var info = fileInfos.get(path);
|
||||
if (!info || !updateShapeSignature(program, sourceFile, info)) {
|
||||
return singleFileResult;
|
||||
var sourceFile = program.getSourceFileByPath(path);
|
||||
if (!sourceFile) {
|
||||
return ts.emptyArray;
|
||||
}
|
||||
ts.Debug.assert(!!sourceFile);
|
||||
return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile, singleFileResult);
|
||||
if (!updateShapeSignature(program, sourceFile)) {
|
||||
return [sourceFile];
|
||||
}
|
||||
return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile);
|
||||
}
|
||||
function emitFile(program, path) {
|
||||
function emitChangedFiles(program, writeFileCallback) {
|
||||
ensureProgramGraph(program);
|
||||
if (!fileInfos.has(path)) {
|
||||
return { outputFiles: [], emitSkipped: true };
|
||||
var compilerOptions = program.getCompilerOptions();
|
||||
if (!changedFilesSet.size) {
|
||||
return ts.emptyArray;
|
||||
}
|
||||
if (compilerOptions.outFile || compilerOptions.out) {
|
||||
ts.Debug.assert(semanticDiagnosticsPerFile.size === 0);
|
||||
changedFilesSet.clear();
|
||||
return [program.emit(undefined, writeFileCallback)];
|
||||
}
|
||||
return options.getEmitOutput(program, program.getSourceFileByPath(path), false, false);
|
||||
}
|
||||
function enumerateChangedFilesSet(program, onChangedFile, onAffectedFile) {
|
||||
changedFileNames.forEach(function (fileName, path) {
|
||||
onChangedFile(fileName, path);
|
||||
var affectedFiles = getFilesAffectedBy(program, path);
|
||||
for (var _i = 0, affectedFiles_1 = affectedFiles; _i < affectedFiles_1.length; _i++) {
|
||||
var file = affectedFiles_1[_i];
|
||||
onAffectedFile(file, program.getSourceFile(file));
|
||||
}
|
||||
});
|
||||
}
|
||||
function enumerateChangedFilesEmitOutput(program, emitOnlyDtsFiles, onChangedFile, onEmitOutput) {
|
||||
var seenFiles = ts.createMap();
|
||||
enumerateChangedFilesSet(program, onChangedFile, function (fileName, sourceFile) {
|
||||
if (!seenFiles.has(fileName)) {
|
||||
seenFiles.set(fileName, true);
|
||||
if (sourceFile) {
|
||||
semanticDiagnosticsPerFile.delete(sourceFile.path);
|
||||
var emitOutput = options.getEmitOutput(program, sourceFile, emitOnlyDtsFiles, true);
|
||||
onEmitOutput(emitOutput, sourceFile);
|
||||
if (emitOutput.emittedSourceFiles) {
|
||||
for (var _i = 0, _a = emitOutput.emittedSourceFiles; _i < _a.length; _i++) {
|
||||
var file = _a[_i];
|
||||
seenFiles.set(file.fileName, true);
|
||||
}
|
||||
}
|
||||
var result;
|
||||
changedFilesSet.forEach(function (_true, path) {
|
||||
var affectedFiles = getFilesAffectedBy(program, path);
|
||||
affectedFiles.forEach(function (affectedFile) {
|
||||
semanticDiagnosticsPerFile.delete(affectedFile.path);
|
||||
if (!seenFiles.has(affectedFile.path)) {
|
||||
seenFiles.set(affectedFile.path, true);
|
||||
(result || (result = [])).push(program.emit(affectedFile, writeFileCallback));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function emitChangedFiles(program) {
|
||||
ensureProgramGraph(program);
|
||||
var result = [];
|
||||
enumerateChangedFilesEmitOutput(program, false, ts.noop, function (emitOutput) { return result.push(emitOutput); });
|
||||
changedFileNames.clear();
|
||||
return result;
|
||||
changedFilesSet.clear();
|
||||
return result || ts.emptyArray;
|
||||
}
|
||||
function getSemanticDiagnostics(program, cancellationToken) {
|
||||
ensureProgramGraph(program);
|
||||
enumerateChangedFilesSet(program, ts.noop, function (_affectedFileName, sourceFile) {
|
||||
if (sourceFile) {
|
||||
semanticDiagnosticsPerFile.delete(sourceFile.path);
|
||||
}
|
||||
});
|
||||
ts.Debug.assert(changedFilesSet.size === 0);
|
||||
var compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions.outFile || compilerOptions.out) {
|
||||
ts.Debug.assert(semanticDiagnosticsPerFile.size === 0);
|
||||
return program.getSemanticDiagnostics(undefined, cancellationToken);
|
||||
}
|
||||
var diagnostics;
|
||||
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
|
||||
var sourceFile = _a[_i];
|
||||
var path = sourceFile.path;
|
||||
var cachedDiagnostics = semanticDiagnosticsPerFile.get(path);
|
||||
if (cachedDiagnostics) {
|
||||
diagnostics = ts.addRange(diagnostics, cachedDiagnostics);
|
||||
}
|
||||
else {
|
||||
var cachedDiagnostics_1 = program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
||||
semanticDiagnosticsPerFile.set(path, cachedDiagnostics_1);
|
||||
diagnostics = ts.addRange(diagnostics, cachedDiagnostics_1);
|
||||
}
|
||||
diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken));
|
||||
}
|
||||
return diagnostics || ts.emptyArray;
|
||||
}
|
||||
function getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken) {
|
||||
var path = sourceFile.path;
|
||||
var cachedDiagnostics = semanticDiagnosticsPerFile.get(path);
|
||||
if (cachedDiagnostics) {
|
||||
return cachedDiagnostics;
|
||||
}
|
||||
var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
||||
semanticDiagnosticsPerFile.set(path, diagnostics);
|
||||
return diagnostics;
|
||||
}
|
||||
function clear() {
|
||||
isModuleEmit = undefined;
|
||||
emitHandler = undefined;
|
||||
fileInfos.clear();
|
||||
semanticDiagnosticsPerFile.clear();
|
||||
changedFileNames.clear();
|
||||
changedFilesSet.clear();
|
||||
hasShapeChanged.clear();
|
||||
}
|
||||
function containsOnlyAmbientModules(sourceFile) {
|
||||
for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) {
|
||||
@@ -56861,15 +56923,22 @@ var ts;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function updateShapeSignature(program, sourceFile, info) {
|
||||
function updateShapeSignature(program, sourceFile) {
|
||||
ts.Debug.assert(!!sourceFile);
|
||||
if (hasShapeChanged.has(sourceFile.path)) {
|
||||
return false;
|
||||
}
|
||||
hasShapeChanged.set(sourceFile.path, true);
|
||||
var info = fileInfos.get(sourceFile.path);
|
||||
ts.Debug.assert(!!info);
|
||||
var prevSignature = info.signature;
|
||||
var latestSignature;
|
||||
if (sourceFile.isDeclarationFile) {
|
||||
latestSignature = options.computeHash(sourceFile.text);
|
||||
latestSignature = sourceFile.version;
|
||||
info.signature = latestSignature;
|
||||
}
|
||||
else {
|
||||
var emitOutput = options.getEmitOutput(program, sourceFile, true, false);
|
||||
var emitOutput = getFileEmitOutput(program, sourceFile, true);
|
||||
if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) {
|
||||
latestSignature = options.computeHash(emitOutput.outputFiles[0].text);
|
||||
info.signature = latestSignature;
|
||||
@@ -56921,21 +56990,23 @@ var ts;
|
||||
referencedFiles.set(referencedPath, true);
|
||||
}
|
||||
}
|
||||
function getAllEmittableFiles(program, firstSourceFile) {
|
||||
var defaultLibraryFileName = ts.getDefaultLibFileName(program.getCompilerOptions());
|
||||
var sourceFiles = program.getSourceFiles();
|
||||
var result = [];
|
||||
add(firstSourceFile);
|
||||
for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {
|
||||
var sourceFile = sourceFiles_2[_i];
|
||||
function getAllFilesExcludingDefaultLibraryFile(program, firstSourceFile) {
|
||||
if (allFilesExcludingDefaultLibraryFile) {
|
||||
return allFilesExcludingDefaultLibraryFile;
|
||||
}
|
||||
var result;
|
||||
addSourceFile(firstSourceFile);
|
||||
for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) {
|
||||
var sourceFile = _a[_i];
|
||||
if (sourceFile !== firstSourceFile) {
|
||||
add(sourceFile);
|
||||
addSourceFile(sourceFile);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
function add(sourceFile) {
|
||||
if (ts.getBaseFileName(sourceFile.fileName) !== defaultLibraryFileName && options.shouldEmitFile(sourceFile)) {
|
||||
result.push(sourceFile.fileName);
|
||||
allFilesExcludingDefaultLibraryFile = result || ts.emptyArray;
|
||||
return allFilesExcludingDefaultLibraryFile;
|
||||
function addSourceFile(sourceFile) {
|
||||
if (!program.isSourceFileDefaultLibrary(sourceFile)) {
|
||||
(result || (result = [])).push(sourceFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56947,12 +57018,12 @@ var ts;
|
||||
onUpdateSourceFileWithSameVersion: ts.returnFalse,
|
||||
getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape
|
||||
};
|
||||
function getFilesAffectedByUpdatedShape(program, sourceFile, singleFileResult) {
|
||||
function getFilesAffectedByUpdatedShape(program, sourceFile) {
|
||||
var options = program.getCompilerOptions();
|
||||
if (options && (options.out || options.outFile)) {
|
||||
return singleFileResult;
|
||||
return [sourceFile];
|
||||
}
|
||||
return getAllEmittableFiles(program, sourceFile);
|
||||
return getAllFilesExcludingDefaultLibraryFile(program, sourceFile);
|
||||
}
|
||||
}
|
||||
function getModuleEmitHandler() {
|
||||
@@ -56997,7 +57068,7 @@ var ts;
|
||||
if (referencesInFile.has(removedFilePath)) {
|
||||
var referencedByInfo = fileInfos.get(filePath);
|
||||
if (referencedByInfo) {
|
||||
registerChangedFile(filePath, referencedByInfo.fileName);
|
||||
registerChangedFile(filePath);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -57009,29 +57080,26 @@ var ts;
|
||||
return referencesInFile.has(referencedFilePath) ? filePath : undefined;
|
||||
});
|
||||
}
|
||||
function getFilesAffectedByUpdatedShape(program, sourceFile, singleFileResult) {
|
||||
function getFilesAffectedByUpdatedShape(program, sourceFile) {
|
||||
if (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) {
|
||||
return getAllEmittableFiles(program, sourceFile);
|
||||
return getAllFilesExcludingDefaultLibraryFile(program, sourceFile);
|
||||
}
|
||||
var compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) {
|
||||
return singleFileResult;
|
||||
return [sourceFile];
|
||||
}
|
||||
var seenFileNamesMap = ts.createMap();
|
||||
var setSeenFileName = function (path, sourceFile) {
|
||||
seenFileNamesMap.set(path, sourceFile && options.shouldEmitFile(sourceFile) ? sourceFile.fileName : undefined);
|
||||
};
|
||||
var path = sourceFile.path;
|
||||
setSeenFileName(path, sourceFile);
|
||||
seenFileNamesMap.set(path, sourceFile);
|
||||
var queue = getReferencedByPaths(path);
|
||||
while (queue.length > 0) {
|
||||
var currentPath = queue.pop();
|
||||
if (!seenFileNamesMap.has(currentPath)) {
|
||||
var currentSourceFile = program.getSourceFileByPath(currentPath);
|
||||
if (currentSourceFile && updateShapeSignature(program, currentSourceFile, fileInfos.get(currentPath))) {
|
||||
seenFileNamesMap.set(currentPath, currentSourceFile);
|
||||
if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) {
|
||||
queue.push.apply(queue, getReferencedByPaths(currentPath));
|
||||
}
|
||||
setSeenFileName(currentPath, currentSourceFile);
|
||||
}
|
||||
}
|
||||
return ts.flatMapIter(seenFileNamesMap.values(), function (value) { return value; });
|
||||
@@ -57928,7 +57996,8 @@ var ts;
|
||||
}
|
||||
var typeChecker = getDiagnosticsProducingTypeChecker();
|
||||
ts.Debug.assert(!!sourceFile.bindDiagnostics);
|
||||
var includeBindAndCheckDiagnostics = !ts.isSourceFileJavaScript(sourceFile) || ts.isCheckJsEnabledForFile(sourceFile, options);
|
||||
var includeBindAndCheckDiagnostics = sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4 ||
|
||||
sourceFile.scriptKind === 5 || ts.isCheckJsEnabledForFile(sourceFile, options);
|
||||
var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
|
||||
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
|
||||
var fileProcessingDiagnosticsInFile = fileProcessingDiagnostics.getDiagnostics(sourceFile.fileName);
|
||||
@@ -58495,8 +58564,8 @@ var ts;
|
||||
}
|
||||
function computeCommonSourceDirectory(sourceFiles) {
|
||||
var fileNames = [];
|
||||
for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) {
|
||||
var file = sourceFiles_3[_i];
|
||||
for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) {
|
||||
var file = sourceFiles_2[_i];
|
||||
if (!file.isDeclarationFile) {
|
||||
fileNames.push(file.fileName);
|
||||
}
|
||||
@@ -58507,8 +58576,8 @@ var ts;
|
||||
var allFilesBelongToPath = true;
|
||||
if (sourceFiles) {
|
||||
var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory));
|
||||
for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) {
|
||||
var sourceFile = sourceFiles_4[_i];
|
||||
for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) {
|
||||
var sourceFile = sourceFiles_3[_i];
|
||||
if (!sourceFile.isDeclarationFile) {
|
||||
var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
||||
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
||||
@@ -58989,6 +59058,24 @@ var ts;
|
||||
function isNodeModulesDirectory(dirPath) {
|
||||
return ts.endsWith(dirPath, "/node_modules");
|
||||
}
|
||||
function isDirectoryAtleastAtLevelFromFSRoot(dirPath, minLevels) {
|
||||
for (var searchIndex = ts.getRootLength(dirPath); minLevels > 0; minLevels--) {
|
||||
searchIndex = dirPath.indexOf(ts.directorySeparator, searchIndex) + 1;
|
||||
if (searchIndex === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function canWatchDirectory(dirPath) {
|
||||
return isDirectoryAtleastAtLevelFromFSRoot(dirPath, dirPath.charCodeAt(0) === 47 ? 3 : 1);
|
||||
}
|
||||
function filterFSRootDirectoriesToWatch(watchPath, dirPath) {
|
||||
if (!canWatchDirectory(dirPath)) {
|
||||
watchPath.ignore = true;
|
||||
}
|
||||
return watchPath;
|
||||
}
|
||||
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) {
|
||||
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
|
||||
return { dir: rootDir, dirPath: rootPath };
|
||||
@@ -59000,7 +59087,7 @@ var ts;
|
||||
dirPath = ts.getDirectoryPath(dirPath);
|
||||
}
|
||||
if (isNodeModulesDirectory(dirPath)) {
|
||||
return { dir: dir, dirPath: dirPath };
|
||||
return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, ts.getDirectoryPath(dirPath));
|
||||
}
|
||||
if (rootPath !== undefined) {
|
||||
while (!isInDirectoryPath(dirPath, rootPath)) {
|
||||
@@ -59012,7 +59099,7 @@ var ts;
|
||||
dir = ts.getDirectoryPath(dir);
|
||||
}
|
||||
}
|
||||
return { dir: dir, dirPath: dirPath };
|
||||
return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, dirPath);
|
||||
}
|
||||
function isPathWithDefaultFailedLookupExtension(path) {
|
||||
return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
|
||||
@@ -59042,13 +59129,15 @@ var ts;
|
||||
var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
|
||||
customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
|
||||
}
|
||||
var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _b.dir, dirPath = _b.dirPath;
|
||||
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
if (dirWatcher) {
|
||||
dirWatcher.refCount++;
|
||||
}
|
||||
else {
|
||||
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
|
||||
var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _b.dir, dirPath = _b.dirPath, ignore = _b.ignore;
|
||||
if (!ignore) {
|
||||
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
if (dirWatcher) {
|
||||
dirWatcher.refCount++;
|
||||
}
|
||||
else {
|
||||
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59072,9 +59161,11 @@ var ts;
|
||||
customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1);
|
||||
}
|
||||
}
|
||||
var dirPath = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath).dirPath;
|
||||
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
dirWatcher.refCount--;
|
||||
var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _b.dirPath, ignore = _b.ignore;
|
||||
if (!ignore) {
|
||||
var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
dirWatcher.refCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
function createDirectoryWatcher(directory, dirPath) {
|
||||
@@ -59176,7 +59267,7 @@ var ts;
|
||||
closeTypeRootsWatch();
|
||||
return;
|
||||
}
|
||||
var typeRoots = ts.getEffectiveTypeRoots(options, { directoryExists: ts.returnTrue, getCurrentDirectory: getCurrentDirectory });
|
||||
var typeRoots = ts.getEffectiveTypeRoots(options, { directoryExists: directoryExistsForTypeRootWatch, getCurrentDirectory: getCurrentDirectory });
|
||||
if (typeRoots) {
|
||||
ts.mutateMap(typeRootsWatches, ts.arrayToMap(typeRoots, function (tr) { return resolutionHost.toPath(tr); }), {
|
||||
createNewValue: createTypeRootsWatch,
|
||||
@@ -59187,6 +59278,11 @@ var ts;
|
||||
closeTypeRootsWatch();
|
||||
}
|
||||
}
|
||||
function directoryExistsForTypeRootWatch(nodeTypesDirectory) {
|
||||
var dir = ts.getDirectoryPath(ts.getDirectoryPath(nodeTypesDirectory));
|
||||
var dirPath = resolutionHost.toPath(dir);
|
||||
return dirPath === rootPath || canWatchDirectory(dirPath);
|
||||
}
|
||||
}
|
||||
ts.createResolutionCache = createResolutionCache;
|
||||
})(ts || (ts = {}));
|
||||
@@ -59304,7 +59400,8 @@ var ts;
|
||||
var diagnostics = program.getSyntacticDiagnostics().slice();
|
||||
var reportSemanticDiagnostics = false;
|
||||
if (diagnostics.length === 0) {
|
||||
diagnostics = program.getOptionsDiagnostics().concat(program.getGlobalDiagnostics());
|
||||
ts.addRange(diagnostics, program.getOptionsDiagnostics());
|
||||
ts.addRange(diagnostics, program.getGlobalDiagnostics());
|
||||
if (diagnostics.length === 0) {
|
||||
reportSemanticDiagnostics = true;
|
||||
}
|
||||
@@ -59312,7 +59409,7 @@ var ts;
|
||||
var emittedFiles = program.getCompilerOptions().listEmittedFiles ? [] : undefined;
|
||||
var sourceMaps;
|
||||
var emitSkipped;
|
||||
var result = builder.emitChangedFiles(program);
|
||||
var result = builder.emitChangedFiles(program, writeFile);
|
||||
if (result.length === 0) {
|
||||
emitSkipped = true;
|
||||
}
|
||||
@@ -59322,13 +59419,12 @@ var ts;
|
||||
if (emitOutput.emitSkipped) {
|
||||
emitSkipped = true;
|
||||
}
|
||||
diagnostics = ts.concatenate(diagnostics, emitOutput.diagnostics);
|
||||
ts.addRange(diagnostics, emitOutput.diagnostics);
|
||||
sourceMaps = ts.concatenate(sourceMaps, emitOutput.sourceMaps);
|
||||
writeOutputFiles(emitOutput.outputFiles);
|
||||
}
|
||||
}
|
||||
if (reportSemanticDiagnostics) {
|
||||
diagnostics = diagnostics.concat(builder.getSemanticDiagnostics(program));
|
||||
ts.addRange(diagnostics, builder.getSemanticDiagnostics(program));
|
||||
}
|
||||
return handleEmitOutputAndReportErrors(host, program, emittedFiles, emitSkipped, diagnostics, reportDiagnostic);
|
||||
function ensureDirectoriesExist(directoryPath) {
|
||||
@@ -59338,29 +59434,20 @@ var ts;
|
||||
host.createDirectory(directoryPath);
|
||||
}
|
||||
}
|
||||
function writeFile(fileName, data, writeByteOrderMark) {
|
||||
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
||||
try {
|
||||
ts.performance.mark("beforeIOWrite");
|
||||
ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName)));
|
||||
host.writeFile(fileName, data, writeByteOrderMark);
|
||||
host.writeFile(fileName, text, writeByteOrderMark);
|
||||
ts.performance.mark("afterIOWrite");
|
||||
ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
|
||||
if (emittedFiles) {
|
||||
emittedFiles.push(fileName);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
return ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, e);
|
||||
}
|
||||
}
|
||||
function writeOutputFiles(outputFiles) {
|
||||
if (outputFiles) {
|
||||
for (var _i = 0, outputFiles_1 = outputFiles; _i < outputFiles_1.length; _i++) {
|
||||
var outputFile = outputFiles_1[_i];
|
||||
var error = writeFile(outputFile.name, outputFile.text, outputFile.writeByteOrderMark);
|
||||
if (error) {
|
||||
diagnostics.push(error);
|
||||
}
|
||||
if (emittedFiles) {
|
||||
emittedFiles.push(outputFile.name);
|
||||
}
|
||||
if (onError) {
|
||||
onError(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59437,7 +59524,7 @@ var ts;
|
||||
var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ?
|
||||
ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, getCurrentDirectory())) :
|
||||
getCurrentDirectory());
|
||||
var builder = ts.createBuilder({ getCanonicalFileName: getCanonicalFileName, getEmitOutput: ts.getFileEmitOutput, computeHash: computeHash, shouldEmitFile: function () { return true; } });
|
||||
var builder = ts.createBuilder({ getCanonicalFileName: getCanonicalFileName, computeHash: computeHash });
|
||||
synchronizeProgram();
|
||||
watchConfigFileWildCardDirectories();
|
||||
return function () { return program; };
|
||||
@@ -59658,18 +59745,24 @@ var ts;
|
||||
return watchDirectory(directory, function (fileOrDirectory) {
|
||||
ts.Debug.assert(!!configFileName);
|
||||
var fileOrDirectoryPath = toPath(fileOrDirectory);
|
||||
directoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
removeSourceFile(fileOrDirectoryPath);
|
||||
var result = directoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
var hostSourceFile = sourceFilesCache.get(fileOrDirectoryPath);
|
||||
if (hostSourceFile && !ts.isString(hostSourceFile) && (result ? result.fileExists : directoryStructureHost.fileExists(fileOrDirectory))) {
|
||||
hostSourceFile.version++;
|
||||
}
|
||||
else {
|
||||
removeSourceFile(fileOrDirectoryPath);
|
||||
}
|
||||
if (fileOrDirectoryPath !== directory && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) {
|
||||
writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
|
||||
return;
|
||||
}
|
||||
if (!needsReload) {
|
||||
var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getDirectoryPath(configFileName), compilerOptions, directoryStructureHost);
|
||||
if (!configFileSpecs.filesSpecs && result.fileNames.length === 0) {
|
||||
var result_6 = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getDirectoryPath(configFileName), compilerOptions, directoryStructureHost);
|
||||
if (!configFileSpecs.filesSpecs && result_6.fileNames.length === 0) {
|
||||
reportDiagnostic(ts.getErrorForNoInputFiles(configFileSpecs, configFileName));
|
||||
}
|
||||
rootFileNames = result.fileNames;
|
||||
rootFileNames = result_6.fileNames;
|
||||
scheduleProgramUpdate();
|
||||
}
|
||||
}, flags);
|
||||
@@ -60701,7 +60794,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function isDoubleQuotedString(node) {
|
||||
return node.kind === 9 && ts.getSourceTextOfNodeFromSourceFile(sourceFile, node).charCodeAt(0) === 34;
|
||||
return ts.isStringLiteral(node) && ts.isStringDoubleQuoted(node, sourceFile);
|
||||
}
|
||||
}
|
||||
function getCompilerOptionValueTypeString(option) {
|
||||
@@ -60896,9 +60989,9 @@ var ts;
|
||||
};
|
||||
function getFileNames() {
|
||||
var filesSpecs;
|
||||
if (ts.hasProperty(raw, "files") && !isNullOrUndefined(raw["files"])) {
|
||||
if (ts.isArray(raw["files"])) {
|
||||
filesSpecs = raw["files"];
|
||||
if (ts.hasProperty(raw, "files") && !isNullOrUndefined(raw.files)) {
|
||||
if (ts.isArray(raw.files)) {
|
||||
filesSpecs = raw.files;
|
||||
if (filesSpecs.length === 0) {
|
||||
createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json");
|
||||
}
|
||||
@@ -60908,25 +61001,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
var includeSpecs;
|
||||
if (ts.hasProperty(raw, "include") && !isNullOrUndefined(raw["include"])) {
|
||||
if (ts.isArray(raw["include"])) {
|
||||
includeSpecs = raw["include"];
|
||||
if (ts.hasProperty(raw, "include") && !isNullOrUndefined(raw.include)) {
|
||||
if (ts.isArray(raw.include)) {
|
||||
includeSpecs = raw.include;
|
||||
}
|
||||
else {
|
||||
createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array");
|
||||
}
|
||||
}
|
||||
var excludeSpecs;
|
||||
if (ts.hasProperty(raw, "exclude") && !isNullOrUndefined(raw["exclude"])) {
|
||||
if (ts.isArray(raw["exclude"])) {
|
||||
excludeSpecs = raw["exclude"];
|
||||
if (ts.hasProperty(raw, "exclude") && !isNullOrUndefined(raw.exclude)) {
|
||||
if (ts.isArray(raw.exclude)) {
|
||||
excludeSpecs = raw.exclude;
|
||||
}
|
||||
else {
|
||||
createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array");
|
||||
}
|
||||
}
|
||||
else {
|
||||
var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"];
|
||||
var outDir = raw.compilerOptions && raw.compilerOptions.outDir;
|
||||
if (outDir) {
|
||||
excludeSpecs = [outDir];
|
||||
}
|
||||
@@ -60996,7 +61089,7 @@ var ts;
|
||||
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
|
||||
}
|
||||
var options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName);
|
||||
var typeAcquisition = convertTypeAcquisitionFromJsonWorker(json["typeAcquisition"] || json["typingOptions"], basePath, errors, configFileName);
|
||||
var typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName);
|
||||
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
||||
var extendedConfigPath;
|
||||
if (json.extends) {
|
||||
@@ -61112,7 +61205,7 @@ var ts;
|
||||
if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
|
||||
return undefined;
|
||||
}
|
||||
var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
|
||||
var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors);
|
||||
if (typeof result === "boolean" && result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
+1274
-788
File diff suppressed because it is too large
Load Diff
Vendored
+95
-54
@@ -2158,6 +2158,7 @@ declare namespace ts {
|
||||
interface JsFileExtensionInfo {
|
||||
extension: string;
|
||||
isMixedContent: boolean;
|
||||
scriptKind?: ScriptKind;
|
||||
}
|
||||
interface DiagnosticMessage {
|
||||
key: string;
|
||||
@@ -3207,10 +3208,11 @@ declare namespace ts {
|
||||
};
|
||||
}
|
||||
declare namespace ts {
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: {
|
||||
directoryExists?: (directoryName: string) => boolean;
|
||||
getCurrentDirectory?: () => string;
|
||||
}): string[] | undefined;
|
||||
interface GetEffectiveTypeRootsHost {
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
@@ -3729,17 +3731,11 @@ declare namespace ts {
|
||||
outputFiles: OutputFile[];
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
interface EmitOutputDetailed extends EmitOutput {
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
emittedSourceFiles: SourceFile[];
|
||||
}
|
||||
interface OutputFile {
|
||||
name: string;
|
||||
writeByteOrderMark: boolean;
|
||||
text: string;
|
||||
}
|
||||
function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput | EmitOutputDetailed;
|
||||
}
|
||||
declare namespace ts {
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
|
||||
@@ -3868,7 +3864,11 @@ declare namespace ts {
|
||||
interface HostCancellationToken {
|
||||
isCancellationRequested(): boolean;
|
||||
}
|
||||
interface LanguageServiceHost {
|
||||
interface InstallPackageOptions {
|
||||
fileName: Path;
|
||||
packageName: string;
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
getCompilationSettings(): CompilerOptions;
|
||||
getNewLine?(): string;
|
||||
getProjectVersion?(): string;
|
||||
@@ -3890,12 +3890,13 @@ declare namespace ts {
|
||||
getTypeRootsVersion?(): number;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[];
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getDirectories?(directoryName: string): string[];
|
||||
/**
|
||||
* Gets a set of custom transformers to use during emit.
|
||||
*/
|
||||
getCustomTransformers?(): CustomTransformers | undefined;
|
||||
isKnownTypesPackageName?(name: string): boolean;
|
||||
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
||||
}
|
||||
interface LanguageService {
|
||||
cleanupSemanticCache(): void;
|
||||
@@ -3913,7 +3914,7 @@ declare namespace ts {
|
||||
getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getCompletionsAtPosition(fileName: string, position: number): CompletionInfo;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options?: FormatCodeOptions | FormatCodeSettings): CompletionEntryDetails;
|
||||
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol;
|
||||
getQuickInfoAtPosition(fileName: string, position: number): QuickInfo;
|
||||
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan;
|
||||
@@ -3943,13 +3944,16 @@ declare namespace ts {
|
||||
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
|
||||
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
|
||||
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
|
||||
applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
|
||||
getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[];
|
||||
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, isDetailed?: boolean): EmitOutput | EmitOutputDetailed;
|
||||
getProgram(): Program;
|
||||
dispose(): void;
|
||||
}
|
||||
interface ApplyCodeActionCommandResult {
|
||||
successMessage: string;
|
||||
}
|
||||
interface Classifications {
|
||||
spans: number[];
|
||||
endOfLineState: EndOfLineState;
|
||||
@@ -4014,6 +4018,14 @@ declare namespace ts {
|
||||
description: string;
|
||||
/** Text changes to apply to each file as part of the code action */
|
||||
changes: FileTextChanges[];
|
||||
/**
|
||||
* If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
|
||||
* This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
|
||||
*/
|
||||
commands?: CodeActionCommand[];
|
||||
}
|
||||
type CodeActionCommand = InstallPackageAction;
|
||||
interface InstallPackageAction {
|
||||
}
|
||||
/**
|
||||
* A set of one or more available refactoring actions, grouped under a parent refactoring.
|
||||
@@ -4062,6 +4074,7 @@ declare namespace ts {
|
||||
edits: FileTextChanges[];
|
||||
renameFilename: string | undefined;
|
||||
renameLocation: number | undefined;
|
||||
commands?: CodeActionCommand[];
|
||||
}
|
||||
interface TextInsertion {
|
||||
newText: string;
|
||||
@@ -4281,6 +4294,7 @@ declare namespace ts {
|
||||
* be used in that case
|
||||
*/
|
||||
replacementSpan?: TextSpan;
|
||||
hasAction?: true;
|
||||
}
|
||||
interface CompletionEntryDetails {
|
||||
name: string;
|
||||
@@ -4289,6 +4303,7 @@ declare namespace ts {
|
||||
displayParts: SymbolDisplayPart[];
|
||||
documentation: SymbolDisplayPart[];
|
||||
tags: JSDocTagInfo[];
|
||||
codeActions?: CodeAction[];
|
||||
}
|
||||
interface OutliningSpan {
|
||||
/** The span of the document to actually collapse. */
|
||||
@@ -4630,11 +4645,10 @@ declare namespace ts.server {
|
||||
interface SortedReadonlyArray<T> extends ReadonlyArray<T> {
|
||||
" __sortedArrayBrand": any;
|
||||
}
|
||||
interface TypingInstallerRequest {
|
||||
interface TypingInstallerRequestWithProjectName {
|
||||
readonly projectName: string;
|
||||
readonly kind: "discover" | "closeProject";
|
||||
}
|
||||
interface DiscoverTypings extends TypingInstallerRequest {
|
||||
interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
|
||||
readonly fileNames: string[];
|
||||
readonly projectRootPath: Path;
|
||||
readonly compilerOptions: CompilerOptions;
|
||||
@@ -4643,16 +4657,27 @@ declare namespace ts.server {
|
||||
readonly cachePath?: string;
|
||||
readonly kind: "discover";
|
||||
}
|
||||
interface CloseProject extends TypingInstallerRequest {
|
||||
interface CloseProject extends TypingInstallerRequestWithProjectName {
|
||||
readonly kind: "closeProject";
|
||||
}
|
||||
interface TypesRegistryRequest {
|
||||
readonly kind: "typesRegistry";
|
||||
}
|
||||
interface InstallPackageRequest {
|
||||
readonly kind: "installPackage";
|
||||
readonly fileName: Path;
|
||||
readonly packageName: string;
|
||||
readonly projectRootPath: Path;
|
||||
}
|
||||
type ActionSet = "action::set";
|
||||
type ActionInvalidate = "action::invalidate";
|
||||
type EventTypesRegistry = "event::typesRegistry";
|
||||
type EventPackageInstalled = "event::packageInstalled";
|
||||
type EventBeginInstallTypes = "event::beginInstallTypes";
|
||||
type EventEndInstallTypes = "event::endInstallTypes";
|
||||
type EventInitializationFailed = "event::initializationFailed";
|
||||
interface TypingInstallerResponse {
|
||||
readonly kind: ActionSet | ActionInvalidate | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
||||
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | EventPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
||||
}
|
||||
interface InitializationFailedResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventInitializationFailed;
|
||||
@@ -4688,6 +4713,8 @@ declare namespace ts.server {
|
||||
declare namespace ts.server {
|
||||
const ActionSet: ActionSet;
|
||||
const ActionInvalidate: ActionInvalidate;
|
||||
const EventTypesRegistry: EventTypesRegistry;
|
||||
const EventPackageInstalled: EventPackageInstalled;
|
||||
const EventBeginInstallTypes: EventBeginInstallTypes;
|
||||
const EventEndInstallTypes: EventEndInstallTypes;
|
||||
const EventInitializationFailed: EventInitializationFailed;
|
||||
@@ -4825,6 +4852,7 @@ declare namespace ts.server.protocol {
|
||||
DocCommentTemplate = "docCommentTemplate",
|
||||
CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
|
||||
GetCodeFixes = "getCodeFixes",
|
||||
ApplyCodeActionCommand = "applyCodeActionCommand",
|
||||
GetSupportedCodeFixes = "getSupportedCodeFixes",
|
||||
GetApplicableRefactors = "getApplicableRefactors",
|
||||
GetEditsForRefactor = "getEditsForRefactor",
|
||||
@@ -4846,6 +4874,7 @@ declare namespace ts.server.protocol {
|
||||
* Client-initiated request message
|
||||
*/
|
||||
interface Request extends Message {
|
||||
type: "request";
|
||||
/**
|
||||
* The command to execute
|
||||
*/
|
||||
@@ -4865,6 +4894,7 @@ declare namespace ts.server.protocol {
|
||||
* Server-initiated event message
|
||||
*/
|
||||
interface Event extends Message {
|
||||
type: "event";
|
||||
/**
|
||||
* Name of event
|
||||
*/
|
||||
@@ -4878,6 +4908,7 @@ declare namespace ts.server.protocol {
|
||||
* Response by server to client request message.
|
||||
*/
|
||||
interface Response extends Message {
|
||||
type: "response";
|
||||
/**
|
||||
* Sequence number of the request message.
|
||||
*/
|
||||
@@ -4891,7 +4922,8 @@ declare namespace ts.server.protocol {
|
||||
*/
|
||||
command: string;
|
||||
/**
|
||||
* Contains error message if success === false.
|
||||
* If success === false, this should always be provided.
|
||||
* Otherwise, may (or may not) contain a success message.
|
||||
*/
|
||||
message?: string;
|
||||
/**
|
||||
@@ -5167,6 +5199,12 @@ declare namespace ts.server.protocol {
|
||||
command: CommandTypes.GetCodeFixes;
|
||||
arguments: CodeFixRequestArgs;
|
||||
}
|
||||
interface ApplyCodeActionCommandRequest extends Request {
|
||||
command: CommandTypes.ApplyCodeActionCommand;
|
||||
arguments: ApplyCodeActionCommandRequestArgs;
|
||||
}
|
||||
interface ApplyCodeActionCommandResponse extends Response {
|
||||
}
|
||||
interface FileRangeRequestArgs extends FileRequestArgs {
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
@@ -5194,6 +5232,9 @@ declare namespace ts.server.protocol {
|
||||
*/
|
||||
errorCodes?: number[];
|
||||
}
|
||||
interface ApplyCodeActionCommandRequestArgs extends FileRequestArgs {
|
||||
command: {};
|
||||
}
|
||||
/**
|
||||
* Response for GetCodeFixes request.
|
||||
*/
|
||||
@@ -5932,6 +5973,8 @@ declare namespace ts.server.protocol {
|
||||
description: string;
|
||||
/** Text changes to apply to each file as part of the code action */
|
||||
changes: FileCodeEdits[];
|
||||
/** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
|
||||
commands?: {}[];
|
||||
}
|
||||
/**
|
||||
* Format and format on key response message.
|
||||
@@ -6038,6 +6081,11 @@ declare namespace ts.server.protocol {
|
||||
* this span should be used instead of the default one.
|
||||
*/
|
||||
replacementSpan?: TextSpan;
|
||||
/**
|
||||
* Indicates whether commiting this completion entry will require additional code actions to be
|
||||
* made to avoid errors. The CompletionEntryDetails will have these actions.
|
||||
*/
|
||||
hasAction?: true;
|
||||
}
|
||||
/**
|
||||
* Additional completion entry details, available on demand
|
||||
@@ -6067,6 +6115,10 @@ declare namespace ts.server.protocol {
|
||||
* JSDoc tags for the symbol.
|
||||
*/
|
||||
tags: JSDocTagInfo[];
|
||||
/**
|
||||
* The associated code actions for this entry
|
||||
*/
|
||||
codeActions?: CodeAction[];
|
||||
}
|
||||
interface CompletionsResponse extends Response {
|
||||
body?: CompletionEntry[];
|
||||
@@ -6840,6 +6892,7 @@ declare namespace ts.server {
|
||||
send(msg: protocol.Message): void;
|
||||
event<T>(info: T, eventName: string): void;
|
||||
output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void;
|
||||
private doOutput(info, cmdName, reqSeq, success, message?);
|
||||
private semanticCheck(file, project);
|
||||
private syntacticCheck(file, project);
|
||||
private updateErrorCheck(next, checkList, ms, requireOpen?);
|
||||
@@ -6915,8 +6968,9 @@ declare namespace ts.server {
|
||||
private getApplicableRefactors(args);
|
||||
private getEditsForRefactor(args, simplifiedResult);
|
||||
private getCodeFixes(args, simplifiedResult);
|
||||
private applyCodeActionCommand(commandName, requestSeq, args);
|
||||
private getStartAndEndPosition(args, scriptInfo);
|
||||
private mapCodeAction(codeAction, scriptInfo);
|
||||
private mapCodeAction({description, changes: unmappedChanges, commands}, scriptInfo);
|
||||
private mapTextChangesToCodeEdits(project, textChanges);
|
||||
private convertTextChangeToCodeEdit(change, scriptInfo);
|
||||
private getBraceMatching(args, simplifiedResult);
|
||||
@@ -6926,19 +6980,17 @@ declare namespace ts.server {
|
||||
private notRequired();
|
||||
private requiredResponse(response);
|
||||
private handlers;
|
||||
addProtocolHandler(command: string, handler: (request: protocol.Request) => {
|
||||
response?: any;
|
||||
responseRequired: boolean;
|
||||
}): void;
|
||||
addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse): void;
|
||||
private setCurrentRequest(requestId);
|
||||
private resetCurrentRequest(requestId);
|
||||
executeWithRequestId<T>(requestId: number, f: () => T): T;
|
||||
executeCommand(request: protocol.Request): {
|
||||
response?: any;
|
||||
responseRequired?: boolean;
|
||||
};
|
||||
executeCommand(request: protocol.Request): HandlerResponse;
|
||||
onMessage(message: string): void;
|
||||
}
|
||||
interface HandlerResponse {
|
||||
response?: {};
|
||||
responseRequired?: boolean;
|
||||
}
|
||||
}
|
||||
declare namespace ts.server {
|
||||
class ScriptInfo {
|
||||
@@ -6985,25 +7037,13 @@ declare namespace ts.server {
|
||||
isJavaScript(): boolean;
|
||||
}
|
||||
}
|
||||
declare namespace ts {
|
||||
/**
|
||||
* Updates the existing missing file watches with the new set of missing files after new program is created
|
||||
*/
|
||||
function updateMissingFilePathsWatch(program: Program, missingFileWatches: Map<FileWatcher>, createMissingFileWatch: (missingFilePath: Path) => FileWatcher): void;
|
||||
interface WildcardDirectoryWatcher {
|
||||
watcher: FileWatcher;
|
||||
flags: WatchDirectoryFlags;
|
||||
}
|
||||
/**
|
||||
* Updates the existing wild card directory watches with the new set of wild card directories from the config file
|
||||
* after new program is created because the config file was reloaded or program was created first time from the config file
|
||||
* Note that there is no need to call this function when the program is updated with additional files without reloading config files,
|
||||
* as wildcard directories wont change unless reloading config file
|
||||
*/
|
||||
function updateWatchingWildcardDirectories(existingWatchedForWildcards: Map<WildcardDirectoryWatcher>, wildcardDirectories: Map<WatchDirectoryFlags>, watchDirectory: (directory: string, flags: WatchDirectoryFlags) => FileWatcher): void;
|
||||
}
|
||||
declare namespace ts.server {
|
||||
interface InstallPackageOptionsWithProjectRootPath extends InstallPackageOptions {
|
||||
projectRootPath: Path;
|
||||
}
|
||||
interface ITypingsInstaller {
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptionsWithProjectRootPath): Promise<ApplyCodeActionCommandResult>;
|
||||
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>): void;
|
||||
attach(projectService: ProjectService): void;
|
||||
onProjectClosed(p: Project): void;
|
||||
@@ -7014,6 +7054,8 @@ declare namespace ts.server {
|
||||
private readonly installer;
|
||||
private readonly perProjectCache;
|
||||
constructor(installer: ITypingsInstaller);
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptionsWithProjectRootPath): Promise<ApplyCodeActionCommandResult>;
|
||||
getTypingsForProject(project: Project, unresolvedImports: SortedReadonlyArray<string>, forceRefresh: boolean): SortedReadonlyArray<string>;
|
||||
updateTypingsForProject(projectName: string, compilerOptions: CompilerOptions, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, newTypings: string[]): void;
|
||||
deleteTypingsForProject(projectName: string): void;
|
||||
@@ -7108,6 +7150,9 @@ declare namespace ts.server {
|
||||
isJsOnlyProject(): boolean;
|
||||
getCachedUnresolvedImportsPerFile_TestOnly(): UnresolvedImportsMap;
|
||||
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {};
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
||||
private readonly typingsCache;
|
||||
getCompilationSettings(): CompilerOptions;
|
||||
getCompilerOptions(): CompilerOptions;
|
||||
getNewLine(): string;
|
||||
@@ -7136,6 +7181,7 @@ declare namespace ts.server {
|
||||
getAllProjectErrors(): ReadonlyArray<Diagnostic>;
|
||||
getLanguageService(ensureSynchronized?: boolean): LanguageService;
|
||||
private ensureBuilder();
|
||||
private shouldEmitFile(scriptInfo);
|
||||
getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[];
|
||||
/**
|
||||
* Returns true if emit was conducted
|
||||
@@ -7154,7 +7200,6 @@ declare namespace ts.server {
|
||||
getRootFiles(): NormalizedPath[];
|
||||
getRootScriptInfos(): ScriptInfo[];
|
||||
getScriptInfos(): ScriptInfo[];
|
||||
private getFileEmitOutput(sourceFile, emitOnlyDtsFiles, isDetailed);
|
||||
getExcludedFiles(): ReadonlyArray<NormalizedPath>;
|
||||
getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean): NormalizedPath[];
|
||||
hasConfigFile(configFilePath: NormalizedPath): boolean;
|
||||
@@ -7212,8 +7257,8 @@ declare namespace ts.server {
|
||||
private directoriesWatchedForWildcards;
|
||||
readonly canonicalConfigFilePath: NormalizedPath;
|
||||
private plugins;
|
||||
/** Used for configured projects which may have multiple open roots */
|
||||
openRefCount: number;
|
||||
/** Ref count to the project when opened from external project */
|
||||
private externalProjectRefCount;
|
||||
private projectErrors;
|
||||
/**
|
||||
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
|
||||
@@ -7237,9 +7282,6 @@ declare namespace ts.server {
|
||||
getTypeAcquisition(): TypeAcquisition;
|
||||
getExternalFiles(): SortedReadonlyArray<string>;
|
||||
close(): void;
|
||||
addOpenRef(): void;
|
||||
deleteOpenRef(): number;
|
||||
hasOpenRef(): boolean;
|
||||
getEffectiveTypeRoots(): string[];
|
||||
}
|
||||
/**
|
||||
@@ -7469,7 +7511,6 @@ declare namespace ts.server {
|
||||
*/
|
||||
private onConfigFileChangeForOpenScriptInfo(configFileName, eventKind);
|
||||
private removeProject(project);
|
||||
private addToListOfOpenFiles(info);
|
||||
/**
|
||||
* Remove this file from the set of open, non-configured files.
|
||||
* @param info The file that has been closed or newly configured
|
||||
@@ -7577,7 +7618,7 @@ declare namespace ts.server {
|
||||
*/
|
||||
closeClientFile(uncheckedFileName: string): void;
|
||||
private collectChanges(lastKnownProjectVersions, currentProjects, result);
|
||||
private closeConfiguredProject(configFile);
|
||||
private closeConfiguredProjectReferencedFromExternalProject(configFile);
|
||||
closeExternalProject(uncheckedFileName: string, suppressRefresh?: boolean): void;
|
||||
openExternalProjects(projects: protocol.ExternalProject[]): void;
|
||||
/** Makes a filename safe to insert in a RegExp */
|
||||
|
||||
+1365
-871
File diff suppressed because it is too large
Load Diff
Vendored
+29
-14
@@ -2158,6 +2158,7 @@ declare namespace ts {
|
||||
interface JsFileExtensionInfo {
|
||||
extension: string;
|
||||
isMixedContent: boolean;
|
||||
scriptKind?: ScriptKind;
|
||||
}
|
||||
interface DiagnosticMessage {
|
||||
key: string;
|
||||
@@ -3154,10 +3155,11 @@ declare namespace ts {
|
||||
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
}
|
||||
declare namespace ts {
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: {
|
||||
directoryExists?: (directoryName: string) => boolean;
|
||||
getCurrentDirectory?: () => string;
|
||||
}): string[] | undefined;
|
||||
interface GetEffectiveTypeRootsHost {
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
@@ -3676,17 +3678,11 @@ declare namespace ts {
|
||||
outputFiles: OutputFile[];
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
interface EmitOutputDetailed extends EmitOutput {
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
emittedSourceFiles: SourceFile[];
|
||||
}
|
||||
interface OutputFile {
|
||||
name: string;
|
||||
writeByteOrderMark: boolean;
|
||||
text: string;
|
||||
}
|
||||
function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput | EmitOutputDetailed;
|
||||
}
|
||||
declare namespace ts {
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
|
||||
@@ -3868,7 +3864,11 @@ declare namespace ts {
|
||||
interface HostCancellationToken {
|
||||
isCancellationRequested(): boolean;
|
||||
}
|
||||
interface LanguageServiceHost {
|
||||
interface InstallPackageOptions {
|
||||
fileName: Path;
|
||||
packageName: string;
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
getCompilationSettings(): CompilerOptions;
|
||||
getNewLine?(): string;
|
||||
getProjectVersion?(): string;
|
||||
@@ -3890,12 +3890,13 @@ declare namespace ts {
|
||||
getTypeRootsVersion?(): number;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[];
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getDirectories?(directoryName: string): string[];
|
||||
/**
|
||||
* Gets a set of custom transformers to use during emit.
|
||||
*/
|
||||
getCustomTransformers?(): CustomTransformers | undefined;
|
||||
isKnownTypesPackageName?(name: string): boolean;
|
||||
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
||||
}
|
||||
interface LanguageService {
|
||||
cleanupSemanticCache(): void;
|
||||
@@ -3913,7 +3914,7 @@ declare namespace ts {
|
||||
getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getCompletionsAtPosition(fileName: string, position: number): CompletionInfo;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options?: FormatCodeOptions | FormatCodeSettings): CompletionEntryDetails;
|
||||
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol;
|
||||
getQuickInfoAtPosition(fileName: string, position: number): QuickInfo;
|
||||
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan;
|
||||
@@ -3943,13 +3944,16 @@ declare namespace ts {
|
||||
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
|
||||
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
|
||||
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
|
||||
applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
|
||||
getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[];
|
||||
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, isDetailed?: boolean): EmitOutput | EmitOutputDetailed;
|
||||
getProgram(): Program;
|
||||
dispose(): void;
|
||||
}
|
||||
interface ApplyCodeActionCommandResult {
|
||||
successMessage: string;
|
||||
}
|
||||
interface Classifications {
|
||||
spans: number[];
|
||||
endOfLineState: EndOfLineState;
|
||||
@@ -4014,6 +4018,14 @@ declare namespace ts {
|
||||
description: string;
|
||||
/** Text changes to apply to each file as part of the code action */
|
||||
changes: FileTextChanges[];
|
||||
/**
|
||||
* If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
|
||||
* This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
|
||||
*/
|
||||
commands?: CodeActionCommand[];
|
||||
}
|
||||
type CodeActionCommand = InstallPackageAction;
|
||||
interface InstallPackageAction {
|
||||
}
|
||||
/**
|
||||
* A set of one or more available refactoring actions, grouped under a parent refactoring.
|
||||
@@ -4062,6 +4074,7 @@ declare namespace ts {
|
||||
edits: FileTextChanges[];
|
||||
renameFilename: string | undefined;
|
||||
renameLocation: number | undefined;
|
||||
commands?: CodeActionCommand[];
|
||||
}
|
||||
interface TextInsertion {
|
||||
newText: string;
|
||||
@@ -4281,6 +4294,7 @@ declare namespace ts {
|
||||
* be used in that case
|
||||
*/
|
||||
replacementSpan?: TextSpan;
|
||||
hasAction?: true;
|
||||
}
|
||||
interface CompletionEntryDetails {
|
||||
name: string;
|
||||
@@ -4289,6 +4303,7 @@ declare namespace ts {
|
||||
displayParts: SymbolDisplayPart[];
|
||||
documentation: SymbolDisplayPart[];
|
||||
tags: JSDocTagInfo[];
|
||||
codeActions?: CodeAction[];
|
||||
}
|
||||
interface OutliningSpan {
|
||||
/** The span of the document to actually collapse. */
|
||||
|
||||
+1123
-762
File diff suppressed because it is too large
Load Diff
Vendored
+29
-14
@@ -2158,6 +2158,7 @@ declare namespace ts {
|
||||
interface JsFileExtensionInfo {
|
||||
extension: string;
|
||||
isMixedContent: boolean;
|
||||
scriptKind?: ScriptKind;
|
||||
}
|
||||
interface DiagnosticMessage {
|
||||
key: string;
|
||||
@@ -3154,10 +3155,11 @@ declare namespace ts {
|
||||
function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
|
||||
}
|
||||
declare namespace ts {
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: {
|
||||
directoryExists?: (directoryName: string) => boolean;
|
||||
getCurrentDirectory?: () => string;
|
||||
}): string[] | undefined;
|
||||
interface GetEffectiveTypeRootsHost {
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined;
|
||||
/**
|
||||
* @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown.
|
||||
* This is possible in case if resolution is performed for directives specified via 'types' parameter. In this case initial path for secondary lookups
|
||||
@@ -3676,17 +3678,11 @@ declare namespace ts {
|
||||
outputFiles: OutputFile[];
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
interface EmitOutputDetailed extends EmitOutput {
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
emittedSourceFiles: SourceFile[];
|
||||
}
|
||||
interface OutputFile {
|
||||
name: string;
|
||||
writeByteOrderMark: boolean;
|
||||
text: string;
|
||||
}
|
||||
function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput | EmitOutputDetailed;
|
||||
}
|
||||
declare namespace ts {
|
||||
function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string;
|
||||
@@ -3868,7 +3864,11 @@ declare namespace ts {
|
||||
interface HostCancellationToken {
|
||||
isCancellationRequested(): boolean;
|
||||
}
|
||||
interface LanguageServiceHost {
|
||||
interface InstallPackageOptions {
|
||||
fileName: Path;
|
||||
packageName: string;
|
||||
}
|
||||
interface LanguageServiceHost extends GetEffectiveTypeRootsHost {
|
||||
getCompilationSettings(): CompilerOptions;
|
||||
getNewLine?(): string;
|
||||
getProjectVersion?(): string;
|
||||
@@ -3890,12 +3890,13 @@ declare namespace ts {
|
||||
getTypeRootsVersion?(): number;
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[];
|
||||
resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[];
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getDirectories?(directoryName: string): string[];
|
||||
/**
|
||||
* Gets a set of custom transformers to use during emit.
|
||||
*/
|
||||
getCustomTransformers?(): CustomTransformers | undefined;
|
||||
isKnownTypesPackageName?(name: string): boolean;
|
||||
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
||||
}
|
||||
interface LanguageService {
|
||||
cleanupSemanticCache(): void;
|
||||
@@ -3913,7 +3914,7 @@ declare namespace ts {
|
||||
getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications;
|
||||
getCompletionsAtPosition(fileName: string, position: number): CompletionInfo;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options?: FormatCodeOptions | FormatCodeSettings): CompletionEntryDetails;
|
||||
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol;
|
||||
getQuickInfoAtPosition(fileName: string, position: number): QuickInfo;
|
||||
getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan;
|
||||
@@ -3943,13 +3944,16 @@ declare namespace ts {
|
||||
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean;
|
||||
getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan;
|
||||
getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[];
|
||||
applyCodeActionCommand(fileName: string, action: CodeActionCommand): Promise<ApplyCodeActionCommandResult>;
|
||||
getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[];
|
||||
getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput;
|
||||
getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, isDetailed?: boolean): EmitOutput | EmitOutputDetailed;
|
||||
getProgram(): Program;
|
||||
dispose(): void;
|
||||
}
|
||||
interface ApplyCodeActionCommandResult {
|
||||
successMessage: string;
|
||||
}
|
||||
interface Classifications {
|
||||
spans: number[];
|
||||
endOfLineState: EndOfLineState;
|
||||
@@ -4014,6 +4018,14 @@ declare namespace ts {
|
||||
description: string;
|
||||
/** Text changes to apply to each file as part of the code action */
|
||||
changes: FileTextChanges[];
|
||||
/**
|
||||
* If the user accepts the code fix, the editor should send the action back in a `applyAction` request.
|
||||
* This allows the language service to have side effects (e.g. installing dependencies) upon a code fix.
|
||||
*/
|
||||
commands?: CodeActionCommand[];
|
||||
}
|
||||
type CodeActionCommand = InstallPackageAction;
|
||||
interface InstallPackageAction {
|
||||
}
|
||||
/**
|
||||
* A set of one or more available refactoring actions, grouped under a parent refactoring.
|
||||
@@ -4062,6 +4074,7 @@ declare namespace ts {
|
||||
edits: FileTextChanges[];
|
||||
renameFilename: string | undefined;
|
||||
renameLocation: number | undefined;
|
||||
commands?: CodeActionCommand[];
|
||||
}
|
||||
interface TextInsertion {
|
||||
newText: string;
|
||||
@@ -4281,6 +4294,7 @@ declare namespace ts {
|
||||
* be used in that case
|
||||
*/
|
||||
replacementSpan?: TextSpan;
|
||||
hasAction?: true;
|
||||
}
|
||||
interface CompletionEntryDetails {
|
||||
name: string;
|
||||
@@ -4289,6 +4303,7 @@ declare namespace ts {
|
||||
displayParts: SymbolDisplayPart[];
|
||||
documentation: SymbolDisplayPart[];
|
||||
tags: JSDocTagInfo[];
|
||||
codeActions?: CodeAction[];
|
||||
}
|
||||
interface OutliningSpan {
|
||||
/** The span of the document to actually collapse. */
|
||||
|
||||
+1123
-762
File diff suppressed because it is too large
Load Diff
+198
-97
@@ -175,8 +175,8 @@ var ts;
|
||||
ts.localeCompareIsCorrect = ts.collator && ts.collator.compare("a", "B") < 0;
|
||||
function createDictionaryObject() {
|
||||
var map = Object.create(null);
|
||||
map["__"] = undefined;
|
||||
delete map["__"];
|
||||
map.__ = undefined;
|
||||
delete map.__;
|
||||
return map;
|
||||
}
|
||||
function createMap() {
|
||||
@@ -297,6 +297,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
ts.forEach = forEach;
|
||||
function firstDefined(array, callback) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var result = callback(array[i], i);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.firstDefined = firstDefined;
|
||||
function findAncestor(node, callback) {
|
||||
while (node) {
|
||||
var result = callback(node);
|
||||
@@ -350,6 +360,16 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
ts.find = find;
|
||||
function findLast(array, predicate) {
|
||||
for (var i = array.length - 1; i >= 0; i--) {
|
||||
var value = array[i];
|
||||
if (predicate(value, i)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
ts.findLast = findLast;
|
||||
function findIndex(array, predicate) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (predicate(array[i], i)) {
|
||||
@@ -1074,6 +1094,15 @@ var ts;
|
||||
return result;
|
||||
}
|
||||
ts.arrayToMap = arrayToMap;
|
||||
function arrayToNumericMap(array, makeKey) {
|
||||
var result = [];
|
||||
for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
|
||||
var value = array_7[_i];
|
||||
result[makeKey(value)] = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ts.arrayToNumericMap = arrayToNumericMap;
|
||||
function arrayToSet(array, makeKey) {
|
||||
return arrayToMap(array, makeKey || (function (s) { return s; }), function () { return true; });
|
||||
}
|
||||
@@ -2274,6 +2303,14 @@ var ts;
|
||||
return find(ts.supportedTypescriptExtensionsForExtractExtension, function (e) { return fileExtensionIs(path, e); }) || find(ts.supportedJavascriptExtensions, function (e) { return fileExtensionIs(path, e); });
|
||||
}
|
||||
ts.tryGetExtensionFromPath = tryGetExtensionFromPath;
|
||||
function getAnyExtensionFromPath(path) {
|
||||
var baseFileName = getBaseFileName(path);
|
||||
var extensionIndex = baseFileName.lastIndexOf(".");
|
||||
if (extensionIndex >= 0) {
|
||||
return baseFileName.substring(extensionIndex);
|
||||
}
|
||||
}
|
||||
ts.getAnyExtensionFromPath = getAnyExtensionFromPath;
|
||||
function isCheckJsEnabledForFile(sourceFile, compilerOptions) {
|
||||
return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs;
|
||||
}
|
||||
@@ -2416,8 +2453,13 @@ var ts;
|
||||
if (parentResult) {
|
||||
var baseName = getBaseNameOfFileName(fileOrDirectory);
|
||||
if (parentResult) {
|
||||
updateFilesOfFileSystemEntry(parentResult, baseName, host.fileExists(fileOrDirectoryPath));
|
||||
updateFileSystemEntry(parentResult.directories, baseName, host.directoryExists(fileOrDirectoryPath));
|
||||
var fsQueryResult = {
|
||||
fileExists: host.fileExists(fileOrDirectoryPath),
|
||||
directoryExists: host.directoryExists(fileOrDirectoryPath)
|
||||
};
|
||||
updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists);
|
||||
updateFileSystemEntry(parentResult.directories, baseName, fsQueryResult.directoryExists);
|
||||
return fsQueryResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2475,7 +2517,7 @@ var ts;
|
||||
var _path = require("path");
|
||||
var _os = require("os");
|
||||
var _crypto = require("crypto");
|
||||
var useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"];
|
||||
var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER;
|
||||
function createWatchedFileSet() {
|
||||
var dirWatchers = ts.createMap();
|
||||
var fileWatcherCallbacks = ts.createMultiMap();
|
||||
@@ -2829,7 +2871,7 @@ var ts;
|
||||
}
|
||||
function recursiveCreateDirectory(directoryPath, sys) {
|
||||
var basePath = ts.getDirectoryPath(directoryPath);
|
||||
var shouldCreateParent = directoryPath !== basePath && !sys.directoryExists(basePath);
|
||||
var shouldCreateParent = basePath !== "" && directoryPath !== basePath && !sys.directoryExists(basePath);
|
||||
if (shouldCreateParent) {
|
||||
recursiveCreateDirectory(basePath, sys);
|
||||
}
|
||||
@@ -3784,9 +3826,9 @@ var ts;
|
||||
Add_this_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, "Add_this_to_unresolved_variable_90008", "Add 'this.' to unresolved variable."),
|
||||
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(90009, ts.DiagnosticCategory.Error, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
|
||||
Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(90010, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),
|
||||
Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import {0} from {1}."),
|
||||
Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import '{0}' from \"{1}\"."),
|
||||
Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'."),
|
||||
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add {0} to existing import declaration from {1}."),
|
||||
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\"."),
|
||||
Declare_property_0: diag(90016, ts.DiagnosticCategory.Message, "Declare_property_0_90016", "Declare property '{0}'."),
|
||||
Add_index_signature_for_property_0: diag(90017, ts.DiagnosticCategory.Message, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'."),
|
||||
Disable_checking_for_this_file: diag(90018, ts.DiagnosticCategory.Message, "Disable_checking_for_this_file_90018", "Disable checking for this file."),
|
||||
@@ -4222,6 +4264,16 @@ var ts;
|
||||
}
|
||||
}
|
||||
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
|
||||
function isAnyImportSyntax(node) {
|
||||
switch (node.kind) {
|
||||
case 238:
|
||||
case 237:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ts.isAnyImportSyntax = isAnyImportSyntax;
|
||||
function getEnclosingBlockScopeContainer(node) {
|
||||
var current = node.parent;
|
||||
while (current) {
|
||||
@@ -4950,6 +5002,14 @@ var ts;
|
||||
return node && !!(node.flags & 1048576);
|
||||
}
|
||||
ts.isInJSDoc = isInJSDoc;
|
||||
function isJSDocIndexSignature(node) {
|
||||
return ts.isTypeReferenceNode(node) &&
|
||||
ts.isIdentifier(node.typeName) &&
|
||||
node.typeName.escapedText === "Object" &&
|
||||
node.typeArguments && node.typeArguments.length === 2 &&
|
||||
(node.typeArguments[0].kind === 136 || node.typeArguments[0].kind === 133);
|
||||
}
|
||||
ts.isJSDocIndexSignature = isJSDocIndexSignature;
|
||||
function isRequireCall(callExpression, checkArgumentIsStringLiteral) {
|
||||
if (callExpression.kind !== 181) {
|
||||
return false;
|
||||
@@ -4969,6 +5029,10 @@ var ts;
|
||||
return charCode === 39 || charCode === 34;
|
||||
}
|
||||
ts.isSingleOrDoubleQuote = isSingleOrDoubleQuote;
|
||||
function isStringDoubleQuoted(string, sourceFile) {
|
||||
return getSourceTextOfNodeFromSourceFile(sourceFile, string).charCodeAt(0) === 34;
|
||||
}
|
||||
ts.isStringDoubleQuoted = isStringDoubleQuoted;
|
||||
function isDeclarationOfFunctionOrClassExpression(s) {
|
||||
if (s.valueDeclaration && s.valueDeclaration.kind === 226) {
|
||||
var declaration = s.valueDeclaration;
|
||||
@@ -15098,8 +15162,8 @@ var ts;
|
||||
array._children = undefined;
|
||||
array.pos += delta;
|
||||
array.end += delta;
|
||||
for (var _i = 0, array_7 = array; _i < array_7.length; _i++) {
|
||||
var node = array_7[_i];
|
||||
for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
|
||||
var node = array_8[_i];
|
||||
visitNode(node);
|
||||
}
|
||||
}
|
||||
@@ -15171,8 +15235,8 @@ var ts;
|
||||
array.intersectsChange = true;
|
||||
array._children = undefined;
|
||||
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
||||
for (var _i = 0, array_8 = array; _i < array_8.length; _i++) {
|
||||
var node = array_8[_i];
|
||||
for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
|
||||
var node = array_9[_i];
|
||||
visitNode(node);
|
||||
}
|
||||
return;
|
||||
@@ -16344,7 +16408,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function isDoubleQuotedString(node) {
|
||||
return node.kind === 9 && ts.getSourceTextOfNodeFromSourceFile(sourceFile, node).charCodeAt(0) === 34;
|
||||
return ts.isStringLiteral(node) && ts.isStringDoubleQuoted(node, sourceFile);
|
||||
}
|
||||
}
|
||||
function getCompilerOptionValueTypeString(option) {
|
||||
@@ -16539,9 +16603,9 @@ var ts;
|
||||
};
|
||||
function getFileNames() {
|
||||
var filesSpecs;
|
||||
if (ts.hasProperty(raw, "files") && !isNullOrUndefined(raw["files"])) {
|
||||
if (ts.isArray(raw["files"])) {
|
||||
filesSpecs = raw["files"];
|
||||
if (ts.hasProperty(raw, "files") && !isNullOrUndefined(raw.files)) {
|
||||
if (ts.isArray(raw.files)) {
|
||||
filesSpecs = raw.files;
|
||||
if (filesSpecs.length === 0) {
|
||||
createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json");
|
||||
}
|
||||
@@ -16551,25 +16615,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
var includeSpecs;
|
||||
if (ts.hasProperty(raw, "include") && !isNullOrUndefined(raw["include"])) {
|
||||
if (ts.isArray(raw["include"])) {
|
||||
includeSpecs = raw["include"];
|
||||
if (ts.hasProperty(raw, "include") && !isNullOrUndefined(raw.include)) {
|
||||
if (ts.isArray(raw.include)) {
|
||||
includeSpecs = raw.include;
|
||||
}
|
||||
else {
|
||||
createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array");
|
||||
}
|
||||
}
|
||||
var excludeSpecs;
|
||||
if (ts.hasProperty(raw, "exclude") && !isNullOrUndefined(raw["exclude"])) {
|
||||
if (ts.isArray(raw["exclude"])) {
|
||||
excludeSpecs = raw["exclude"];
|
||||
if (ts.hasProperty(raw, "exclude") && !isNullOrUndefined(raw.exclude)) {
|
||||
if (ts.isArray(raw.exclude)) {
|
||||
excludeSpecs = raw.exclude;
|
||||
}
|
||||
else {
|
||||
createCompilerDiagnosticOnlyIfJson(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array");
|
||||
}
|
||||
}
|
||||
else {
|
||||
var outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"];
|
||||
var outDir = raw.compilerOptions && raw.compilerOptions.outDir;
|
||||
if (outDir) {
|
||||
excludeSpecs = [outDir];
|
||||
}
|
||||
@@ -16639,7 +16703,7 @@ var ts;
|
||||
errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));
|
||||
}
|
||||
var options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName);
|
||||
var typeAcquisition = convertTypeAcquisitionFromJsonWorker(json["typeAcquisition"] || json["typingOptions"], basePath, errors, configFileName);
|
||||
var typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName);
|
||||
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
||||
var extendedConfigPath;
|
||||
if (json.extends) {
|
||||
@@ -16755,7 +16819,7 @@ var ts;
|
||||
if (!ts.hasProperty(jsonOption, ts.compileOnSaveCommandLineOption.name)) {
|
||||
return undefined;
|
||||
}
|
||||
var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
|
||||
var result = convertJsonOption(ts.compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors);
|
||||
if (typeof result === "boolean" && result) {
|
||||
return result;
|
||||
}
|
||||
@@ -17229,6 +17293,50 @@ var ts;
|
||||
}
|
||||
}
|
||||
JsTyping.discoverTypings = discoverTypings;
|
||||
var MaxPackageNameLength = 214;
|
||||
function validatePackageName(packageName) {
|
||||
if (!packageName) {
|
||||
return 2;
|
||||
}
|
||||
if (packageName.length > MaxPackageNameLength) {
|
||||
return 3;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === 46) {
|
||||
return 4;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === 95) {
|
||||
return 5;
|
||||
}
|
||||
if (/^@[^/]+\/[^/]+$/.test(packageName)) {
|
||||
return 1;
|
||||
}
|
||||
if (encodeURIComponent(packageName) !== packageName) {
|
||||
return 6;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
JsTyping.validatePackageName = validatePackageName;
|
||||
function renderPackageNameValidationFailure(result, typing) {
|
||||
switch (result) {
|
||||
case 2:
|
||||
return "Package name '" + typing + "' cannot be empty";
|
||||
case 3:
|
||||
return "Package name '" + typing + "' should be less than " + MaxPackageNameLength + " characters";
|
||||
case 4:
|
||||
return "Package name '" + typing + "' cannot start with '.'";
|
||||
case 5:
|
||||
return "Package name '" + typing + "' cannot start with '_'";
|
||||
case 1:
|
||||
return "Package '" + typing + "' is scoped and currently is not supported";
|
||||
case 6:
|
||||
return "Package name '" + typing + "' contains non URI safe characters";
|
||||
case 0:
|
||||
throw ts.Debug.fail();
|
||||
default:
|
||||
ts.Debug.assertNever(result);
|
||||
}
|
||||
}
|
||||
JsTyping.renderPackageNameValidationFailure = renderPackageNameValidationFailure;
|
||||
})(JsTyping = ts.JsTyping || (ts.JsTyping = {}));
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
@@ -17237,6 +17345,8 @@ var ts;
|
||||
(function (server) {
|
||||
server.ActionSet = "action::set";
|
||||
server.ActionInvalidate = "action::invalidate";
|
||||
server.EventTypesRegistry = "event::typesRegistry";
|
||||
server.EventPackageInstalled = "event::packageInstalled";
|
||||
server.EventBeginInstallTypes = "event::beginInstallTypes";
|
||||
server.EventEndInstallTypes = "event::endInstallTypes";
|
||||
server.EventInitializationFailed = "event::initializationFailed";
|
||||
@@ -17957,6 +18067,7 @@ var ts;
|
||||
}
|
||||
return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) };
|
||||
}
|
||||
ts.getPackageName = getPackageName;
|
||||
function loadModuleFromNodeModules(extensions, moduleName, directory, failedLookupLocations, state, cache) {
|
||||
return loadModuleFromNodeModulesWorker(extensions, moduleName, directory, failedLookupLocations, state, false, cache);
|
||||
}
|
||||
@@ -17999,18 +18110,25 @@ var ts;
|
||||
}
|
||||
}
|
||||
var mangledScopedPackageSeparator = "__";
|
||||
function mangleScopedPackage(moduleName, state) {
|
||||
if (ts.startsWith(moduleName, "@")) {
|
||||
var replaceSlash = moduleName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
|
||||
if (replaceSlash !== moduleName) {
|
||||
var mangled = replaceSlash.slice(1);
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled);
|
||||
}
|
||||
return mangled;
|
||||
function mangleScopedPackage(packageName, state) {
|
||||
var mangled = getMangledNameForScopedPackage(packageName);
|
||||
if (state.traceEnabled && mangled !== packageName) {
|
||||
trace(state.host, ts.Diagnostics.Scoped_package_detected_looking_in_0, mangled);
|
||||
}
|
||||
return mangled;
|
||||
}
|
||||
function getTypesPackageName(packageName) {
|
||||
return "@types/" + getMangledNameForScopedPackage(packageName);
|
||||
}
|
||||
ts.getTypesPackageName = getTypesPackageName;
|
||||
function getMangledNameForScopedPackage(packageName) {
|
||||
if (ts.startsWith(packageName, "@")) {
|
||||
var replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
|
||||
if (replaceSlash !== packageName) {
|
||||
return replaceSlash.slice(1);
|
||||
}
|
||||
}
|
||||
return moduleName;
|
||||
return packageName;
|
||||
}
|
||||
function getPackageNameFromAtTypesDirectory(mangledName) {
|
||||
var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/");
|
||||
@@ -18104,39 +18222,6 @@ var ts;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
var PackageNameValidationResult;
|
||||
(function (PackageNameValidationResult) {
|
||||
PackageNameValidationResult[PackageNameValidationResult["Ok"] = 0] = "Ok";
|
||||
PackageNameValidationResult[PackageNameValidationResult["ScopedPackagesNotSupported"] = 1] = "ScopedPackagesNotSupported";
|
||||
PackageNameValidationResult[PackageNameValidationResult["EmptyName"] = 2] = "EmptyName";
|
||||
PackageNameValidationResult[PackageNameValidationResult["NameTooLong"] = 3] = "NameTooLong";
|
||||
PackageNameValidationResult[PackageNameValidationResult["NameStartsWithDot"] = 4] = "NameStartsWithDot";
|
||||
PackageNameValidationResult[PackageNameValidationResult["NameStartsWithUnderscore"] = 5] = "NameStartsWithUnderscore";
|
||||
PackageNameValidationResult[PackageNameValidationResult["NameContainsNonURISafeCharacters"] = 6] = "NameContainsNonURISafeCharacters";
|
||||
})(PackageNameValidationResult = typingsInstaller.PackageNameValidationResult || (typingsInstaller.PackageNameValidationResult = {}));
|
||||
typingsInstaller.MaxPackageNameLength = 214;
|
||||
function validatePackageName(packageName) {
|
||||
if (!packageName) {
|
||||
return PackageNameValidationResult.EmptyName;
|
||||
}
|
||||
if (packageName.length > typingsInstaller.MaxPackageNameLength) {
|
||||
return PackageNameValidationResult.NameTooLong;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === 46) {
|
||||
return PackageNameValidationResult.NameStartsWithDot;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === 95) {
|
||||
return PackageNameValidationResult.NameStartsWithUnderscore;
|
||||
}
|
||||
if (/^@[^/]+\/[^/]+$/.test(packageName)) {
|
||||
return PackageNameValidationResult.ScopedPackagesNotSupported;
|
||||
}
|
||||
if (encodeURIComponent(packageName) !== packageName) {
|
||||
return PackageNameValidationResult.NameContainsNonURISafeCharacters;
|
||||
}
|
||||
return PackageNameValidationResult.Ok;
|
||||
}
|
||||
typingsInstaller.validatePackageName = validatePackageName;
|
||||
var TypingsInstaller = (function () {
|
||||
function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
|
||||
if (log === void 0) { log = nullLog; }
|
||||
@@ -18283,8 +18368,8 @@ var ts;
|
||||
if (this.missingTypingsSet.get(typing) || this.packageNameToTypingLocation.get(typing)) {
|
||||
continue;
|
||||
}
|
||||
var validationResult = validatePackageName(typing);
|
||||
if (validationResult === PackageNameValidationResult.Ok) {
|
||||
var validationResult = ts.JsTyping.validatePackageName(typing);
|
||||
if (validationResult === 0) {
|
||||
if (this.typesRegistry.has(typing)) {
|
||||
result.push(typing);
|
||||
}
|
||||
@@ -18297,26 +18382,7 @@ var ts;
|
||||
else {
|
||||
this.missingTypingsSet.set(typing, true);
|
||||
if (this.log.isEnabled()) {
|
||||
switch (validationResult) {
|
||||
case PackageNameValidationResult.EmptyName:
|
||||
this.log.writeLine("Package name '" + typing + "' cannot be empty");
|
||||
break;
|
||||
case PackageNameValidationResult.NameTooLong:
|
||||
this.log.writeLine("Package name '" + typing + "' should be less than " + typingsInstaller.MaxPackageNameLength + " characters");
|
||||
break;
|
||||
case PackageNameValidationResult.NameStartsWithDot:
|
||||
this.log.writeLine("Package name '" + typing + "' cannot start with '.'");
|
||||
break;
|
||||
case PackageNameValidationResult.NameStartsWithUnderscore:
|
||||
this.log.writeLine("Package name '" + typing + "' cannot start with '_'");
|
||||
break;
|
||||
case PackageNameValidationResult.ScopedPackagesNotSupported:
|
||||
this.log.writeLine("Package '" + typing + "' is scoped and currently is not supported");
|
||||
break;
|
||||
case PackageNameValidationResult.NameContainsNonURISafeCharacters:
|
||||
this.log.writeLine("Package name '" + typing + "' contains non URI safe characters");
|
||||
break;
|
||||
}
|
||||
this.log.writeLine(ts.JsTyping.renderPackageNameValidationFailure(validationResult, typing));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18445,8 +18511,8 @@ var ts;
|
||||
kind: server.ActionSet
|
||||
};
|
||||
};
|
||||
TypingsInstaller.prototype.installTypingsAsync = function (requestId, args, cwd, onRequestCompleted) {
|
||||
this.pendingRunRequests.unshift({ requestId: requestId, args: args, cwd: cwd, onRequestCompleted: onRequestCompleted });
|
||||
TypingsInstaller.prototype.installTypingsAsync = function (requestId, packageNames, cwd, onRequestCompleted) {
|
||||
this.pendingRunRequests.unshift({ requestId: requestId, packageNames: packageNames, cwd: cwd, onRequestCompleted: onRequestCompleted });
|
||||
this.executeWithThrottling();
|
||||
};
|
||||
TypingsInstaller.prototype.executeWithThrottling = function () {
|
||||
@@ -18454,7 +18520,7 @@ var ts;
|
||||
var _loop_4 = function () {
|
||||
this_1.inFlightRequestCount++;
|
||||
var request = this_1.pendingRunRequests.pop();
|
||||
this_1.installWorker(request.requestId, request.args, request.cwd, function (ok) {
|
||||
this_1.installWorker(request.requestId, request.packageNames, request.cwd, function (ok) {
|
||||
_this.inFlightRequestCount--;
|
||||
request.onRequestCompleted(ok);
|
||||
_this.executeWithThrottling();
|
||||
@@ -18580,23 +18646,51 @@ var ts;
|
||||
break;
|
||||
case "closeProject":
|
||||
_this.closeProject(req);
|
||||
break;
|
||||
case "typesRegistry": {
|
||||
var typesRegistry_1 = {};
|
||||
_this.typesRegistry.forEach(function (value, key) {
|
||||
typesRegistry_1[key] = value;
|
||||
});
|
||||
var response = { kind: server.EventTypesRegistry, typesRegistry: typesRegistry_1 };
|
||||
_this.sendResponse(response);
|
||||
break;
|
||||
}
|
||||
case "installPackage": {
|
||||
var fileName = req.fileName, packageName_1 = req.packageName, projectRootPath = req.projectRootPath;
|
||||
var cwd = getDirectoryOfPackageJson(fileName, _this.installTypingHost) || projectRootPath;
|
||||
if (cwd) {
|
||||
_this.installWorker(-1, [packageName_1], cwd, function (success) {
|
||||
var message = success ? "Package " + packageName_1 + " installed." : "There was an error installing " + packageName_1 + ".";
|
||||
var response = { kind: server.EventPackageInstalled, success: success, message: message };
|
||||
_this.sendResponse(response);
|
||||
});
|
||||
}
|
||||
else {
|
||||
var response = { kind: server.EventPackageInstalled, success: false, message: "Could not determine a project root path." };
|
||||
_this.sendResponse(response);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ts.Debug.assertNever(req);
|
||||
}
|
||||
});
|
||||
};
|
||||
NodeTypingsInstaller.prototype.sendResponse = function (response) {
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine("Sending response: " + JSON.stringify(response));
|
||||
this.log.writeLine("Sending response:\n " + JSON.stringify(response));
|
||||
}
|
||||
process.send(response);
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine("Response has been sent.");
|
||||
}
|
||||
};
|
||||
NodeTypingsInstaller.prototype.installWorker = function (requestId, args, cwd, onRequestCompleted) {
|
||||
NodeTypingsInstaller.prototype.installWorker = function (requestId, packageNames, cwd, onRequestCompleted) {
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(args) + "'.");
|
||||
this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(packageNames) + "'.");
|
||||
}
|
||||
var command = this.npmPath + " install --ignore-scripts " + args.join(" ") + " --save-dev --user-agent=\"typesInstaller/" + ts.version + "\"";
|
||||
var command = this.npmPath + " install --ignore-scripts " + packageNames.join(" ") + " --save-dev --user-agent=\"typesInstaller/" + ts.version + "\"";
|
||||
var start = Date.now();
|
||||
var hasError = this.execSyncAndLog(command, { cwd: cwd });
|
||||
if (this.log.isEnabled()) {
|
||||
@@ -18624,6 +18718,13 @@ var ts;
|
||||
return NodeTypingsInstaller;
|
||||
}(typingsInstaller.TypingsInstaller));
|
||||
typingsInstaller.NodeTypingsInstaller = NodeTypingsInstaller;
|
||||
function getDirectoryOfPackageJson(fileName, host) {
|
||||
return ts.forEachAncestorDirectory(ts.getDirectoryPath(fileName), function (directory) {
|
||||
if (host.fileExists(ts.combinePaths(directory, "package.json"))) {
|
||||
return directory;
|
||||
}
|
||||
});
|
||||
}
|
||||
var logFilePath = server.findArgument(server.Arguments.LogFile);
|
||||
var globalTypingsCacheLocation = server.findArgument(server.Arguments.GlobalCacheLocation);
|
||||
var typingSafeListLocation = server.findArgument(server.Arguments.TypingSafeListLocation);
|
||||
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "只允许在生成器正文中使用 \"yield\" 表达式。",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "无法通过 super 表达式访问“{1}”类中的“{0}”抽象方法。",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "抽象方法只能出现在抽象类中。",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "不能在构造函数中访问类“{1}”中的抽象属性“{0}”。",
|
||||
"Accessibility_modifier_already_seen_1028": "已看到可访问性修饰符。",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "访问器仅在面向 ECMAScript 5 和更高版本时可用。",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "两个取值函数必须都是抽象的或都是非抽象的。",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "对象成员无法声明为可选。",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "重载签名无法声明为生成器。",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "乘方表达式的左侧不允许存在具有“{0}”运算符的一元表达式。请考虑用括号将表达式括起。",
|
||||
"Annotate_with_type_from_JSDoc_95009": "使用 JSDoc 中的类型批注",
|
||||
"Annotate_with_types_from_JSDoc_95010": "使用 JSDoc 中的类型批注",
|
||||
"Argument_expression_expected_1135": "应为参数表达式。",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "“{0}”选项的参数必须为 {1}。",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "类型“{0}”的参数不能赋给类型“{1}”的参数。",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "需要二进制数字。",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "绑定元素“{0}”隐式具有“{1}”类型。",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "声明之前已使用的块范围变量“{0}”。",
|
||||
"Call_decorator_expression_90028": "调用修饰器表达式。",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少返回类型批注的调用签名隐式具有返回类型 \"any\"。",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "调用目标不包含任何签名。",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "无法访问“{0}.{1}”,因为“{0}”是类型,不是命名空间。是否要使用“{0}[\"{1}\"]”检索“{0}”中“{1}”属性的类型?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "无法写入文件“{0}”,因为它会覆盖输入文件。",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch 子句变量不能有类型批注。",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "Catch 子句变量不能有初始化表达式。",
|
||||
"Change_0_to_1_90014": "将 {0} 更改为 {1}。",
|
||||
"Change_0_to_1_90014": "将“{0}”更改为“{1}”。",
|
||||
"Change_extends_to_implements_90003": "将 \"extends\" 更改为 \"implements\"。",
|
||||
"Change_spelling_to_0_90022": "将拼写更改为“{0}”。",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "检查“{0}”是否是“{1}”-“{2}”的最长匹配前缀。",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "类“{0}”错误扩展基类“{1}”。",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "类“{0}”错误实现接口“{1}”。",
|
||||
"Class_0_used_before_its_declaration_2449": "类“{0}”用于其声明前。",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "类声明不能有多个 \"@augments\" 或 \"@extends\" 标记。",
|
||||
"Class_name_cannot_be_0_2414": "类名不能为“{0}”。",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "类静态侧“{0}”错误扩展基类静态侧“{1}”。",
|
||||
"Classes_can_only_extend_a_single_class_1174": "类只能扩展一个类。",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "类型“{0}”中缺少索引签名。",
|
||||
"Index_signatures_are_incompatible_2330": "索引签名不兼容。",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "合并声明“{0}”中的单独声明必须全为导出或全为局部声明。",
|
||||
"Infer_parameter_types_from_usage_95012": "从用法中推断出参数类型。",
|
||||
"Infer_type_of_0_from_usage_95011": "从用法中推断出“{0}”的类型。",
|
||||
"Initialize_property_0_in_the_constructor_90020": "初始化构造函数中的属性“{0}”。",
|
||||
"Initialize_static_property_0_90021": "初始化静态属性“{0}”。",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "实例成员变量“{0}”的初始化表达式不能引用构造函数中声明的标识符“{1}”。",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "严格模式下“{0}”的使用无效。",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "\"jsxFactory\" 的值无效。“{0}”不是有效的标识符或限定名称。",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "\"--reactNamespace\" 的值无效。“{0}”不是有效的标识符。",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "JSDoc \"@augments {0}\" 与“扩展 {1}”子句不匹配。",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "JSDoc \"@augments\" 未附加到类声明。",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "JSDoc \"@{0} {1}\" 不匹配 \"extends {2}\" 子句。",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "JSDoc \"@{0}\" 未附加到类。",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "JSDoc \"@param\" 标记具有名称 \"{0}\",但不存在具有该名称的参数。",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc \"@typedef\" 标记应具有类型注释,或其后跟有 \"@property\" 或 \"@member\" 标记。",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc 类型只能在文档注释内部使用。",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "\"yield*\" 操作数的迭代元素的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "异步生成器中 \"yield\" 操作数的类型必须是有效承诺,或不得包含可调用的 \"then\" 成员。",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "类型参数“{0}”具有循环约束。",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "类型参数“{0}”具有循环默认值。",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "导出接口中的调用签名的类型参数“{0}”具有或正在使用专用名称“{1}”。",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "导出接口中的构造函数签名的类型参数“{0}”具有或正在使用专用名称“{1}”。",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "导出类的类型参数“{0}”具有或正在使用专用名称“{1}”。",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "监视输入文件。",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "不能重命名标准 TypeScript 库中定义的元素。",
|
||||
"You_cannot_rename_this_element_8000": "无法重命名此元素。",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "“{0}”收到的参数过少,无法在此处充当修饰器。你是要先调用它,然后再写入 \"@{0}()\" 吗?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "“{0}”被指定了两次。将覆盖名为“{0}”的特性。",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "“{0}”只能在 .ts 文件中使用。",
|
||||
"_0_expected_1005": "应为“{0}”。",
|
||||
+12
-3
@@ -83,6 +83,7 @@
|
||||
"A_yield_expression_is_only_allowed_in_a_generator_body_1163": "只有產生器主體才允許 'yield' 運算式。",
|
||||
"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "無法透過 super 運算式存取類別 '{1}' 中的抽象方法 '{0}'。",
|
||||
"Abstract_methods_can_only_appear_within_an_abstract_class_1244": "抽象方法只可出現在抽象類別中。",
|
||||
"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715": "無法從建構函式存取類別 '{1}' 中的抽象屬性 '{0}'。",
|
||||
"Accessibility_modifier_already_seen_1028": "已有存取範圍修飾詞。",
|
||||
"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "只有當目標為 ECMAScript 5 及更高版本時,才可使用存取子。",
|
||||
"Accessors_must_both_be_abstract_or_non_abstract_2676": "存取子必須兩者均為抽象或非抽象。",
|
||||
@@ -142,6 +143,8 @@
|
||||
"An_object_member_cannot_be_declared_optional_1162": "不得將物件成員宣告為選擇性。",
|
||||
"An_overload_signature_cannot_be_declared_as_a_generator_1222": "不可將多載簽章宣告為產生器。",
|
||||
"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "乘冪運算式左邊不允許具 '{0}' 運算子的一元運算式。請考慮以括弧括住運算式。",
|
||||
"Annotate_with_type_from_JSDoc_95009": "為來自 JSDoc 的類型標註",
|
||||
"Annotate_with_types_from_JSDoc_95010": "為來自 JSDoc 的類型標註",
|
||||
"Argument_expression_expected_1135": "必須是引數運算式。",
|
||||
"Argument_for_0_option_must_be_Colon_1_6046": "'{0}' 選項的引數必須是: {1}。",
|
||||
"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "類型 '{0}' 的引數不可指派給類型 '{1}' 的參數。",
|
||||
@@ -158,6 +161,7 @@
|
||||
"Binary_digit_expected_1177": "必須是二進位數字。",
|
||||
"Binding_element_0_implicitly_has_an_1_type_7031": "繫結元素 '{0}' 隱含擁有 '{1}' 類型。",
|
||||
"Block_scoped_variable_0_used_before_its_declaration_2448": "已在其宣告之前使用區塊範圍變數 '{0}'。",
|
||||
"Call_decorator_expression_90028": "呼叫裝飾項目運算式。",
|
||||
"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少傳回型別註解的呼叫簽章隱含了 'any' 傳回型別。",
|
||||
"Call_target_does_not_contain_any_signatures_2346": "呼叫目標未包含任何特徵標記。",
|
||||
"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "因為 '{0}' 是類型而非命名空間,所以無法存取 '{0}.{1}'。您要在 '{0}' 中使用 '{0}[\"{1}\"]' 擷取屬性 '{1}' 的類型嗎?",
|
||||
@@ -202,7 +206,7 @@
|
||||
"Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "無法寫入檔案 '{0}',原因是其會覆寫輸入檔。",
|
||||
"Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch 子句變數不得有類型註釋。",
|
||||
"Catch_clause_variable_cannot_have_an_initializer_1197": "Catch 子句變數不得有初始設定式。",
|
||||
"Change_0_to_1_90014": "將 {0} 變更為 {1}。",
|
||||
"Change_0_to_1_90014": "將 '{0}' 變更為 '{1}'。",
|
||||
"Change_extends_to_implements_90003": "將 'extends' 變更為 'implements'。",
|
||||
"Change_spelling_to_0_90022": "將拼字變更為 '{0}'。",
|
||||
"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "檢查 '{0}' 是否為 '{1}' - '{2}' 的最長相符前置詞。",
|
||||
@@ -215,6 +219,7 @@
|
||||
"Class_0_incorrectly_extends_base_class_1_2415": "類別 '{0}' 不正確地擴充基底類別 '{1}'。",
|
||||
"Class_0_incorrectly_implements_interface_1_2420": "類別 '{0}' 不正確地實作介面 '{1}'。",
|
||||
"Class_0_used_before_its_declaration_2449": "類別 '{0}' 的位置在其宣告之前。",
|
||||
"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "類別宣告只可有一個 '@augments' 或 '@extends' 標記。",
|
||||
"Class_name_cannot_be_0_2414": "類別名稱不得為 '{0}'。",
|
||||
"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "類別靜態端 '{0}' 不正確地擴充基底類別靜態端 '{1}'。",
|
||||
"Classes_can_only_extend_a_single_class_1174": "類別只能擴充一個類別。",
|
||||
@@ -409,6 +414,8 @@
|
||||
"Index_signature_is_missing_in_type_0_2329": "類型 '{0}' 中遺漏索引簽章。",
|
||||
"Index_signatures_are_incompatible_2330": "索引簽章不相容。",
|
||||
"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "合併宣告 '{0}' 中的個別宣告必須全部匯出或全在本機上。",
|
||||
"Infer_parameter_types_from_usage_95012": "從用法推斷參數類型。",
|
||||
"Infer_type_of_0_from_usage_95011": "從用法推斷 '{0}' 的類型。",
|
||||
"Initialize_property_0_in_the_constructor_90020": "初始化建構函式中的屬性 '{0}'。",
|
||||
"Initialize_static_property_0_90021": "初始化靜態屬性 '{0}'。",
|
||||
"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "執行個體成員變數 '{0}' 的初始設定式不得參考建構函式中所宣告的識別碼 '{1}'。",
|
||||
@@ -430,8 +437,8 @@
|
||||
"Invalid_use_of_0_in_strict_mode_1100": "在 strict 模式中使用 '{0}' 無效。",
|
||||
"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067": "'jsxFactory' 的值無效。'{0}' 不是有效的識別碼或限定名稱。",
|
||||
"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059": "'--reactNamespace' 的值無效。'{0}' 不是有效的識別碼。",
|
||||
"JSDoc_augments_0_does_not_match_the_extends_1_clause_8023": "JSDoc '@augments {0}' 不符合 'extends {1}' 子句。",
|
||||
"JSDoc_augments_is_not_attached_to_a_class_declaration_8022": "JSDoc '@augments' 未連結至類別宣告。",
|
||||
"JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "JSDoc '@{0} {1}' 不符合 'extends {2}' 子句。",
|
||||
"JSDoc_0_is_not_attached_to_a_class_8022": "JSDoc ''@{0}' 未連結到類別。",
|
||||
"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "JSDoc '@param' 標記的名稱為 '{0}',但沒有為該名稱的參數。",
|
||||
"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc '@typedef' 標記應具有類型註解,或者其後接著 '@property' 或 '@member' 標記。",
|
||||
"JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc 類型只能在文件註解中使用。",
|
||||
@@ -785,6 +792,7 @@
|
||||
"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322": "'yield*' 運算元的反覆項目類型必須是有效的 Promise,或不得包含可呼叫的 'then' 成員。",
|
||||
"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "非同步產生器中的 'yield' 運算元類型必須是有效的 Promise,或不得包含可呼叫的 'then' 成員。",
|
||||
"Type_parameter_0_has_a_circular_constraint_2313": "類型參數 '{0}' 具有循環條件約束。",
|
||||
"Type_parameter_0_has_a_circular_default_2716": "型別參數 '{0}' 包含循環的預設值。",
|
||||
"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "匯出介面中呼叫簽章的型別參數 '{0}' 具有或使用私用名稱 '{1}'。",
|
||||
"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "匯出介面中建構函式簽章的型別參數 '{0}' 具有或使用私用名稱 '{1}'。",
|
||||
"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "匯出類別的型別參數 '{0}' 具有或使用私用名稱 '{1}'。",
|
||||
@@ -838,6 +846,7 @@
|
||||
"Watch_input_files_6005": "監看輸入檔案。",
|
||||
"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001": "您無法重新命名標準 TypeScript 程式庫中所定義的項目。",
|
||||
"You_cannot_rename_this_element_8000": "您無法重新命名這個項目。",
|
||||
"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329": "'{0}' 在此只接受極少數的引數用為裝飾項目。要先呼叫此項目,然後再寫入 '@{0}()' 嗎?",
|
||||
"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710": "'{0}' 指定了兩次。將會覆寫名為 '{0}' 的屬性。",
|
||||
"_0_can_only_be_used_in_a_ts_file_8009": "'{0}' 只可用於 .ts 檔案中。",
|
||||
"_0_expected_1005": "必須是 '{0}'。",
|
||||
+18
-15
@@ -51,22 +51,25 @@ class DeclarationsWalker {
|
||||
return this.processType((<any>type).typeArguments[0]);
|
||||
}
|
||||
else {
|
||||
for (const decl of s.getDeclarations()) {
|
||||
const sourceFile = decl.getSourceFile();
|
||||
if (sourceFile === this.protocolFile || path.basename(sourceFile.fileName) === "lib.d.ts") {
|
||||
return;
|
||||
}
|
||||
if (decl.kind === ts.SyntaxKind.EnumDeclaration && !isStringEnum(decl as ts.EnumDeclaration)) {
|
||||
this.removedTypes.push(type);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// splice declaration in final d.ts file
|
||||
let text = decl.getFullText();
|
||||
this.text += `${text}\n`;
|
||||
// recursively pull all dependencies into result dts file
|
||||
const declarations = s.getDeclarations();
|
||||
if (declarations) {
|
||||
for (const decl of declarations) {
|
||||
const sourceFile = decl.getSourceFile();
|
||||
if (sourceFile === this.protocolFile || path.basename(sourceFile.fileName) === "lib.d.ts") {
|
||||
return;
|
||||
}
|
||||
if (decl.kind === ts.SyntaxKind.EnumDeclaration && !isStringEnum(decl as ts.EnumDeclaration)) {
|
||||
this.removedTypes.push(type);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// splice declaration in final d.ts file
|
||||
let text = decl.getFullText();
|
||||
this.text += `${text}\n`;
|
||||
// recursively pull all dependencies into result dts file
|
||||
|
||||
this.visitTypeNodes(decl);
|
||||
this.visitTypeNodes(decl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,16 +27,54 @@ function main(): void {
|
||||
|
||||
function visitDirectory(name: string) {
|
||||
const inputFilePath = path.join(inputPath, name, "diagnosticMessages", "diagnosticMessages.generated.json.lcl");
|
||||
const outputFilePath = path.join(outputPath, name, "diagnosticMessages.generated.json");
|
||||
|
||||
fs.readFile(inputFilePath, (err, data) => {
|
||||
handleError(err);
|
||||
xml2js.parseString(data.toString(), (err, result) => {
|
||||
handleError(err);
|
||||
writeFile(outputFilePath, xmlObjectToString(result));
|
||||
if (!result || !result.LCX || !result.LCX.$ || !result.LCX.$.TgtCul) {
|
||||
console.error("Unexpected XML file structure. Expected to find result.LCX.$.TgtCul.");
|
||||
process.exit(1);
|
||||
}
|
||||
const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul);
|
||||
if (!outputDirectoryName) {
|
||||
console.error(`Invalid output locale name for '${result.LCX.$.TgtCul}'.`);
|
||||
process.exit(1);
|
||||
}
|
||||
writeFile(path.join(outputPath, outputDirectoryName, "diagnosticMessages.generated.json"), xmlObjectToString(result));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A locale name is based on the language tagging conventions of RFC 4646 (Windows Vista
|
||||
* and later), and is represented by LOCALE_SNAME.
|
||||
* Generally, the pattern <language>-<REGION> is used. Here, language is a lowercase ISO 639
|
||||
* language code. The codes from ISO 639-1 are used when available. Otherwise, codes from
|
||||
* ISO 639-2/T are used. REGION specifies an uppercase ISO 3166-1 country/region identifier.
|
||||
* For example, the locale name for English (United States) is "en-US" and the locale name
|
||||
* for Divehi (Maldives) is "dv-MV".
|
||||
*
|
||||
* If the locale is a neutral locale (no region), the LOCALE_SNAME value follows the
|
||||
* pattern <language>. If it is a neutral locale for which the script is significant, the
|
||||
* pattern is <language>-<Script>.
|
||||
*
|
||||
* More at https://msdn.microsoft.com/en-us/library/windows/desktop/dd373814(v=vs.85).aspx
|
||||
*
|
||||
* Most of the languages we support are neutral locales, so we want to use the language name.
|
||||
* There are three exceptions, zh-CN, zh-TW and pt-BR.
|
||||
*/
|
||||
function getPreferedLocaleName(localeName: string) {
|
||||
switch (localeName) {
|
||||
case "zh-CN":
|
||||
case "zh-TW":
|
||||
case "pt-BR":
|
||||
return localeName;
|
||||
default:
|
||||
return localeName.split("-")[0];
|
||||
}
|
||||
}
|
||||
|
||||
function handleError(err: null | object) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
@@ -46,9 +84,9 @@ function main(): void {
|
||||
|
||||
function xmlObjectToString(o: any) {
|
||||
const out: any = {};
|
||||
for (const item of o["LCX"]["Item"][0]["Item"][0]["Item"]) {
|
||||
let ItemId = item["$"]["ItemId"];
|
||||
let Val = item["Str"][0]["Tgt"] ? item["Str"][0]["Tgt"][0]["Val"][0] : item["Str"][0]["Val"][0];
|
||||
for (const item of o.LCX.Item[0].Item[0].Item) {
|
||||
let ItemId = item.$.ItemId;
|
||||
let Val = item.Str[0].Tgt ? item.Str[0].Tgt[0].Val[0] : item.Str[0].Val[0];
|
||||
|
||||
if (typeof ItemId !== "string" || typeof Val !== "string") {
|
||||
console.error("Unexpected XML file structure");
|
||||
|
||||
+134
-160
@@ -6,58 +6,38 @@ namespace ts {
|
||||
emitSkipped: boolean;
|
||||
}
|
||||
|
||||
export interface EmitOutputDetailed extends EmitOutput {
|
||||
diagnostics: Diagnostic[];
|
||||
sourceMaps: SourceMapData[];
|
||||
emittedSourceFiles: SourceFile[];
|
||||
}
|
||||
|
||||
export interface OutputFile {
|
||||
name: string;
|
||||
writeByteOrderMark: boolean;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean,
|
||||
cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput | EmitOutputDetailed {
|
||||
const outputFiles: OutputFile[] = [];
|
||||
let emittedSourceFiles: SourceFile[];
|
||||
const emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
||||
if (!isDetailed) {
|
||||
return { outputFiles, emitSkipped: emitResult.emitSkipped };
|
||||
}
|
||||
|
||||
return {
|
||||
outputFiles,
|
||||
emitSkipped: emitResult.emitSkipped,
|
||||
diagnostics: emitResult.diagnostics,
|
||||
sourceMaps: emitResult.sourceMaps,
|
||||
emittedSourceFiles
|
||||
};
|
||||
|
||||
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, _onError: (message: string) => void, sourceFiles: SourceFile[]) {
|
||||
outputFiles.push({ name: fileName, writeByteOrderMark, text });
|
||||
if (isDetailed) {
|
||||
emittedSourceFiles = addRange(emittedSourceFiles, sourceFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean,
|
||||
cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput {
|
||||
const outputFiles: OutputFile[] = [];
|
||||
const emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
||||
return { outputFiles, emitSkipped: emitResult.emitSkipped };
|
||||
|
||||
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean) {
|
||||
outputFiles.push({ name: fileName, writeByteOrderMark, text });
|
||||
}
|
||||
}
|
||||
|
||||
export interface Builder {
|
||||
/**
|
||||
* Call this to feed new program
|
||||
*/
|
||||
/** Called to inform builder about new program */
|
||||
updateProgram(newProgram: Program): void;
|
||||
getFilesAffectedBy(program: Program, path: Path): string[];
|
||||
emitFile(program: Program, path: Path): EmitOutput;
|
||||
|
||||
/** Gets the files affected by the file path */
|
||||
getFilesAffectedBy(program: Program, path: Path): ReadonlyArray<SourceFile>;
|
||||
|
||||
/** Emit the changed files and clear the cache of the changed files */
|
||||
emitChangedFiles(program: Program): EmitOutputDetailed[];
|
||||
emitChangedFiles(program: Program, writeFileCallback: WriteFileCallback): ReadonlyArray<EmitResult>;
|
||||
|
||||
/** When called gets the semantic diagnostics for the program. It also caches the diagnostics and manage them */
|
||||
getSemanticDiagnostics(program: Program, cancellationToken?: CancellationToken): Diagnostic[];
|
||||
getSemanticDiagnostics(program: Program, cancellationToken?: CancellationToken): ReadonlyArray<Diagnostic>;
|
||||
|
||||
/** Called to reset the status of the builder */
|
||||
clear(): void;
|
||||
@@ -88,20 +68,17 @@ namespace ts {
|
||||
/**
|
||||
* Gets the files affected by the script info which has updated shape from the known one
|
||||
*/
|
||||
getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile, singleFileResult: string[]): string[];
|
||||
getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile): ReadonlyArray<SourceFile>;
|
||||
}
|
||||
|
||||
interface FileInfo {
|
||||
fileName: string;
|
||||
version: string;
|
||||
signature: string;
|
||||
}
|
||||
|
||||
export interface BuilderOptions {
|
||||
getCanonicalFileName: (fileName: string) => string;
|
||||
getEmitOutput: (program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean) => EmitOutput | EmitOutputDetailed;
|
||||
computeHash: (data: string) => string;
|
||||
shouldEmitFile: (sourceFile: SourceFile) => boolean;
|
||||
}
|
||||
|
||||
export function createBuilder(options: BuilderOptions): Builder {
|
||||
@@ -109,12 +86,13 @@ namespace ts {
|
||||
const fileInfos = createMap<FileInfo>();
|
||||
const semanticDiagnosticsPerFile = createMap<ReadonlyArray<Diagnostic>>();
|
||||
/** The map has key by source file's path that has been changed */
|
||||
const changedFileNames = createMap<string>();
|
||||
const changedFilesSet = createMap<true>();
|
||||
const hasShapeChanged = createMap<true>();
|
||||
let allFilesExcludingDefaultLibraryFile: ReadonlyArray<SourceFile> | undefined;
|
||||
let emitHandler: EmitHandler;
|
||||
return {
|
||||
updateProgram,
|
||||
getFilesAffectedBy,
|
||||
emitFile,
|
||||
emitChangedFiles,
|
||||
getSemanticDiagnostics,
|
||||
clear
|
||||
@@ -128,6 +106,8 @@ namespace ts {
|
||||
fileInfos.clear();
|
||||
semanticDiagnosticsPerFile.clear();
|
||||
}
|
||||
hasShapeChanged.clear();
|
||||
allFilesExcludingDefaultLibraryFile = undefined;
|
||||
mutateMap(
|
||||
fileInfos,
|
||||
arrayToMap(program.getSourceFiles(), sourceFile => sourceFile.path),
|
||||
@@ -142,31 +122,34 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
function registerChangedFile(path: Path, fileName: string) {
|
||||
changedFileNames.set(path, fileName);
|
||||
function registerChangedFile(path: Path) {
|
||||
changedFilesSet.set(path, true);
|
||||
// All changed files need to re-evaluate its semantic diagnostics
|
||||
semanticDiagnosticsPerFile.delete(path);
|
||||
}
|
||||
|
||||
function addNewFileInfo(program: Program, sourceFile: SourceFile): FileInfo {
|
||||
registerChangedFile(sourceFile.path, sourceFile.fileName);
|
||||
registerChangedFile(sourceFile.path);
|
||||
emitHandler.onAddSourceFile(program, sourceFile);
|
||||
return { fileName: sourceFile.fileName, version: sourceFile.version, signature: undefined };
|
||||
return { version: sourceFile.version, signature: undefined };
|
||||
}
|
||||
|
||||
function removeExistingFileInfo(existingFileInfo: FileInfo, path: Path) {
|
||||
registerChangedFile(path, existingFileInfo.fileName);
|
||||
function removeExistingFileInfo(_existingFileInfo: FileInfo, path: Path) {
|
||||
// Since we dont need to track removed file as changed file
|
||||
// We can just remove its diagnostics
|
||||
changedFilesSet.delete(path);
|
||||
semanticDiagnosticsPerFile.delete(path);
|
||||
emitHandler.onRemoveSourceFile(path);
|
||||
}
|
||||
|
||||
function updateExistingFileInfo(program: Program, existingInfo: FileInfo, sourceFile: SourceFile) {
|
||||
if (existingInfo.version !== sourceFile.version) {
|
||||
registerChangedFile(sourceFile.path, sourceFile.fileName);
|
||||
registerChangedFile(sourceFile.path);
|
||||
existingInfo.version = sourceFile.version;
|
||||
emitHandler.onUpdateSourceFile(program, sourceFile);
|
||||
}
|
||||
else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) {
|
||||
registerChangedFile(sourceFile.path, sourceFile.fileName);
|
||||
registerChangedFile(sourceFile.path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,114 +165,95 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getFilesAffectedBy(program: Program, path: Path): string[] {
|
||||
function getFilesAffectedBy(program: Program, path: Path): ReadonlyArray<SourceFile> {
|
||||
ensureProgramGraph(program);
|
||||
|
||||
const sourceFile = program.getSourceFile(path);
|
||||
const singleFileResult = sourceFile && options.shouldEmitFile(sourceFile) ? [sourceFile.fileName] : [];
|
||||
const info = fileInfos.get(path);
|
||||
if (!info || !updateShapeSignature(program, sourceFile, info)) {
|
||||
return singleFileResult;
|
||||
const sourceFile = program.getSourceFileByPath(path);
|
||||
if (!sourceFile) {
|
||||
return emptyArray;
|
||||
}
|
||||
|
||||
Debug.assert(!!sourceFile);
|
||||
return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile, singleFileResult);
|
||||
if (!updateShapeSignature(program, sourceFile)) {
|
||||
return [sourceFile];
|
||||
}
|
||||
return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile);
|
||||
}
|
||||
|
||||
function emitFile(program: Program, path: Path) {
|
||||
function emitChangedFiles(program: Program, writeFileCallback: WriteFileCallback): ReadonlyArray<EmitResult> {
|
||||
ensureProgramGraph(program);
|
||||
if (!fileInfos.has(path)) {
|
||||
return { outputFiles: [], emitSkipped: true };
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
|
||||
if (!changedFilesSet.size) {
|
||||
return emptyArray;
|
||||
}
|
||||
|
||||
return options.getEmitOutput(program, program.getSourceFileByPath(path), /*emitOnlyDtsFiles*/ false, /*isDetailed*/ false);
|
||||
}
|
||||
// With --out or --outFile all outputs go into single file, do it only once
|
||||
if (compilerOptions.outFile || compilerOptions.out) {
|
||||
Debug.assert(semanticDiagnosticsPerFile.size === 0);
|
||||
changedFilesSet.clear();
|
||||
return [program.emit(/*targetSourceFile*/ undefined, writeFileCallback)];
|
||||
}
|
||||
|
||||
function enumerateChangedFilesSet(
|
||||
program: Program,
|
||||
onChangedFile: (fileName: string, path: Path) => void,
|
||||
onAffectedFile: (fileName: string, sourceFile: SourceFile) => void
|
||||
) {
|
||||
changedFileNames.forEach((fileName, path) => {
|
||||
onChangedFile(fileName, path as Path);
|
||||
const affectedFiles = getFilesAffectedBy(program, path as Path);
|
||||
for (const file of affectedFiles) {
|
||||
onAffectedFile(file, program.getSourceFile(file));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function enumerateChangedFilesEmitOutput(
|
||||
program: Program,
|
||||
emitOnlyDtsFiles: boolean,
|
||||
onChangedFile: (fileName: string, path: Path) => void,
|
||||
onEmitOutput: (emitOutput: EmitOutputDetailed, sourceFile: SourceFile) => void
|
||||
) {
|
||||
const seenFiles = createMap<true>();
|
||||
enumerateChangedFilesSet(program, onChangedFile, (fileName, sourceFile) => {
|
||||
if (!seenFiles.has(fileName)) {
|
||||
seenFiles.set(fileName, true);
|
||||
if (sourceFile) {
|
||||
// Any affected file shouldnt have the cached diagnostics
|
||||
semanticDiagnosticsPerFile.delete(sourceFile.path);
|
||||
let result: EmitResult[] | undefined;
|
||||
changedFilesSet.forEach((_true, path) => {
|
||||
// Get the affected Files by this program
|
||||
const affectedFiles = getFilesAffectedBy(program, path as Path);
|
||||
affectedFiles.forEach(affectedFile => {
|
||||
// Affected files shouldnt have cached diagnostics
|
||||
semanticDiagnosticsPerFile.delete(affectedFile.path);
|
||||
|
||||
const emitOutput = options.getEmitOutput(program, sourceFile, emitOnlyDtsFiles, /*isDetailed*/ true) as EmitOutputDetailed;
|
||||
onEmitOutput(emitOutput, sourceFile);
|
||||
if (!seenFiles.has(affectedFile.path)) {
|
||||
seenFiles.set(affectedFile.path, true);
|
||||
|
||||
// mark all the emitted source files as seen
|
||||
if (emitOutput.emittedSourceFiles) {
|
||||
for (const file of emitOutput.emittedSourceFiles) {
|
||||
seenFiles.set(file.fileName, true);
|
||||
}
|
||||
}
|
||||
// Emit the affected file
|
||||
(result || (result = [])).push(program.emit(affectedFile, writeFileCallback));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
changedFilesSet.clear();
|
||||
return result || emptyArray;
|
||||
}
|
||||
|
||||
function emitChangedFiles(program: Program): EmitOutputDetailed[] {
|
||||
function getSemanticDiagnostics(program: Program, cancellationToken?: CancellationToken): ReadonlyArray<Diagnostic> {
|
||||
ensureProgramGraph(program);
|
||||
const result: EmitOutputDetailed[] = [];
|
||||
enumerateChangedFilesEmitOutput(program, /*emitOnlyDtsFiles*/ false,
|
||||
/*onChangedFile*/ noop, emitOutput => result.push(emitOutput));
|
||||
changedFileNames.clear();
|
||||
return result;
|
||||
}
|
||||
Debug.assert(changedFilesSet.size === 0);
|
||||
|
||||
function getSemanticDiagnostics(program: Program, cancellationToken?: CancellationToken): Diagnostic[] {
|
||||
ensureProgramGraph(program);
|
||||
|
||||
// Ensure that changed files have cleared their respective
|
||||
enumerateChangedFilesSet(program, /*onChangedFile*/ noop, (_affectedFileName, sourceFile) => {
|
||||
if (sourceFile) {
|
||||
semanticDiagnosticsPerFile.delete(sourceFile.path);
|
||||
}
|
||||
});
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions.outFile || compilerOptions.out) {
|
||||
Debug.assert(semanticDiagnosticsPerFile.size === 0);
|
||||
// We dont need to cache the diagnostics just return them from program
|
||||
return program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken);
|
||||
}
|
||||
|
||||
let diagnostics: Diagnostic[];
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
const path = sourceFile.path;
|
||||
const cachedDiagnostics = semanticDiagnosticsPerFile.get(path);
|
||||
// Report the semantic diagnostics from the cache if we already have those diagnostics present
|
||||
if (cachedDiagnostics) {
|
||||
diagnostics = addRange(diagnostics, cachedDiagnostics);
|
||||
}
|
||||
else {
|
||||
// Diagnostics werent cached, get them from program, and cache the result
|
||||
const cachedDiagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
||||
semanticDiagnosticsPerFile.set(path, cachedDiagnostics);
|
||||
diagnostics = addRange(diagnostics, cachedDiagnostics);
|
||||
}
|
||||
diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken));
|
||||
}
|
||||
return diagnostics || emptyArray;
|
||||
}
|
||||
|
||||
function getSemanticDiagnosticsOfFile(program: Program, sourceFile: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray<Diagnostic> {
|
||||
const path = sourceFile.path;
|
||||
const cachedDiagnostics = semanticDiagnosticsPerFile.get(path);
|
||||
// Report the semantic diagnostics from the cache if we already have those diagnostics present
|
||||
if (cachedDiagnostics) {
|
||||
return cachedDiagnostics;
|
||||
}
|
||||
|
||||
// Diagnostics werent cached, get them from program, and cache the result
|
||||
const diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
||||
semanticDiagnosticsPerFile.set(path, diagnostics);
|
||||
return diagnostics;
|
||||
}
|
||||
|
||||
function clear() {
|
||||
isModuleEmit = undefined;
|
||||
emitHandler = undefined;
|
||||
fileInfos.clear();
|
||||
semanticDiagnosticsPerFile.clear();
|
||||
changedFileNames.clear();
|
||||
changedFilesSet.clear();
|
||||
hasShapeChanged.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -310,15 +274,26 @@ namespace ts {
|
||||
/**
|
||||
* @return {boolean} indicates if the shape signature has changed since last update.
|
||||
*/
|
||||
function updateShapeSignature(program: Program, sourceFile: SourceFile, info: FileInfo) {
|
||||
function updateShapeSignature(program: Program, sourceFile: SourceFile) {
|
||||
Debug.assert(!!sourceFile);
|
||||
|
||||
// If we have cached the result for this file, that means hence forth we should assume file shape is uptodate
|
||||
if (hasShapeChanged.has(sourceFile.path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
hasShapeChanged.set(sourceFile.path, true);
|
||||
const info = fileInfos.get(sourceFile.path);
|
||||
Debug.assert(!!info);
|
||||
|
||||
const prevSignature = info.signature;
|
||||
let latestSignature: string;
|
||||
if (sourceFile.isDeclarationFile) {
|
||||
latestSignature = options.computeHash(sourceFile.text);
|
||||
latestSignature = sourceFile.version;
|
||||
info.signature = latestSignature;
|
||||
}
|
||||
else {
|
||||
const emitOutput = options.getEmitOutput(program, sourceFile, /*emitOnlyDtsFiles*/ true, /*isDetailed*/ false);
|
||||
const emitOutput = getFileEmitOutput(program, sourceFile, /*emitOnlyDtsFiles*/ true);
|
||||
if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) {
|
||||
latestSignature = options.computeHash(emitOutput.outputFiles[0].text);
|
||||
info.signature = latestSignature;
|
||||
@@ -386,24 +361,27 @@ namespace ts {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the emittable files from the program.
|
||||
* @param firstSourceFile This one will be emitted first. See https://github.com/Microsoft/TypeScript/issues/16888
|
||||
* Gets all files of the program excluding the default library file
|
||||
*/
|
||||
function getAllEmittableFiles(program: Program, firstSourceFile: SourceFile): string[] {
|
||||
const defaultLibraryFileName = getDefaultLibFileName(program.getCompilerOptions());
|
||||
const sourceFiles = program.getSourceFiles();
|
||||
const result: string[] = [];
|
||||
add(firstSourceFile);
|
||||
for (const sourceFile of sourceFiles) {
|
||||
function getAllFilesExcludingDefaultLibraryFile(program: Program, firstSourceFile: SourceFile): ReadonlyArray<SourceFile> {
|
||||
// Use cached result
|
||||
if (allFilesExcludingDefaultLibraryFile) {
|
||||
return allFilesExcludingDefaultLibraryFile;
|
||||
}
|
||||
|
||||
let result: SourceFile[];
|
||||
addSourceFile(firstSourceFile);
|
||||
for (const sourceFile of program.getSourceFiles()) {
|
||||
if (sourceFile !== firstSourceFile) {
|
||||
add(sourceFile);
|
||||
addSourceFile(sourceFile);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
allFilesExcludingDefaultLibraryFile = result || emptyArray;
|
||||
return allFilesExcludingDefaultLibraryFile;
|
||||
|
||||
function add(sourceFile: SourceFile): void {
|
||||
if (getBaseFileName(sourceFile.fileName) !== defaultLibraryFileName && options.shouldEmitFile(sourceFile)) {
|
||||
result.push(sourceFile.fileName);
|
||||
function addSourceFile(sourceFile: SourceFile) {
|
||||
if (!program.isSourceFileDefaultLibrary(sourceFile)) {
|
||||
(result || (result = [])).push(sourceFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,14 +395,14 @@ namespace ts {
|
||||
getFilesAffectedByUpdatedShape
|
||||
};
|
||||
|
||||
function getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile, singleFileResult: string[]): string[] {
|
||||
function getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile): ReadonlyArray<SourceFile> {
|
||||
const options = program.getCompilerOptions();
|
||||
// If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project,
|
||||
// so returning the file itself is good enough.
|
||||
if (options && (options.out || options.outFile)) {
|
||||
return singleFileResult;
|
||||
return [sourceFile];
|
||||
}
|
||||
return getAllEmittableFiles(program, sourceFile);
|
||||
return getAllFilesExcludingDefaultLibraryFile(program, sourceFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +459,7 @@ namespace ts {
|
||||
// add files referencing the removedFilePath, as changed files too
|
||||
const referencedByInfo = fileInfos.get(filePath);
|
||||
if (referencedByInfo) {
|
||||
registerChangedFile(filePath as Path, referencedByInfo.fileName);
|
||||
registerChangedFile(filePath as Path);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -495,37 +473,33 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
function getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile, singleFileResult: string[]): string[] {
|
||||
function getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile): ReadonlyArray<SourceFile> {
|
||||
if (!isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) {
|
||||
return getAllEmittableFiles(program, sourceFile);
|
||||
return getAllFilesExcludingDefaultLibraryFile(program, sourceFile);
|
||||
}
|
||||
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) {
|
||||
return singleFileResult;
|
||||
return [sourceFile];
|
||||
}
|
||||
|
||||
// Now we need to if each file in the referencedBy list has a shape change as well.
|
||||
// Because if so, its own referencedBy files need to be saved as well to make the
|
||||
// emitting result consistent with files on disk.
|
||||
|
||||
const seenFileNamesMap = createMap<string>();
|
||||
const setSeenFileName = (path: Path, sourceFile: SourceFile) => {
|
||||
seenFileNamesMap.set(path, sourceFile && options.shouldEmitFile(sourceFile) ? sourceFile.fileName : undefined);
|
||||
};
|
||||
const seenFileNamesMap = createMap<SourceFile>();
|
||||
|
||||
// Start with the paths this file was referenced by
|
||||
const path = sourceFile.path;
|
||||
setSeenFileName(path, sourceFile);
|
||||
seenFileNamesMap.set(path, sourceFile);
|
||||
const queue = getReferencedByPaths(path);
|
||||
while (queue.length > 0) {
|
||||
const currentPath = queue.pop();
|
||||
if (!seenFileNamesMap.has(currentPath)) {
|
||||
const currentSourceFile = program.getSourceFileByPath(currentPath);
|
||||
if (currentSourceFile && updateShapeSignature(program, currentSourceFile, fileInfos.get(currentPath))) {
|
||||
seenFileNamesMap.set(currentPath, currentSourceFile);
|
||||
if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) {
|
||||
queue.push(...getReferencedByPaths(currentPath));
|
||||
}
|
||||
setSeenFileName(currentPath, currentSourceFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
-16
@@ -314,6 +314,7 @@ namespace ts {
|
||||
const jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false);
|
||||
|
||||
const globals = createSymbolTable();
|
||||
let ambientModulesCache: Symbol[] | undefined;
|
||||
/**
|
||||
* List of every ambient module with a "*" wildcard.
|
||||
* Unlike other ambient modules, these can't be stored in `globals` because symbol tables only deal with exact matches.
|
||||
@@ -7029,13 +7030,11 @@ namespace ts {
|
||||
function getIntendedTypeFromJSDocTypeReference(node: TypeReferenceNode): Type {
|
||||
if (isIdentifier(node.typeName)) {
|
||||
if (node.typeName.escapedText === "Object") {
|
||||
if (node.typeArguments && node.typeArguments.length === 2) {
|
||||
if (isJSDocIndexSignature(node)) {
|
||||
const indexed = getTypeFromTypeNode(node.typeArguments[0]);
|
||||
const target = getTypeFromTypeNode(node.typeArguments[1]);
|
||||
const index = createIndexInfo(target, /*isReadonly*/ false);
|
||||
if (indexed === stringType || indexed === numberType) {
|
||||
return createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, indexed === stringType && index, indexed === numberType && index);
|
||||
}
|
||||
return createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, indexed === stringType && index, indexed === numberType && index);
|
||||
}
|
||||
return anyType;
|
||||
}
|
||||
@@ -7971,7 +7970,7 @@ namespace ts {
|
||||
|
||||
const spread = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo);
|
||||
spread.flags |= propagatedFlags;
|
||||
spread.flags |= TypeFlags.FreshLiteral;
|
||||
spread.flags |= TypeFlags.FreshLiteral | TypeFlags.ContainsObjectLiteral;
|
||||
(spread as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral;
|
||||
spread.symbol = symbol;
|
||||
return spread;
|
||||
@@ -11377,6 +11376,16 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getTypeWithFacts(type: Type, include: TypeFacts) {
|
||||
if (type.flags & TypeFlags.IndexedAccess) {
|
||||
// TODO (weswig): This is a substitute for a lazy negated type to remove the types indicated by the TypeFacts from the (potential) union the IndexedAccess refers to
|
||||
// - See discussion in https://github.com/Microsoft/TypeScript/pull/19275 for details, and test `strictNullNotNullIndexTypeShouldWork` for current behavior
|
||||
const baseConstraint = getBaseConstraintOfType(type) || emptyObjectType;
|
||||
const result = filterType(baseConstraint, t => (getTypeFacts(t) & include) !== 0);
|
||||
if (result !== baseConstraint) {
|
||||
return result;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
return filterType(type, t => (getTypeFacts(t) & include) !== 0);
|
||||
}
|
||||
|
||||
@@ -15014,7 +15023,7 @@ namespace ts {
|
||||
|
||||
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
||||
|
||||
markPropertyAsReferenced(prop, node);
|
||||
markPropertyAsReferenced(prop, node, left.kind === SyntaxKind.ThisKeyword);
|
||||
|
||||
getNodeLinks(node).resolvedSymbol = prop;
|
||||
|
||||
@@ -15204,12 +15213,21 @@ namespace ts {
|
||||
return bestCandidate;
|
||||
}
|
||||
|
||||
function markPropertyAsReferenced(prop: Symbol, nodeForCheckWriteOnly: Node | undefined) {
|
||||
function markPropertyAsReferenced(prop: Symbol, nodeForCheckWriteOnly: Node | undefined, isThisAccess: boolean) {
|
||||
if (prop &&
|
||||
noUnusedIdentifiers &&
|
||||
(prop.flags & SymbolFlags.ClassMember) &&
|
||||
prop.valueDeclaration && hasModifier(prop.valueDeclaration, ModifierFlags.Private)
|
||||
&& !(nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly))) {
|
||||
|
||||
if (isThisAccess) {
|
||||
// Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters).
|
||||
const containingMethod = findAncestor(nodeForCheckWriteOnly, isFunctionLikeDeclaration);
|
||||
if (containingMethod && containingMethod.symbol === prop) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (getCheckFlags(prop) & CheckFlags.Instantiated) {
|
||||
getSymbolLinks(prop).target.isReferenced = true;
|
||||
}
|
||||
@@ -19156,7 +19174,10 @@ namespace ts {
|
||||
// There is no resolved symbol cached if the type resolved to a builtin
|
||||
// via JSDoc type reference resolution (eg, Boolean became boolean), none
|
||||
// of which are generic when they have no associated symbol
|
||||
error(node, Diagnostics.Type_0_is_not_generic, typeToString(type));
|
||||
// (additionally, JSDoc's index signature syntax, Object<string, T> actually uses generic syntax without being generic)
|
||||
if (!isJSDocIndexSignature(node)) {
|
||||
error(node, Diagnostics.Type_0_is_not_generic, typeToString(type));
|
||||
}
|
||||
return;
|
||||
}
|
||||
let typeParameters = symbol.flags & SymbolFlags.TypeAlias && getSymbolLinks(symbol).typeParameters;
|
||||
@@ -20702,7 +20723,7 @@ namespace ts {
|
||||
const parentType = getTypeForBindingElementParent(parent);
|
||||
const name = node.propertyName || <Identifier>node.name;
|
||||
const property = getPropertyOfType(parentType, getTextOfPropertyName(name));
|
||||
markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined); // A destructuring is never a write-only reference.
|
||||
markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference.
|
||||
if (parent.initializer && property) {
|
||||
checkPropertyAccessibility(parent, parent.initializer, parentType, property);
|
||||
}
|
||||
@@ -25560,13 +25581,16 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getAmbientModules(): Symbol[] {
|
||||
const result: Symbol[] = [];
|
||||
globals.forEach((global, sym) => {
|
||||
if (ambientModuleSymbolRegex.test(unescapeLeadingUnderscores(sym))) {
|
||||
result.push(global);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
if (!ambientModulesCache) {
|
||||
ambientModulesCache = [];
|
||||
globals.forEach((global, sym) => {
|
||||
// No need to `unescapeLeadingUnderscores`, an escaped symbol is never an ambient module.
|
||||
if (ambientModuleSymbolRegex.test(sym as string)) {
|
||||
ambientModulesCache.push(global);
|
||||
}
|
||||
});
|
||||
}
|
||||
return ambientModulesCache;
|
||||
}
|
||||
|
||||
function checkGrammarImportCallExpression(node: ImportCall): boolean {
|
||||
|
||||
@@ -1183,8 +1183,8 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isDoubleQuotedString(node: Node) {
|
||||
return node.kind === SyntaxKind.StringLiteral && getSourceTextOfNodeFromSourceFile(sourceFile, node).charCodeAt(0) === CharacterCodes.doubleQuote;
|
||||
function isDoubleQuotedString(node: Node): boolean {
|
||||
return isStringLiteral(node) && isStringDoubleQuoted(node, sourceFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1440,9 +1440,9 @@ namespace ts {
|
||||
|
||||
function getFileNames(): ExpandResult {
|
||||
let filesSpecs: ReadonlyArray<string>;
|
||||
if (hasProperty(raw, "files") && !isNullOrUndefined(raw["files"])) {
|
||||
if (isArray(raw["files"])) {
|
||||
filesSpecs = <ReadonlyArray<string>>raw["files"];
|
||||
if (hasProperty(raw, "files") && !isNullOrUndefined(raw.files)) {
|
||||
if (isArray(raw.files)) {
|
||||
filesSpecs = <ReadonlyArray<string>>raw.files;
|
||||
if (filesSpecs.length === 0) {
|
||||
createCompilerDiagnosticOnlyIfJson(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json");
|
||||
}
|
||||
@@ -1453,9 +1453,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
let includeSpecs: ReadonlyArray<string>;
|
||||
if (hasProperty(raw, "include") && !isNullOrUndefined(raw["include"])) {
|
||||
if (isArray(raw["include"])) {
|
||||
includeSpecs = <ReadonlyArray<string>>raw["include"];
|
||||
if (hasProperty(raw, "include") && !isNullOrUndefined(raw.include)) {
|
||||
if (isArray(raw.include)) {
|
||||
includeSpecs = <ReadonlyArray<string>>raw.include;
|
||||
}
|
||||
else {
|
||||
createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "include", "Array");
|
||||
@@ -1463,16 +1463,16 @@ namespace ts {
|
||||
}
|
||||
|
||||
let excludeSpecs: ReadonlyArray<string>;
|
||||
if (hasProperty(raw, "exclude") && !isNullOrUndefined(raw["exclude"])) {
|
||||
if (isArray(raw["exclude"])) {
|
||||
excludeSpecs = <ReadonlyArray<string>>raw["exclude"];
|
||||
if (hasProperty(raw, "exclude") && !isNullOrUndefined(raw.exclude)) {
|
||||
if (isArray(raw.exclude)) {
|
||||
excludeSpecs = <ReadonlyArray<string>>raw.exclude;
|
||||
}
|
||||
else {
|
||||
createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "exclude", "Array");
|
||||
}
|
||||
}
|
||||
else {
|
||||
const outDir = raw["compilerOptions"] && raw["compilerOptions"]["outDir"];
|
||||
const outDir = raw.compilerOptions && raw.compilerOptions.outDir;
|
||||
if (outDir) {
|
||||
excludeSpecs = [outDir];
|
||||
}
|
||||
@@ -1591,7 +1591,7 @@ namespace ts {
|
||||
const options = convertCompilerOptionsFromJsonWorker(json.compilerOptions, basePath, errors, configFileName);
|
||||
// typingOptions has been deprecated and is only supported for backward compatibility purposes.
|
||||
// It should be removed in future releases - use typeAcquisition instead.
|
||||
const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json["typeAcquisition"] || json["typingOptions"], basePath, errors, configFileName);
|
||||
const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName);
|
||||
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
||||
let extendedConfigPath: Path;
|
||||
|
||||
@@ -1748,7 +1748,7 @@ namespace ts {
|
||||
if (!hasProperty(jsonOption, compileOnSaveCommandLineOption.name)) {
|
||||
return undefined;
|
||||
}
|
||||
const result = convertJsonOption(compileOnSaveCommandLineOption, jsonOption["compileOnSave"], basePath, errors);
|
||||
const result = convertJsonOption(compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors);
|
||||
if (typeof result === "boolean" && result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
+47
-6
@@ -33,8 +33,8 @@ namespace ts {
|
||||
// Using 'delete' on an object causes V8 to put the object in dictionary mode.
|
||||
// This disables creation of hidden classes, which are expensive when an object is
|
||||
// constantly changing shape.
|
||||
map["__"] = undefined;
|
||||
delete map["__"];
|
||||
map.__ = undefined;
|
||||
delete map.__;
|
||||
|
||||
return map;
|
||||
}
|
||||
@@ -191,6 +191,18 @@ namespace ts {
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */
|
||||
export function firstDefined<T, U>(array: ReadonlyArray<T> | undefined, callback: (element: T, index: number) => U | undefined): U | undefined {
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
const result = callback(array[i], i);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return 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.
|
||||
@@ -261,6 +273,16 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function findLast<T>(array: ReadonlyArray<T>, predicate: (element: T, index: number) => boolean): T | undefined {
|
||||
for (let i = array.length - 1; i >= 0; i--) {
|
||||
const value = array[i];
|
||||
if (predicate(value, i)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */
|
||||
export function findIndex<T>(array: ReadonlyArray<T>, predicate: (element: T, index: number) => boolean): number {
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
@@ -1147,6 +1169,14 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function arrayToNumericMap<T>(array: ReadonlyArray<T>, makeKey: (value: T) => number): T[] {
|
||||
const result: T[] = [];
|
||||
for (const value of array) {
|
||||
result[makeKey(value)] = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a set from the elements of an array.
|
||||
*
|
||||
@@ -1831,7 +1861,7 @@ namespace ts {
|
||||
return i < 0 ? path : path.substring(i + 1);
|
||||
}
|
||||
|
||||
export function combinePaths(path1: string, path2: string) {
|
||||
export function combinePaths(path1: string, path2: string): string {
|
||||
if (!(path1 && path1.length)) return path2;
|
||||
if (!(path2 && path2.length)) return path1;
|
||||
if (getRootLength(path2) !== 0) return path2;
|
||||
@@ -2681,8 +2711,14 @@ namespace ts {
|
||||
|
||||
export function assertTypeIsNever(_: never): void { }
|
||||
|
||||
export interface FileAndDirectoryExistence {
|
||||
fileExists: boolean;
|
||||
directoryExists: boolean;
|
||||
}
|
||||
|
||||
export interface CachedDirectoryStructureHost extends DirectoryStructureHost {
|
||||
addOrDeleteFileOrDirectory(fileOrDirectory: string, fileOrDirectoryPath: Path): void;
|
||||
/** Returns the queried result for the file exists and directory exists if at all it was done */
|
||||
addOrDeleteFileOrDirectory(fileOrDirectory: string, fileOrDirectoryPath: Path): FileAndDirectoryExistence | undefined;
|
||||
addOrDeleteFile(fileName: string, filePath: Path, eventKind: FileWatcherEventKind): void;
|
||||
clearCache(): void;
|
||||
}
|
||||
@@ -2852,8 +2888,13 @@ namespace ts {
|
||||
if (parentResult) {
|
||||
const baseName = getBaseNameOfFileName(fileOrDirectory);
|
||||
if (parentResult) {
|
||||
updateFilesOfFileSystemEntry(parentResult, baseName, host.fileExists(fileOrDirectoryPath));
|
||||
updateFileSystemEntry(parentResult.directories, baseName, host.directoryExists(fileOrDirectoryPath));
|
||||
const fsQueryResult: FileAndDirectoryExistence = {
|
||||
fileExists: host.fileExists(fileOrDirectoryPath),
|
||||
directoryExists: host.directoryExists(fileOrDirectoryPath)
|
||||
};
|
||||
updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists);
|
||||
updateFileSystemEntry(parentResult.directories, baseName, fsQueryResult.directoryExists);
|
||||
return fsQueryResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3657,7 +3657,7 @@
|
||||
"category": "Error",
|
||||
"code": 90010
|
||||
},
|
||||
"Import {0} from {1}.": {
|
||||
"Import '{0}' from \"{1}\".": {
|
||||
"category": "Message",
|
||||
"code": 90013
|
||||
},
|
||||
@@ -3665,7 +3665,7 @@
|
||||
"category": "Message",
|
||||
"code": 90014
|
||||
},
|
||||
"Add {0} to existing import declaration from {1}.": {
|
||||
"Add '{0}' to existing import declaration from \"{1}\".": {
|
||||
"category": "Message",
|
||||
"code": 90015
|
||||
},
|
||||
|
||||
@@ -128,7 +128,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function getEffectiveTypeRoots(options: CompilerOptions, host: { directoryExists?: (directoryName: string) => boolean, getCurrentDirectory?: () => string }): string[] | undefined {
|
||||
export interface GetEffectiveTypeRootsHost {
|
||||
directoryExists?(directoryName: string): boolean;
|
||||
getCurrentDirectory?(): string;
|
||||
}
|
||||
export function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined {
|
||||
if (options.typeRoots) {
|
||||
return options.typeRoots;
|
||||
}
|
||||
@@ -1001,7 +1005,8 @@ namespace ts {
|
||||
return withPackageId(packageId, pathAndExtension);
|
||||
}
|
||||
|
||||
function getPackageName(moduleName: string): { packageName: string, rest: string } {
|
||||
/* @internal */
|
||||
export function getPackageName(moduleName: string): { packageName: string, rest: string } {
|
||||
let idx = moduleName.indexOf(directorySeparator);
|
||||
if (moduleName[0] === "@") {
|
||||
idx = moduleName.indexOf(directorySeparator, idx + 1);
|
||||
@@ -1059,18 +1064,27 @@ namespace ts {
|
||||
const mangledScopedPackageSeparator = "__";
|
||||
|
||||
/** For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. */
|
||||
function mangleScopedPackage(moduleName: string, state: ModuleResolutionState): string {
|
||||
if (startsWith(moduleName, "@")) {
|
||||
const replaceSlash = moduleName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
|
||||
if (replaceSlash !== moduleName) {
|
||||
const mangled = replaceSlash.slice(1); // Take off the "@"
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, Diagnostics.Scoped_package_detected_looking_in_0, mangled);
|
||||
}
|
||||
return mangled;
|
||||
function mangleScopedPackage(packageName: string, state: ModuleResolutionState): string {
|
||||
const mangled = getMangledNameForScopedPackage(packageName);
|
||||
if (state.traceEnabled && mangled !== packageName) {
|
||||
trace(state.host, Diagnostics.Scoped_package_detected_looking_in_0, mangled);
|
||||
}
|
||||
return mangled;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function getTypesPackageName(packageName: string): string {
|
||||
return `@types/${getMangledNameForScopedPackage(packageName)}`;
|
||||
}
|
||||
|
||||
function getMangledNameForScopedPackage(packageName: string): string {
|
||||
if (startsWith(packageName, "@")) {
|
||||
const replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
|
||||
if (replaceSlash !== packageName) {
|
||||
return replaceSlash.slice(1); // Take off the "@"
|
||||
}
|
||||
}
|
||||
return moduleName;
|
||||
return packageName;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace ts {
|
||||
interface DirectoryOfFailedLookupWatch {
|
||||
dir: string;
|
||||
dirPath: Path;
|
||||
ignore?: true;
|
||||
}
|
||||
|
||||
export const maxNumberOfFilesToIterateForInvalidation = 256;
|
||||
@@ -319,6 +320,33 @@ namespace ts {
|
||||
return endsWith(dirPath, "/node_modules");
|
||||
}
|
||||
|
||||
function isDirectoryAtleastAtLevelFromFSRoot(dirPath: Path, minLevels: number) {
|
||||
for (let searchIndex = getRootLength(dirPath); minLevels > 0; minLevels--) {
|
||||
searchIndex = dirPath.indexOf(directorySeparator, searchIndex) + 1;
|
||||
if (searchIndex === 0) {
|
||||
// Folder isnt at expected minimun levels
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function canWatchDirectory(dirPath: Path) {
|
||||
return isDirectoryAtleastAtLevelFromFSRoot(dirPath,
|
||||
// When root is "/" do not watch directories like:
|
||||
// "/", "/user", "/user/username", "/user/username/folderAtRoot"
|
||||
// When root is "c:/" do not watch directories like:
|
||||
// "c:/", "c:/folderAtRoot"
|
||||
dirPath.charCodeAt(0) === CharacterCodes.slash ? 3 : 1);
|
||||
}
|
||||
|
||||
function filterFSRootDirectoriesToWatch(watchPath: DirectoryOfFailedLookupWatch, dirPath: Path): DirectoryOfFailedLookupWatch {
|
||||
if (!canWatchDirectory(dirPath)) {
|
||||
watchPath.ignore = true;
|
||||
}
|
||||
return watchPath;
|
||||
}
|
||||
|
||||
function getDirectoryToWatchFailedLookupLocation(failedLookupLocation: string, failedLookupLocationPath: Path): DirectoryOfFailedLookupWatch {
|
||||
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
|
||||
return { dir: rootDir, dirPath: rootPath };
|
||||
@@ -335,7 +363,7 @@ namespace ts {
|
||||
|
||||
// If the directory is node_modules use it to watch
|
||||
if (isNodeModulesDirectory(dirPath)) {
|
||||
return { dir, dirPath };
|
||||
return filterFSRootDirectoriesToWatch({ dir, dirPath }, getDirectoryPath(dirPath));
|
||||
}
|
||||
|
||||
// Use some ancestor of the root directory
|
||||
@@ -350,7 +378,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
return { dir, dirPath };
|
||||
return filterFSRootDirectoriesToWatch({ dir, dirPath }, dirPath);
|
||||
}
|
||||
|
||||
function isPathWithDefaultFailedLookupExtension(path: Path) {
|
||||
@@ -391,13 +419,15 @@ namespace ts {
|
||||
const refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
|
||||
customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
|
||||
}
|
||||
const { dir, dirPath } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
|
||||
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
if (dirWatcher) {
|
||||
dirWatcher.refCount++;
|
||||
}
|
||||
else {
|
||||
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
|
||||
const { dir, dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
|
||||
if (!ignore) {
|
||||
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
if (dirWatcher) {
|
||||
dirWatcher.refCount++;
|
||||
}
|
||||
else {
|
||||
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,10 +452,12 @@ namespace ts {
|
||||
customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1);
|
||||
}
|
||||
}
|
||||
const { dirPath } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
|
||||
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
// Do not close the watcher yet since it might be needed by other failed lookup locations.
|
||||
dirWatcher.refCount--;
|
||||
const { dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
|
||||
if (!ignore) {
|
||||
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
||||
// Do not close the watcher yet since it might be needed by other failed lookup locations.
|
||||
dirWatcher.refCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +609,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
// we need to assume the directories exist to ensure that we can get all the type root directories that get included
|
||||
const typeRoots = getEffectiveTypeRoots(options, { directoryExists: returnTrue, getCurrentDirectory });
|
||||
// But filter directories that are at root level to say directory doesnt exist, so that we arent watching them
|
||||
const typeRoots = getEffectiveTypeRoots(options, { directoryExists: directoryExistsForTypeRootWatch, getCurrentDirectory });
|
||||
if (typeRoots) {
|
||||
mutateMap(
|
||||
typeRootsWatches,
|
||||
@@ -592,5 +625,16 @@ namespace ts {
|
||||
closeTypeRootsWatch();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this function to return if directory exists to get type roots to watch
|
||||
* If we return directory exists then only the paths will be added to type roots
|
||||
* Hence return true for all directories except root directories which are filtered from watching
|
||||
*/
|
||||
function directoryExistsForTypeRootWatch(nodeTypesDirectory: string) {
|
||||
const dir = getDirectoryPath(getDirectoryPath(nodeTypesDirectory));
|
||||
const dirPath = resolutionHost.toPath(dir);
|
||||
return dirPath === rootPath || canWatchDirectory(dirPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ namespace ts {
|
||||
const _os = require("os");
|
||||
const _crypto = require("crypto");
|
||||
|
||||
const useNonPollingWatchers = process.env["TSC_NONPOLLING_WATCHER"];
|
||||
const useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER;
|
||||
|
||||
function createWatchedFileSet() {
|
||||
const dirWatchers = createMap<DirectoryWatcher>();
|
||||
@@ -573,7 +573,7 @@ namespace ts {
|
||||
|
||||
function recursiveCreateDirectory(directoryPath: string, sys: System) {
|
||||
const basePath = getDirectoryPath(directoryPath);
|
||||
const shouldCreateParent = directoryPath !== basePath && !sys.directoryExists(basePath);
|
||||
const shouldCreateParent = basePath !== "" && directoryPath !== basePath && !sys.directoryExists(basePath);
|
||||
if (shouldCreateParent) {
|
||||
recursiveCreateDirectory(basePath, sys);
|
||||
}
|
||||
|
||||
@@ -1055,6 +1055,7 @@ namespace ts {
|
||||
export interface StringLiteral extends LiteralExpression {
|
||||
kind: SyntaxKind.StringLiteral;
|
||||
/* @internal */ textSourceNode?: Identifier | StringLiteral | NumericLiteral; // Allows a StringLiteral to get its text from another node (used by transforms).
|
||||
/** Note: this is only set when synthesizing a node, not during parsing. */
|
||||
/* @internal */ singleQuote?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -520,6 +520,17 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function isAnyImportSyntax(node: Node): node is AnyImportSyntax {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
case SyntaxKind.ImportEqualsDeclaration:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the nearest enclosing block scope container that has the provided node
|
||||
// as a descendant, that is not the provided node.
|
||||
export function getEnclosingBlockScopeContainer(node: Node): Node {
|
||||
@@ -1349,6 +1360,14 @@ namespace ts {
|
||||
return node && !!(node.flags & NodeFlags.JSDoc);
|
||||
}
|
||||
|
||||
export function isJSDocIndexSignature(node: TypeReferenceNode | ExpressionWithTypeArguments) {
|
||||
return isTypeReferenceNode(node) &&
|
||||
isIdentifier(node.typeName) &&
|
||||
node.typeName.escapedText === "Object" &&
|
||||
node.typeArguments && node.typeArguments.length === 2 &&
|
||||
(node.typeArguments[0].kind === SyntaxKind.StringKeyword || node.typeArguments[0].kind === SyntaxKind.NumberKeyword);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the node is a CallExpression to the identifier 'require' with
|
||||
* exactly one argument (of the form 'require("name")').
|
||||
@@ -1375,6 +1394,10 @@ namespace ts {
|
||||
return charCode === CharacterCodes.singleQuote || charCode === CharacterCodes.doubleQuote;
|
||||
}
|
||||
|
||||
export function isStringDoubleQuoted(string: StringLiteral, sourceFile: SourceFile): boolean {
|
||||
return getSourceTextOfNodeFromSourceFile(sourceFile, string).charCodeAt(0) === CharacterCodes.doubleQuote;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the node is a variable declaration whose initializer is a function expression.
|
||||
* This function does not test if the node is in a JavaScript file or not.
|
||||
@@ -3184,7 +3207,7 @@ namespace ts {
|
||||
|
||||
const carriageReturnLineFeed = "\r\n";
|
||||
const lineFeed = "\n";
|
||||
export function getNewLineCharacter(options: CompilerOptions | PrinterOptions, system?: System): string {
|
||||
export function getNewLineCharacter(options: CompilerOptions | PrinterOptions, system?: { newLine: string }): string {
|
||||
switch (options.newLine) {
|
||||
case NewLineKind.CarriageReturnLineFeed:
|
||||
return carriageReturnLineFeed;
|
||||
|
||||
+26
-25
@@ -144,13 +144,14 @@ namespace ts {
|
||||
|
||||
function compileWatchedProgram(host: DirectoryStructureHost, program: Program, builder: Builder) {
|
||||
// First get and report any syntactic errors.
|
||||
let diagnostics = program.getSyntacticDiagnostics().slice();
|
||||
const diagnostics = program.getSyntacticDiagnostics().slice();
|
||||
let reportSemanticDiagnostics = false;
|
||||
|
||||
// If we didn't have any syntactic errors, then also try getting the global and
|
||||
// semantic errors.
|
||||
if (diagnostics.length === 0) {
|
||||
diagnostics = program.getOptionsDiagnostics().concat(program.getGlobalDiagnostics());
|
||||
addRange(diagnostics, program.getOptionsDiagnostics());
|
||||
addRange(diagnostics, program.getGlobalDiagnostics());
|
||||
|
||||
if (diagnostics.length === 0) {
|
||||
reportSemanticDiagnostics = true;
|
||||
@@ -162,7 +163,7 @@ namespace ts {
|
||||
let sourceMaps: SourceMapData[];
|
||||
let emitSkipped: boolean;
|
||||
|
||||
const result = builder.emitChangedFiles(program);
|
||||
const result = builder.emitChangedFiles(program, writeFile);
|
||||
if (result.length === 0) {
|
||||
emitSkipped = true;
|
||||
}
|
||||
@@ -171,14 +172,13 @@ namespace ts {
|
||||
if (emitOutput.emitSkipped) {
|
||||
emitSkipped = true;
|
||||
}
|
||||
diagnostics = concatenate(diagnostics, emitOutput.diagnostics);
|
||||
addRange(diagnostics, emitOutput.diagnostics);
|
||||
sourceMaps = concatenate(sourceMaps, emitOutput.sourceMaps);
|
||||
writeOutputFiles(emitOutput.outputFiles);
|
||||
}
|
||||
}
|
||||
|
||||
if (reportSemanticDiagnostics) {
|
||||
diagnostics = diagnostics.concat(builder.getSemanticDiagnostics(program));
|
||||
addRange(diagnostics, builder.getSemanticDiagnostics(program));
|
||||
}
|
||||
return handleEmitOutputAndReportErrors(host, program, emittedFiles, emitSkipped,
|
||||
diagnostics, reportDiagnostic);
|
||||
@@ -191,31 +191,23 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function writeFile(fileName: string, data: string, writeByteOrderMark: boolean) {
|
||||
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, onError: (message: string) => void) {
|
||||
try {
|
||||
performance.mark("beforeIOWrite");
|
||||
ensureDirectoriesExist(getDirectoryPath(normalizePath(fileName)));
|
||||
|
||||
host.writeFile(fileName, data, writeByteOrderMark);
|
||||
host.writeFile(fileName, text, writeByteOrderMark);
|
||||
|
||||
performance.mark("afterIOWrite");
|
||||
performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
|
||||
|
||||
if (emittedFiles) {
|
||||
emittedFiles.push(fileName);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
return createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, e);
|
||||
}
|
||||
}
|
||||
|
||||
function writeOutputFiles(outputFiles: OutputFile[]) {
|
||||
if (outputFiles) {
|
||||
for (const outputFile of outputFiles) {
|
||||
const error = writeFile(outputFile.name, outputFile.text, outputFile.writeByteOrderMark);
|
||||
if (error) {
|
||||
diagnostics.push(error);
|
||||
}
|
||||
if (emittedFiles) {
|
||||
emittedFiles.push(outputFile.name);
|
||||
}
|
||||
if (onError) {
|
||||
onError(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,7 +300,7 @@ namespace ts {
|
||||
getCurrentDirectory()
|
||||
);
|
||||
// There is no extra check needed since we can just rely on the program to decide emit
|
||||
const builder = createBuilder({ getCanonicalFileName, getEmitOutput: getFileEmitOutput, computeHash, shouldEmitFile: () => true });
|
||||
const builder = createBuilder({ getCanonicalFileName, computeHash });
|
||||
|
||||
synchronizeProgram();
|
||||
|
||||
@@ -605,8 +597,17 @@ namespace ts {
|
||||
const fileOrDirectoryPath = toPath(fileOrDirectory);
|
||||
|
||||
// Since the file existance changed, update the sourceFiles cache
|
||||
(directoryStructureHost as CachedDirectoryStructureHost).addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
removeSourceFile(fileOrDirectoryPath);
|
||||
const result = (directoryStructureHost as CachedDirectoryStructureHost).addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
|
||||
// Instead of deleting the file, mark it as changed instead
|
||||
// Many times node calls add/remove/file when watching directories recursively
|
||||
const hostSourceFile = sourceFilesCache.get(fileOrDirectoryPath);
|
||||
if (hostSourceFile && !isString(hostSourceFile) && (result ? result.fileExists : directoryStructureHost.fileExists(fileOrDirectory))) {
|
||||
hostSourceFile.version++;
|
||||
}
|
||||
else {
|
||||
removeSourceFile(fileOrDirectoryPath);
|
||||
}
|
||||
|
||||
// If the the added or created file or directory is not supported file name, ignore the file
|
||||
// But when watched directory is added/removed, we need to reload the file list
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/// <reference path="core.ts" />
|
||||
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
/**
|
||||
* Updates the existing missing file watches with the new set of missing files after new program is created
|
||||
@@ -72,10 +73,7 @@ namespace ts {
|
||||
existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
export function addFileWatcher(host: System, file: string, cb: FileWatcherCallback): FileWatcher {
|
||||
return host.watchFile(file, cb);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
}
|
||||
|
||||
public checkTestCodeOutput(fileName: string) {
|
||||
describe("compiler tests for " + fileName, () => {
|
||||
describe(`${this.testSuiteName} tests for ${fileName}`, () => {
|
||||
// Mocha holds onto the closure environment of the describe callback even after the test is done.
|
||||
// Everything declared here should be cleared out in the "after" callback.
|
||||
let justName: string;
|
||||
@@ -80,9 +80,9 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
tsConfigFiles.push(this.createHarnessTestFile(testCaseContent.tsConfigFileUnitData, rootDir, ts.combinePaths(rootDir, tsConfigOptions.configFilePath)));
|
||||
}
|
||||
else {
|
||||
const baseUrl = harnessSettings["baseUrl"];
|
||||
const baseUrl = harnessSettings.baseUrl;
|
||||
if (baseUrl !== undefined && !ts.isRootedDiskPath(baseUrl)) {
|
||||
harnessSettings["baseUrl"] = ts.getNormalizedAbsolutePath(baseUrl, rootDir);
|
||||
harnessSettings.baseUrl = ts.getNormalizedAbsolutePath(baseUrl, rootDir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
toBeCompiled = [];
|
||||
otherFiles = [];
|
||||
|
||||
if (testCaseContent.settings["noImplicitReferences"] || /require\(/.test(lastUnit.content) || /reference\spath/.test(lastUnit.content)) {
|
||||
if (testCaseContent.settings.noImplicitReferences || /require\(/.test(lastUnit.content) || /reference\spath/.test(lastUnit.content)) {
|
||||
toBeCompiled.push(this.createHarnessTestFile(lastUnit, rootDir));
|
||||
units.forEach(unit => {
|
||||
if (unit.name !== lastUnit.name) {
|
||||
@@ -114,7 +114,7 @@ class CompilerBaselineRunner extends RunnerBase {
|
||||
}
|
||||
|
||||
const output = Harness.Compiler.compileFiles(
|
||||
toBeCompiled, otherFiles, harnessSettings, /*options*/ tsConfigOptions, /*currentDirectory*/ harnessSettings["currentDirectory"]);
|
||||
toBeCompiled, otherFiles, harnessSettings, /*options*/ tsConfigOptions, /*currentDirectory*/ harnessSettings.currentDirectory);
|
||||
|
||||
options = output.options;
|
||||
result = output.result;
|
||||
|
||||
+111
-21
@@ -783,10 +783,10 @@ namespace FourSlash {
|
||||
});
|
||||
}
|
||||
|
||||
public verifyCompletionListContains(symbol: string, text?: string, documentation?: string, kind?: string, spanIndex?: number) {
|
||||
public verifyCompletionListContains(symbol: string, text?: string, documentation?: string, kind?: string, spanIndex?: number, hasAction?: boolean) {
|
||||
const completions = this.getCompletionListAtCaret();
|
||||
if (completions) {
|
||||
this.assertItemInCompletionList(completions.entries, symbol, text, documentation, kind, spanIndex);
|
||||
this.assertItemInCompletionList(completions.entries, symbol, text, documentation, kind, spanIndex, hasAction);
|
||||
}
|
||||
else {
|
||||
this.raiseError(`No completions at position '${this.currentCaretPosition}' when looking for '${symbol}'.`);
|
||||
@@ -953,6 +953,10 @@ namespace FourSlash {
|
||||
return this.getChecker().getSymbolsInScope(node, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace);
|
||||
}
|
||||
|
||||
public setTypesRegistry(map: ts.MapLike<void>): void {
|
||||
this.languageServiceAdapterHost.typesRegistry = ts.createMapFromTemplate(map);
|
||||
}
|
||||
|
||||
public verifyTypeOfSymbolAtLocation(range: Range, symbol: ts.Symbol, expected: string): void {
|
||||
const node = this.goToAndGetNode(range);
|
||||
const checker = this.getChecker();
|
||||
@@ -1127,7 +1131,7 @@ Actual: ${stringify(fullActual)}`);
|
||||
}
|
||||
|
||||
private getCompletionEntryDetails(entryName: string) {
|
||||
return this.languageService.getCompletionEntryDetails(this.activeFile.fileName, this.currentCaretPosition, entryName);
|
||||
return this.languageService.getCompletionEntryDetails(this.activeFile.fileName, this.currentCaretPosition, entryName, this.formatCodeSettings);
|
||||
}
|
||||
|
||||
private getReferencesAtCaret() {
|
||||
@@ -2289,6 +2293,29 @@ Actual: ${stringify(fullActual)}`);
|
||||
this.applyCodeActions(this.getCodeFixActions(fileName, errorCode), index);
|
||||
}
|
||||
|
||||
public applyCodeActionFromCompletion(markerName: string, options: FourSlashInterface.VerifyCompletionActionOptions) {
|
||||
this.goToMarker(markerName);
|
||||
|
||||
const actualCompletion = this.getCompletionListAtCaret().entries.find(e => e.name === options.name);
|
||||
|
||||
if (!actualCompletion.hasAction) {
|
||||
this.raiseError(`Completion for ${options.name} does not have an associated action.`);
|
||||
}
|
||||
|
||||
const details = this.getCompletionEntryDetails(options.name);
|
||||
if (details.codeActions.length !== 1) {
|
||||
this.raiseError(`Expected one code action, got ${details.codeActions.length}`);
|
||||
}
|
||||
|
||||
if (details.codeActions[0].description !== options.description) {
|
||||
this.raiseError(`Expected description to be:\n${options.description}\ngot:\n${details.codeActions[0].description}`);
|
||||
}
|
||||
|
||||
this.applyCodeActions(details.codeActions);
|
||||
|
||||
this.verifyNewContent(options);
|
||||
}
|
||||
|
||||
public verifyRangeIs(expectedText: string, includeWhiteSpace?: boolean) {
|
||||
const ranges = this.getRanges();
|
||||
if (ranges.length !== 1) {
|
||||
@@ -2360,6 +2387,10 @@ Actual: ${stringify(fullActual)}`);
|
||||
this.applyEdits(change.fileName, change.textChanges, /*isFormattingEdit*/ false);
|
||||
}
|
||||
|
||||
this.verifyNewContent(options);
|
||||
}
|
||||
|
||||
private verifyNewContent(options: FourSlashInterface.NewContentOptions) {
|
||||
if (options.newFileContent) {
|
||||
assert(!options.newRangeContent);
|
||||
this.verifyCurrentFileContent(options.newFileContent);
|
||||
@@ -2750,16 +2781,26 @@ Actual: ${stringify(fullActual)}`);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyCodeFixAvailable(negative: boolean) {
|
||||
const codeFix = this.getCodeFixActions(this.activeFile.fileName);
|
||||
public verifyCodeFixAvailable(negative: boolean, info: FourSlashInterface.VerifyCodeFixAvailableOptions[] | undefined) {
|
||||
const codeFixes = this.getCodeFixActions(this.activeFile.fileName);
|
||||
|
||||
if (negative && codeFix.length) {
|
||||
this.raiseError(`verifyCodeFixAvailable failed - expected no fixes but found one.`);
|
||||
if (negative) {
|
||||
if (codeFixes.length) {
|
||||
this.raiseError(`verifyCodeFixAvailable failed - expected no fixes but found one.`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(negative || codeFix.length)) {
|
||||
if (!codeFixes.length) {
|
||||
this.raiseError(`verifyCodeFixAvailable failed - expected code fixes but none found.`);
|
||||
}
|
||||
if (info) {
|
||||
assert.equal(info.length, codeFixes.length);
|
||||
ts.zipWith(codeFixes, info, (fix, info) => {
|
||||
assert.equal(fix.description, info.description);
|
||||
this.assertObjectsEqual(fix.commands, info.commands);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public verifyApplicableRefactorAvailableAtMarker(negative: boolean, markerName: string) {
|
||||
@@ -2803,6 +2844,14 @@ Actual: ${stringify(fullActual)}`);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyRefactor({ name, actionName, refactors }: FourSlashInterface.VerifyRefactorOptions) {
|
||||
const selection = this.getSelection();
|
||||
|
||||
const actualRefactors = (this.languageService.getApplicableRefactors(this.activeFile.fileName, selection) || ts.emptyArray)
|
||||
.filter(r => r.name === name && r.actions.some(a => a.name === actionName));
|
||||
this.assertObjectsEqual(actualRefactors, refactors);
|
||||
}
|
||||
|
||||
public verifyApplicableRefactorAvailableForRange(negative: boolean) {
|
||||
const ranges = this.getRanges();
|
||||
if (!(ranges && ranges.length === 1)) {
|
||||
@@ -2822,14 +2871,14 @@ Actual: ${stringify(fullActual)}`);
|
||||
public applyRefactor({ refactorName, actionName, actionDescription, newContent: newContentWithRenameMarker }: FourSlashInterface.ApplyRefactorOptions) {
|
||||
const range = this.getSelection();
|
||||
const refactors = this.languageService.getApplicableRefactors(this.activeFile.fileName, range);
|
||||
const refactor = refactors.find(r => r.name === refactorName);
|
||||
if (!refactor) {
|
||||
const refactorsWithName = refactors.filter(r => r.name === refactorName);
|
||||
if (refactorsWithName.length === 0) {
|
||||
this.raiseError(`The expected refactor: ${refactorName} is not available at the marker location.\nAvailable refactors: ${refactors.map(r => r.name)}`);
|
||||
}
|
||||
|
||||
const action = refactor.actions.find(a => a.name === actionName);
|
||||
const action = ts.firstDefined(refactorsWithName, refactor => refactor.actions.find(a => a.name === actionName));
|
||||
if (!action) {
|
||||
this.raiseError(`The expected action: ${action} is not included in: ${refactor.actions.map(a => a.name)}`);
|
||||
this.raiseError(`The expected action: ${actionName} is not included in: ${ts.flatMap(refactorsWithName, r => r.actions.map(a => a.name))}`);
|
||||
}
|
||||
if (action.description !== actionDescription) {
|
||||
this.raiseError(`Expected action description to be ${JSON.stringify(actionDescription)}, got: ${JSON.stringify(action.description)}`);
|
||||
@@ -2933,7 +2982,15 @@ Actual: ${stringify(fullActual)}`);
|
||||
return text.substring(startPos, endPos);
|
||||
}
|
||||
|
||||
private assertItemInCompletionList(items: ts.CompletionEntry[], name: string, text?: string, documentation?: string, kind?: string, spanIndex?: number) {
|
||||
private assertItemInCompletionList(
|
||||
items: ts.CompletionEntry[],
|
||||
name: string,
|
||||
text: string | undefined,
|
||||
documentation: string | undefined,
|
||||
kind: string | undefined,
|
||||
spanIndex: number | undefined,
|
||||
hasAction: boolean | undefined,
|
||||
) {
|
||||
for (const item of items) {
|
||||
if (item.name === name) {
|
||||
if (documentation !== undefined || text !== undefined) {
|
||||
@@ -2956,6 +3013,8 @@ Actual: ${stringify(fullActual)}`);
|
||||
assert.isTrue(TestState.textSpansEqual(span, item.replacementSpan), this.assertionMessageAtLastKnownMarker(stringify(span) + " does not equal " + stringify(item.replacementSpan) + " replacement span for " + name));
|
||||
}
|
||||
|
||||
assert.equal(item.hasAction, hasAction);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3222,7 +3281,7 @@ ${code}
|
||||
}
|
||||
|
||||
function containTSConfigJson(files: FourSlashFile[]): boolean {
|
||||
return ts.forEach(files, f => f.fileOptions["Filename"] === "tsconfig.json");
|
||||
return ts.forEach(files, f => f.fileOptions.Filename === "tsconfig.json");
|
||||
}
|
||||
|
||||
function getNonFileNameOptionInFileList(files: FourSlashFile[]): string {
|
||||
@@ -3577,6 +3636,10 @@ namespace FourSlashInterface {
|
||||
public symbolsInScope(range: FourSlash.Range): ts.Symbol[] {
|
||||
return this.state.symbolsInScope(range);
|
||||
}
|
||||
|
||||
public setTypesRegistry(map: ts.MapLike<void>): void {
|
||||
this.state.setTypesRegistry(map);
|
||||
}
|
||||
}
|
||||
|
||||
export class GoTo {
|
||||
@@ -3669,12 +3732,12 @@ namespace FourSlashInterface {
|
||||
|
||||
// Verifies the completion list contains the specified symbol. The
|
||||
// completion list is brought up if necessary
|
||||
public completionListContains(symbol: string, text?: string, documentation?: string, kind?: string, spanIndex?: number) {
|
||||
public completionListContains(symbol: string, text?: string, documentation?: string, kind?: string, spanIndex?: number, hasAction?: boolean) {
|
||||
if (this.negative) {
|
||||
this.state.verifyCompletionListDoesNotContain(symbol, text, documentation, kind, spanIndex);
|
||||
}
|
||||
else {
|
||||
this.state.verifyCompletionListContains(symbol, text, documentation, kind, spanIndex);
|
||||
this.state.verifyCompletionListContains(symbol, text, documentation, kind, spanIndex, hasAction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3752,8 +3815,8 @@ namespace FourSlashInterface {
|
||||
this.state.verifyCodeFix(options);
|
||||
}
|
||||
|
||||
public codeFixAvailable() {
|
||||
this.state.verifyCodeFixAvailable(this.negative);
|
||||
public codeFixAvailable(options?: VerifyCodeFixAvailableOptions[]) {
|
||||
this.state.verifyCodeFixAvailable(this.negative, options);
|
||||
}
|
||||
|
||||
public applicableRefactorAvailableAtMarker(markerName: string) {
|
||||
@@ -3764,6 +3827,10 @@ namespace FourSlashInterface {
|
||||
this.state.verifyApplicableRefactorAvailableForRange(this.negative);
|
||||
}
|
||||
|
||||
public refactor(options: VerifyRefactorOptions) {
|
||||
this.state.verifyRefactor(options);
|
||||
}
|
||||
|
||||
public refactorAvailable(name: string, actionName?: string) {
|
||||
this.state.verifyRefactorAvailable(this.negative, name, actionName);
|
||||
}
|
||||
@@ -3999,6 +4066,10 @@ namespace FourSlashInterface {
|
||||
this.state.getAndApplyCodeActions(errorCode, index);
|
||||
}
|
||||
|
||||
public applyCodeActionFromCompletion(markerName: string, options: VerifyCompletionActionOptions): void {
|
||||
this.state.applyCodeActionFromCompletion(markerName, options);
|
||||
}
|
||||
|
||||
public importFixAtPosition(expectedTextArray: string[], errorCode?: number): void {
|
||||
this.state.verifyImportFixAtPosition(expectedTextArray, errorCode);
|
||||
}
|
||||
@@ -4396,12 +4467,31 @@ namespace FourSlashInterface {
|
||||
isNewIdentifierLocation?: boolean;
|
||||
}
|
||||
|
||||
export interface VerifyCodeFixOptions {
|
||||
description: string;
|
||||
// One of these should be defined.
|
||||
export interface NewContentOptions {
|
||||
// Exactly one of these should be defined.
|
||||
newFileContent?: string;
|
||||
newRangeContent?: string;
|
||||
}
|
||||
|
||||
export interface VerifyCodeFixOptions extends NewContentOptions {
|
||||
description: string;
|
||||
errorCode?: number;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
export interface VerifyCodeFixAvailableOptions {
|
||||
description: string;
|
||||
commands?: ts.CodeActionCommand[];
|
||||
}
|
||||
|
||||
export interface VerifyRefactorOptions {
|
||||
name: string;
|
||||
actionName: string;
|
||||
refactors: ts.ApplicableRefactorInfo[];
|
||||
}
|
||||
|
||||
export interface VerifyCompletionActionOptions extends NewContentOptions {
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -916,8 +916,8 @@ namespace Harness {
|
||||
if (file.content !== undefined) {
|
||||
const fileName = ts.normalizePath(file.unitName);
|
||||
const path = ts.toPath(file.unitName, currentDirectory, getCanonicalFileName);
|
||||
if (file.fileOptions && file.fileOptions["symlink"]) {
|
||||
const links = file.fileOptions["symlink"].split(",");
|
||||
if (file.fileOptions && file.fileOptions.symlink) {
|
||||
const links = file.fileOptions.symlink.split(",");
|
||||
for (const link of links) {
|
||||
const linkPath = ts.toPath(link, currentDirectory, getCanonicalFileName);
|
||||
realPathMap.set(linkPath, fileName);
|
||||
@@ -1232,7 +1232,7 @@ namespace Harness {
|
||||
if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) {
|
||||
ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles));
|
||||
ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles));
|
||||
return { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory: currentDirectory || harnessSettings["currentDirectory"] };
|
||||
return { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory: currentDirectory || harnessSettings.currentDirectory };
|
||||
}
|
||||
|
||||
function addDtsFile(file: TestFile, dtsFiles: TestFile[]) {
|
||||
@@ -1676,7 +1676,7 @@ namespace Harness {
|
||||
}
|
||||
|
||||
function fileOutput(file: GeneratedFile, harnessSettings: Harness.TestCaseParser.CompilerSettings): string {
|
||||
const fileName = harnessSettings["fullEmitPaths"] ? file.fileName : ts.getBaseFileName(file.fileName);
|
||||
const fileName = harnessSettings.fullEmitPaths ? file.fileName : ts.getBaseFileName(file.fileName);
|
||||
return "//// [" + fileName + "]\r\n" + getByteOrderMarkText(file) + file.code;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ namespace Harness.LanguageService {
|
||||
}
|
||||
|
||||
export class LanguageServiceAdapterHost {
|
||||
public typesRegistry: ts.Map<void> | undefined;
|
||||
protected virtualFileSystem: Utils.VirtualFileSystem = new Utils.VirtualFileSystem(virtualFileSystemRoot, /*useCaseSensitiveFilenames*/false);
|
||||
|
||||
constructor(protected cancellationToken = DefaultHostCancellationToken.Instance,
|
||||
@@ -182,6 +183,11 @@ namespace Harness.LanguageService {
|
||||
|
||||
/// Native adapter
|
||||
class NativeLanguageServiceHost extends LanguageServiceAdapterHost implements ts.LanguageServiceHost {
|
||||
isKnownTypesPackageName(name: string): boolean {
|
||||
return this.typesRegistry && this.typesRegistry.has(name);
|
||||
}
|
||||
installPackage = ts.notImplemented;
|
||||
|
||||
getCompilationSettings() { return this.settings; }
|
||||
getCancellationToken() { return this.cancellationToken; }
|
||||
getDirectories(path: string): string[] {
|
||||
@@ -206,6 +212,11 @@ namespace Harness.LanguageService {
|
||||
return script ? script.version.toString() : undefined;
|
||||
}
|
||||
|
||||
directoryExists(dirName: string): boolean {
|
||||
const fileEntry = this.virtualFileSystem.traversePath(dirName);
|
||||
return fileEntry && fileEntry.isDirectory();
|
||||
}
|
||||
|
||||
fileExists(fileName: string): boolean {
|
||||
const script = this.getScriptSnapshot(fileName);
|
||||
return script !== undefined;
|
||||
@@ -405,8 +416,8 @@ namespace Harness.LanguageService {
|
||||
getCompletionsAtPosition(fileName: string, position: number): ts.CompletionInfo {
|
||||
return unwrapJSONCallResult(this.shim.getCompletionsAtPosition(fileName, position));
|
||||
}
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): ts.CompletionEntryDetails {
|
||||
return unwrapJSONCallResult(this.shim.getCompletionEntryDetails(fileName, position, entryName));
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: ts.FormatCodeOptions): ts.CompletionEntryDetails {
|
||||
return unwrapJSONCallResult(this.shim.getCompletionEntryDetails(fileName, position, entryName, JSON.stringify(options)));
|
||||
}
|
||||
getCompletionEntrySymbol(): ts.Symbol {
|
||||
throw new Error("getCompletionEntrySymbol not implemented across the shim layer.");
|
||||
@@ -493,6 +504,7 @@ namespace Harness.LanguageService {
|
||||
getCodeFixesAtPosition(): ts.CodeAction[] {
|
||||
throw new Error("Not supported on the shim.");
|
||||
}
|
||||
applyCodeActionCommand = ts.notImplemented;
|
||||
getCodeFixDiagnostics(): ts.Diagnostic[] {
|
||||
throw new Error("Not supported on the shim.");
|
||||
}
|
||||
|
||||
+15
-6
@@ -157,11 +157,20 @@ namespace Playback {
|
||||
return log;
|
||||
}
|
||||
|
||||
const canonicalizeForHarness = ts.createGetCanonicalFileName(/*caseSensitive*/ false); // This is done so tests work on windows _and_ linux
|
||||
function sanitizeTestFilePath(name: string) {
|
||||
const path = ts.toPath(ts.normalizeSlashes(name.replace(/[\^<>:"|?*%]/g, "_")).replace(/\.\.\//g, "__dotdot/"), "", canonicalizeForHarness);
|
||||
if (ts.startsWith(path, "/")) {
|
||||
return path.substring(1);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
export function oldStyleLogIntoNewStyleLog(log: IOLog, writeFile: typeof Harness.IO.writeFile, baseTestName: string) {
|
||||
if (log.filesAppended) {
|
||||
for (const file of log.filesAppended) {
|
||||
if (file.contents !== undefined) {
|
||||
file.contentsPath = ts.combinePaths("appended", Harness.Compiler.sanitizeTestFilePath(file.path));
|
||||
file.contentsPath = ts.combinePaths("appended", sanitizeTestFilePath(file.path));
|
||||
writeFile(ts.combinePaths(baseTestName, file.contentsPath), file.contents);
|
||||
delete file.contents;
|
||||
}
|
||||
@@ -170,7 +179,7 @@ namespace Playback {
|
||||
if (log.filesWritten) {
|
||||
for (const file of log.filesWritten) {
|
||||
if (file.contents !== undefined) {
|
||||
file.contentsPath = ts.combinePaths("written", Harness.Compiler.sanitizeTestFilePath(file.path));
|
||||
file.contentsPath = ts.combinePaths("written", sanitizeTestFilePath(file.path));
|
||||
writeFile(ts.combinePaths(baseTestName, file.contentsPath), file.contents);
|
||||
delete file.contents;
|
||||
}
|
||||
@@ -180,7 +189,7 @@ namespace Playback {
|
||||
for (const file of log.filesRead) {
|
||||
const { contents } = file.result;
|
||||
if (contents !== undefined) {
|
||||
file.result.contentsPath = ts.combinePaths("read", Harness.Compiler.sanitizeTestFilePath(file.path));
|
||||
file.result.contentsPath = ts.combinePaths("read", sanitizeTestFilePath(file.path));
|
||||
writeFile(ts.combinePaths(baseTestName, file.result.contentsPath), contents);
|
||||
const len = contents.length;
|
||||
if (len >= 2 && contents.charCodeAt(0) === 0xfeff) {
|
||||
@@ -235,8 +244,8 @@ namespace Playback {
|
||||
if (recordLog !== undefined) {
|
||||
let i = 0;
|
||||
const fn = () => recordLogFileNameBase + i;
|
||||
while (underlying.fileExists(fn() + ".json")) i++;
|
||||
underlying.writeFile(ts.combinePaths(fn(), "test.json"), JSON.stringify(oldStyleLogIntoNewStyleLog(recordLog, (path, string) => underlying.writeFile(ts.combinePaths(fn(), path), string), fn()), null, 4)); // tslint:disable-line:no-null-keyword
|
||||
while (underlying.fileExists(ts.combinePaths(fn(), "test.json"))) i++;
|
||||
underlying.writeFile(ts.combinePaths(fn(), "test.json"), JSON.stringify(oldStyleLogIntoNewStyleLog(recordLog, (path, string) => underlying.writeFile(path, string), fn()), null, 4)); // tslint:disable-line:no-null-keyword
|
||||
recordLog = undefined;
|
||||
}
|
||||
};
|
||||
@@ -415,4 +424,4 @@ namespace Playback {
|
||||
initWrapper(wrapper, underlying);
|
||||
return wrapper;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Harness.Parallel.Host {
|
||||
let closedWorkers = 0;
|
||||
for (let i = 0; i < workerCount; i++) {
|
||||
// TODO: Just send the config over the IPC channel or in the command line arguments
|
||||
const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests: runners.length !== 1 };
|
||||
const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests };
|
||||
const configPath = ts.combinePaths(taskConfigsFolder, `task-config${i}.json`);
|
||||
Harness.IO.writeFile(configPath, JSON.stringify(config));
|
||||
const child = fork(__filename, [`--config="${configPath}"`]);
|
||||
|
||||
@@ -443,7 +443,7 @@ class ProjectRunner extends RunnerBase {
|
||||
|
||||
const name = "Compiling project for " + testCase.scenario + ": testcase " + testCaseFileName;
|
||||
|
||||
describe("Projects tests", () => {
|
||||
describe("projects tests", () => {
|
||||
describe(name, () => {
|
||||
function verifyCompilerResults(moduleKind: ts.ModuleKind) {
|
||||
let compilerResult: BatchCompileProjectTestCaseResult;
|
||||
|
||||
@@ -82,7 +82,7 @@ let testConfigContent =
|
||||
|
||||
let taskConfigsFolder: string;
|
||||
let workerCount: number;
|
||||
let runUnitTests = true;
|
||||
let runUnitTests: boolean | undefined;
|
||||
let noColors = false;
|
||||
|
||||
interface TestConfig {
|
||||
@@ -108,9 +108,7 @@ function handleTestConfig() {
|
||||
if (testConfig.light) {
|
||||
Harness.lightMode = true;
|
||||
}
|
||||
if (testConfig.runUnitTests !== undefined) {
|
||||
runUnitTests = testConfig.runUnitTests;
|
||||
}
|
||||
runUnitTests = testConfig.runUnitTests;
|
||||
if (testConfig.workerCount) {
|
||||
workerCount = +testConfig.workerCount;
|
||||
}
|
||||
@@ -199,6 +197,9 @@ function handleTestConfig() {
|
||||
runners.push(new FourSlashRunner(FourSlashTestType.Server));
|
||||
// runners.push(new GeneratedFourslashRunner());
|
||||
}
|
||||
if (runUnitTests === undefined) {
|
||||
runUnitTests = runners.length !== 1; // Don't run unit tests when running only one runner if unit tests were not explicitly asked for
|
||||
}
|
||||
}
|
||||
|
||||
function beginTests() {
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace RWC {
|
||||
}
|
||||
|
||||
export function runRWCTest(jsonPath: string) {
|
||||
describe("Testing a RWC project: " + jsonPath, () => {
|
||||
describe("Testing a rwc project: " + jsonPath, () => {
|
||||
let inputFiles: Harness.Compiler.TestFile[] = [];
|
||||
let otherFiles: Harness.Compiler.TestFile[] = [];
|
||||
let tsconfigFiles: Harness.Compiler.TestFile[] = [];
|
||||
@@ -266,6 +266,7 @@ class RWCRunner extends RunnerBase {
|
||||
public initializeTests(): void {
|
||||
// Read in and evaluate the test list
|
||||
const testList = this.tests && this.tests.length ? this.tests : this.enumerateTestFiles();
|
||||
|
||||
for (let i = 0; i < testList.length; i++) {
|
||||
this.runTest(testList[i]);
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
"./unittests/telemetry.ts",
|
||||
"./unittests/languageService.ts",
|
||||
"./unittests/programMissingFiles.ts",
|
||||
"./unittests/publicApi.ts"
|
||||
"./unittests/publicApi.ts",
|
||||
"./unittests/hostNewLineSupport.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ class TypeWriterWalker {
|
||||
}
|
||||
count++;
|
||||
symbolString += ", ";
|
||||
if ((declaration as any)["__symbolTestOutputCache"]) {
|
||||
symbolString += (declaration as any)["__symbolTestOutputCache"];
|
||||
if ((declaration as any).__symbolTestOutputCache) {
|
||||
symbolString += (declaration as any).__symbolTestOutputCache;
|
||||
continue;
|
||||
}
|
||||
const declSourceFile = declaration.getSourceFile();
|
||||
@@ -111,7 +111,7 @@ class TypeWriterWalker {
|
||||
const isLibFile = /lib(.*)\.d\.ts/i.test(fileName);
|
||||
const declText = `Decl(${ fileName }, ${ isLibFile ? "--" : declLineAndCharacter.line }, ${ isLibFile ? "--" : declLineAndCharacter.character })`;
|
||||
symbolString += declText;
|
||||
(declaration as any)["__symbolTestOutputCache"] = declText;
|
||||
(declaration as any).__symbolTestOutputCache = declText;
|
||||
}
|
||||
}
|
||||
symbolString += ")";
|
||||
|
||||
@@ -46,15 +46,14 @@ namespace ts {
|
||||
function makeAssertChanges(getProgram: () => Program): (fileNames: ReadonlyArray<string>) => void {
|
||||
const builder = createBuilder({
|
||||
getCanonicalFileName: identity,
|
||||
getEmitOutput: getFileEmitOutput,
|
||||
computeHash: identity,
|
||||
shouldEmitFile: returnTrue,
|
||||
computeHash: identity
|
||||
});
|
||||
return fileNames => {
|
||||
const program = getProgram();
|
||||
builder.updateProgram(program);
|
||||
const changedFiles = builder.emitChangedFiles(program);
|
||||
assert.deepEqual(changedFileNames(changedFiles), fileNames);
|
||||
const outputFileNames: string[] = [];
|
||||
builder.emitChangedFiles(program, fileName => outputFileNames.push(fileName));
|
||||
assert.deepEqual(outputFileNames, fileNames);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -63,11 +62,4 @@ namespace ts {
|
||||
updateProgramText(files, fileName, fileContent);
|
||||
});
|
||||
}
|
||||
|
||||
function changedFileNames(changedFiles: ReadonlyArray<EmitOutputDetailed>): string[] {
|
||||
return changedFiles.map(f => {
|
||||
assert.lengthOf(f.outputFiles, 1);
|
||||
return f.outputFiles[0].name;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ts.projectSystem {
|
||||
|
||||
describe("CompileOnSave affected list", () => {
|
||||
function sendAffectedFileRequestAndCheckResult(session: server.Session, request: server.protocol.Request, expectedFileList: { projectFileName: string, files: FileOrFolder[] }[]) {
|
||||
const response: server.protocol.CompileOnSaveAffectedFileListSingleProject[] = session.executeCommand(request).response;
|
||||
const response = session.executeCommand(request).response as server.protocol.CompileOnSaveAffectedFileListSingleProject[];
|
||||
const actualResult = response.sort((list1, list2) => compareStrings(list1.projectFileName, list2.projectFileName));
|
||||
expectedFileList = expectedFileList.sort((list1, list2) => compareStrings(list1.projectFileName, list2.projectFileName));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function assertCompilerOptionsWithJson(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) {
|
||||
const { options: actualCompilerOptions, errors: actualErrors} = convertCompilerOptionsFromJson(json["compilerOptions"], "/apath/", configFileName);
|
||||
const { options: actualCompilerOptions, errors: actualErrors} = convertCompilerOptionsFromJson(json.compilerOptions, "/apath/", configFileName);
|
||||
|
||||
const parsedCompilerOptions = JSON.stringify(actualCompilerOptions);
|
||||
const expectedCompilerOptions = JSON.stringify(expectedResult.compilerOptions);
|
||||
@@ -33,7 +33,7 @@ namespace ts {
|
||||
assert(!!result.endOfFileToken);
|
||||
const host: ParseConfigHost = new Utils.MockParseConfigHost("/apath/", true, []);
|
||||
const { options: actualCompilerOptions, errors: actualParseErrors } = parseJsonSourceFileConfigFileContent(result, host, "/apath/", /*existingOptions*/ undefined, configFileName);
|
||||
expectedResult.compilerOptions["configFilePath"] = configFileName;
|
||||
expectedResult.compilerOptions.configFilePath = configFileName;
|
||||
|
||||
const parsedCompilerOptions = JSON.stringify(actualCompilerOptions);
|
||||
const expectedCompilerOptions = JSON.stringify(expectedResult.compilerOptions);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function assertTypeAcquisitionWithJson(json: any, configFileName: string, expectedResult: ExpectedResult) {
|
||||
const jsonOptions = json["typeAcquisition"] || json["typingOptions"];
|
||||
const jsonOptions = json.typeAcquisition || json.typingOptions;
|
||||
const { options: actualTypeAcquisition, errors: actualErrors } = convertTypeAcquisitionFromJson(jsonOptions, "/apath/", configFileName);
|
||||
verifyAcquisition(actualTypeAcquisition, expectedResult);
|
||||
verifyErrors(actualErrors, expectedResult);
|
||||
|
||||
@@ -97,6 +97,15 @@ namespace ts {
|
||||
return rulesProvider;
|
||||
}
|
||||
|
||||
const notImplementedHost: LanguageServiceHost = {
|
||||
getCompilationSettings: notImplemented,
|
||||
getScriptFileNames: notImplemented,
|
||||
getScriptVersion: notImplemented,
|
||||
getScriptSnapshot: notImplemented,
|
||||
getDefaultLibFileName: notImplemented,
|
||||
getCurrentDirectory: notImplemented,
|
||||
};
|
||||
|
||||
export function testExtractSymbol(caption: string, text: string, baselineFolder: string, description: DiagnosticMessage) {
|
||||
const t = extractTest(text);
|
||||
const selectionRange = t.ranges.get("selection");
|
||||
@@ -125,6 +134,7 @@ namespace ts {
|
||||
file: sourceFile,
|
||||
startPosition: selectionRange.start,
|
||||
endPosition: selectionRange.end,
|
||||
host: notImplementedHost,
|
||||
rulesProvider: getRuleProvider()
|
||||
};
|
||||
const rangeToExtract = refactor.extractSymbol.getRangeToExtract(sourceFile, createTextSpanFromBounds(selectionRange.start, selectionRange.end));
|
||||
@@ -188,6 +198,7 @@ namespace ts {
|
||||
file: sourceFile,
|
||||
startPosition: selectionRange.start,
|
||||
endPosition: selectionRange.end,
|
||||
host: notImplementedHost,
|
||||
rulesProvider: getRuleProvider()
|
||||
};
|
||||
const rangeToExtract = refactor.extractSymbol.getRangeToExtract(sourceFile, createTextSpanFromBounds(selectionRange.start, selectionRange.end));
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/// <reference path="..\harness.ts" />
|
||||
namespace ts {
|
||||
describe("hostNewLineSupport", () => {
|
||||
function testLSWithFiles(settings: CompilerOptions, files: Harness.Compiler.TestFile[]) {
|
||||
function snapFor(path: string): IScriptSnapshot {
|
||||
if (path === "lib.d.ts") {
|
||||
return {
|
||||
dispose() {},
|
||||
getChangeRange() { return undefined; },
|
||||
getLength() { return 0; },
|
||||
getText(_start, _end) {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
const result = forEach(files, f => f.unitName === path ? f : undefined);
|
||||
if (result) {
|
||||
return {
|
||||
dispose() {},
|
||||
getChangeRange() { return undefined; },
|
||||
getLength() { return result.content.length; },
|
||||
getText(start, end) {
|
||||
return result.content.substring(start, end);
|
||||
}
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
const lshost: LanguageServiceHost = {
|
||||
getCompilationSettings: () => settings,
|
||||
getScriptFileNames: () => map(files, f => f.unitName),
|
||||
getScriptVersion: () => "1",
|
||||
getScriptSnapshot: name => snapFor(name),
|
||||
getDefaultLibFileName: () => "lib.d.ts",
|
||||
getCurrentDirectory: () => "",
|
||||
};
|
||||
return ts.createLanguageService(lshost);
|
||||
}
|
||||
|
||||
function verifyNewLines(content: string, options: CompilerOptions) {
|
||||
const ls = testLSWithFiles(options, [{
|
||||
content,
|
||||
fileOptions: {},
|
||||
unitName: "input.ts"
|
||||
}]);
|
||||
const result = ls.getEmitOutput("input.ts");
|
||||
assert(!result.emitSkipped, "emit was skipped");
|
||||
assert(result.outputFiles.length === 1, "a number of files other than 1 was output");
|
||||
assert(result.outputFiles[0].name === "input.js", `Expected output file name input.js, but got ${result.outputFiles[0].name}`);
|
||||
assert(result.outputFiles[0].text.match(options.newLine === NewLineKind.CarriageReturnLineFeed ? /\r\n/ : /[^\r]\n/), "expected to find appropriate newlines");
|
||||
assert(!result.outputFiles[0].text.match(options.newLine === NewLineKind.CarriageReturnLineFeed ? /[^\r]\n/ : /\r\n/), "expected not to find inappropriate newlines");
|
||||
}
|
||||
|
||||
function verifyBothNewLines(content: string) {
|
||||
verifyNewLines(content, { newLine: NewLineKind.CarriageReturnLineFeed });
|
||||
verifyNewLines(content, { newLine: NewLineKind.LineFeed });
|
||||
}
|
||||
|
||||
it("should exist and respect provided compiler options", () => {
|
||||
verifyBothNewLines(`
|
||||
function foo() {
|
||||
return 2 + 2;
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace ts.projectSystem {
|
||||
});
|
||||
|
||||
checkNumberOfProjects(projectService, { externalProjects: 1 });
|
||||
const diags = session.executeCommand(compilerOptionsRequest).response;
|
||||
const diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[];
|
||||
// only file1 exists - expect error
|
||||
checkDiagnosticsWithLinePos(diags, ["File '/a/b/applib.ts' not found."]);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ namespace ts.projectSystem {
|
||||
{
|
||||
// only file2 exists - expect error
|
||||
checkNumberOfProjects(projectService, { externalProjects: 1 });
|
||||
const diags = session.executeCommand(compilerOptionsRequest).response;
|
||||
const diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[];
|
||||
checkDiagnosticsWithLinePos(diags, ["File '/a/b/app.ts' not found."]);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace ts.projectSystem {
|
||||
{
|
||||
// both files exist - expect no errors
|
||||
checkNumberOfProjects(projectService, { externalProjects: 1 });
|
||||
const diags = session.executeCommand(compilerOptionsRequest).response;
|
||||
const diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[];
|
||||
checkDiagnosticsWithLinePos(diags, []);
|
||||
}
|
||||
});
|
||||
@@ -103,13 +103,13 @@ namespace ts.projectSystem {
|
||||
seq: 2,
|
||||
arguments: { projectFileName: project.getProjectName() }
|
||||
};
|
||||
let diags = session.executeCommand(compilerOptionsRequest).response;
|
||||
let diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[];
|
||||
checkDiagnosticsWithLinePos(diags, ["File '/a/b/applib.ts' not found."]);
|
||||
|
||||
host.reloadFS([file1, file2, config, libFile]);
|
||||
|
||||
checkNumberOfProjects(projectService, { configuredProjects: 1 });
|
||||
diags = session.executeCommand(compilerOptionsRequest).response;
|
||||
diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[];
|
||||
checkDiagnosticsWithLinePos(diags, []);
|
||||
});
|
||||
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace ts.server {
|
||||
item: false
|
||||
};
|
||||
const command = "newhandle";
|
||||
const result = {
|
||||
const result: ts.server.HandlerResponse = {
|
||||
response: respBody,
|
||||
responseRequired: true
|
||||
};
|
||||
@@ -332,7 +332,7 @@ namespace ts.server {
|
||||
const respBody = {
|
||||
item: false
|
||||
};
|
||||
const resp = {
|
||||
const resp: ts.server.HandlerResponse = {
|
||||
response: respBody,
|
||||
responseRequired: true
|
||||
};
|
||||
@@ -372,7 +372,7 @@ namespace ts.server {
|
||||
};
|
||||
const command = "test";
|
||||
|
||||
session.output(body, command);
|
||||
session.output(body, command, /*reqSeq*/ 0);
|
||||
|
||||
expect(lastSent).to.deep.equal({
|
||||
seq: 0,
|
||||
@@ -475,7 +475,7 @@ namespace ts.server {
|
||||
};
|
||||
const command = "test";
|
||||
|
||||
session.output(body, command);
|
||||
session.output(body, command, /*reqSeq*/ 0);
|
||||
|
||||
expect(session.lastSent).to.deep.equal({
|
||||
seq: 0,
|
||||
@@ -542,7 +542,7 @@ namespace ts.server {
|
||||
handleRequest(msg: protocol.Request) {
|
||||
let response: protocol.Response;
|
||||
try {
|
||||
({ response } = this.executeCommand(msg));
|
||||
response = this.executeCommand(msg).response as protocol.Response;
|
||||
}
|
||||
catch (e) {
|
||||
this.output(undefined, msg.command, msg.seq, e.toString());
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace ts.tscWatch {
|
||||
checkProgramRootFiles(watch(), [file1.path, file2.path]);
|
||||
checkWatchedFiles(host, [configFile.path, file1.path, file2.path, libFile.path]);
|
||||
const configDir = getDirectoryPath(configFile.path);
|
||||
checkWatchedDirectories(host, projectSystem.getTypeRootsFromLocation(configDir).concat(configDir), /*recursive*/ true);
|
||||
checkWatchedDirectories(host, [configDir, combinePaths(configDir, projectSystem.nodeModulesAtTypes)], /*recursive*/ true);
|
||||
});
|
||||
|
||||
// TODO: if watching for config file creation
|
||||
@@ -269,7 +269,7 @@ namespace ts.tscWatch {
|
||||
const host = createWatchedSystem([commonFile1, libFile, configFile]);
|
||||
const watch = createWatchModeWithConfigFile(configFile.path, host);
|
||||
const configDir = getDirectoryPath(configFile.path);
|
||||
checkWatchedDirectories(host, projectSystem.getTypeRootsFromLocation(configDir).concat(configDir), /*recursive*/ true);
|
||||
checkWatchedDirectories(host, [configDir, combinePaths(configDir, projectSystem.nodeModulesAtTypes)], /*recursive*/ true);
|
||||
|
||||
checkProgramRootFiles(watch(), [commonFile1.path]);
|
||||
|
||||
@@ -1105,6 +1105,64 @@ namespace ts.tscWatch {
|
||||
const outJs = "/a/out.js";
|
||||
createWatchForOut(/*out*/ undefined, outJs);
|
||||
});
|
||||
|
||||
function verifyFilesEmittedOnce(useOutFile: boolean) {
|
||||
const file1: FileOrFolder = {
|
||||
path: "/a/b/output/AnotherDependency/file1.d.ts",
|
||||
content: "declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } }"
|
||||
};
|
||||
const file2: FileOrFolder = {
|
||||
path: "/a/b/dependencies/file2.d.ts",
|
||||
content: "declare namespace Dependencies.SomeComponent { export class SomeClass { version: string; } }"
|
||||
};
|
||||
const file3: FileOrFolder = {
|
||||
path: "/a/b/project/src/main.ts",
|
||||
content: "namespace Main { export function fooBar() {} }"
|
||||
};
|
||||
const file4: FileOrFolder = {
|
||||
path: "/a/b/project/src/main2.ts",
|
||||
content: "namespace main.file4 { import DynamicMenu = Common.SomeComponent.DynamicMenu; export function foo(a: DynamicMenu.z) { } }"
|
||||
};
|
||||
const configFile: FileOrFolder = {
|
||||
path: "/a/b/project/tsconfig.json",
|
||||
content: JSON.stringify({
|
||||
compilerOptions: useOutFile ?
|
||||
{ outFile: "../output/common.js", target: "es5" } :
|
||||
{ outDir: "../output", target: "es5" },
|
||||
files: [file1.path, file2.path, file3.path, file4.path]
|
||||
})
|
||||
};
|
||||
const files = [file1, file2, file3, file4];
|
||||
const allfiles = files.concat(configFile);
|
||||
const host = createWatchedSystem(allfiles);
|
||||
const originalWriteFile = host.writeFile.bind(host);
|
||||
const mapOfFilesWritten = createMap<number>();
|
||||
host.writeFile = (p: string, content: string) => {
|
||||
const count = mapOfFilesWritten.get(p);
|
||||
mapOfFilesWritten.set(p, count ? count + 1 : 1);
|
||||
return originalWriteFile(p, content);
|
||||
};
|
||||
createWatchModeWithConfigFile(configFile.path, host);
|
||||
if (useOutFile) {
|
||||
// Only out file
|
||||
assert.equal(mapOfFilesWritten.size, 1);
|
||||
}
|
||||
else {
|
||||
// main.js and main2.js
|
||||
assert.equal(mapOfFilesWritten.size, 2);
|
||||
}
|
||||
mapOfFilesWritten.forEach((value, key) => {
|
||||
assert.equal(value, 1, "Key: " + key);
|
||||
});
|
||||
}
|
||||
|
||||
it("with --outFile and multiple declaration files in the program", () => {
|
||||
verifyFilesEmittedOnce(/*useOutFile*/ true);
|
||||
});
|
||||
|
||||
it("without --outFile and multiple declaration files in the program", () => {
|
||||
verifyFilesEmittedOnce(/*useOutFile*/ false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("tsc-watch emit for configured projects", () => {
|
||||
@@ -1819,4 +1877,44 @@ declare module "fs" {
|
||||
checkOutputErrors(host);
|
||||
});
|
||||
});
|
||||
|
||||
describe("tsc-watch with when module emit is specified as node", () => {
|
||||
it("when instead of filechanged recursive directory watcher is invoked", () => {
|
||||
const configFile: FileOrFolder = {
|
||||
path: "/a/rootFolder/project/tsconfig.json",
|
||||
content: JSON.stringify({
|
||||
"compilerOptions": {
|
||||
"module": "none",
|
||||
"allowJs": true,
|
||||
"outDir": "Static/scripts/"
|
||||
},
|
||||
"include": [
|
||||
"Scripts/**/*"
|
||||
],
|
||||
})
|
||||
};
|
||||
const outputFolder = "/a/rootFolder/project/Static/scripts/";
|
||||
const file1: FileOrFolder = {
|
||||
path: "/a/rootFolder/project/Scripts/TypeScript.ts",
|
||||
content: "var z = 10;"
|
||||
};
|
||||
const file2: FileOrFolder = {
|
||||
path: "/a/rootFolder/project/Scripts/Javascript.js",
|
||||
content: "var zz = 10;"
|
||||
};
|
||||
const files = [configFile, file1, file2, libFile];
|
||||
const host = createWatchedSystem(files);
|
||||
const watch = createWatchModeWithConfigFile(configFile.path, host);
|
||||
|
||||
checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path));
|
||||
file1.content = "var zz30 = 100;";
|
||||
host.reloadFS(files, /*invokeDirectoryWatcherInsteadOfFileChanged*/ true);
|
||||
host.runQueuedTimeoutCallbacks();
|
||||
|
||||
checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path));
|
||||
const outputFile1 = changeExtension((outputFolder + getBaseFileName(file1.path)), ".js");
|
||||
assert.isTrue(host.fileExists(outputFile1));
|
||||
assert.equal(host.readFile(outputFile1), file1.content + host.newLine);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,6 +4,8 @@
|
||||
|
||||
namespace ts.projectSystem {
|
||||
import TI = server.typingsInstaller;
|
||||
import validatePackageName = JsTyping.validatePackageName;
|
||||
import PackageNameValidationResult = JsTyping.PackageNameValidationResult;
|
||||
|
||||
interface InstallerParams {
|
||||
globalTypingsCacheLocation?: string;
|
||||
@@ -266,7 +268,7 @@ namespace ts.projectSystem {
|
||||
};
|
||||
const host = createServerHost([file1]);
|
||||
let enqueueIsCalled = false;
|
||||
const installer = new (class extends Installer {
|
||||
const installer: Installer = new (class extends Installer {
|
||||
constructor() {
|
||||
super(host, { typesRegistry: createTypesRegistry("jquery") });
|
||||
}
|
||||
@@ -983,21 +985,21 @@ namespace ts.projectSystem {
|
||||
for (let i = 0; i < 8; i++) {
|
||||
packageName += packageName;
|
||||
}
|
||||
assert.equal(TI.validatePackageName(packageName), TI.PackageNameValidationResult.NameTooLong);
|
||||
assert.equal(validatePackageName(packageName), PackageNameValidationResult.NameTooLong);
|
||||
});
|
||||
it("name cannot start with dot", () => {
|
||||
assert.equal(TI.validatePackageName(".foo"), TI.PackageNameValidationResult.NameStartsWithDot);
|
||||
assert.equal(validatePackageName(".foo"), PackageNameValidationResult.NameStartsWithDot);
|
||||
});
|
||||
it("name cannot start with underscore", () => {
|
||||
assert.equal(TI.validatePackageName("_foo"), TI.PackageNameValidationResult.NameStartsWithUnderscore);
|
||||
assert.equal(validatePackageName("_foo"), PackageNameValidationResult.NameStartsWithUnderscore);
|
||||
});
|
||||
it("scoped packages not supported", () => {
|
||||
assert.equal(TI.validatePackageName("@scope/bar"), TI.PackageNameValidationResult.ScopedPackagesNotSupported);
|
||||
assert.equal(validatePackageName("@scope/bar"), PackageNameValidationResult.ScopedPackagesNotSupported);
|
||||
});
|
||||
it("non URI safe characters are not supported", () => {
|
||||
assert.equal(TI.validatePackageName(" scope "), TI.PackageNameValidationResult.NameContainsNonURISafeCharacters);
|
||||
assert.equal(TI.validatePackageName("; say ‘Hello from TypeScript!’ #"), TI.PackageNameValidationResult.NameContainsNonURISafeCharacters);
|
||||
assert.equal(TI.validatePackageName("a/b/c"), TI.PackageNameValidationResult.NameContainsNonURISafeCharacters);
|
||||
assert.equal(validatePackageName(" scope "), PackageNameValidationResult.NameContainsNonURISafeCharacters);
|
||||
assert.equal(validatePackageName("; say ‘Hello from TypeScript!’ #"), PackageNameValidationResult.NameContainsNonURISafeCharacters);
|
||||
assert.equal(validatePackageName("a/b/c"), PackageNameValidationResult.NameContainsNonURISafeCharacters);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1250,7 +1252,7 @@ namespace ts.projectSystem {
|
||||
const host = createServerHost([f1, packageFile]);
|
||||
let beginEvent: server.BeginInstallTypes;
|
||||
let endEvent: server.EndInstallTypes;
|
||||
const installer = new (class extends Installer {
|
||||
const installer: Installer = new (class extends Installer {
|
||||
constructor() {
|
||||
super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") });
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace ts.TestFSWithWatch {
|
||||
executingFilePath?: string;
|
||||
currentDirectory?: string;
|
||||
newLine?: string;
|
||||
useWindowsStylePaths?: boolean;
|
||||
}
|
||||
|
||||
export function createWatchedSystem(fileOrFolderList: ReadonlyArray<FileOrFolder>, params?: TestServerHostCreationParameters): TestServerHost {
|
||||
@@ -39,7 +40,8 @@ namespace ts.TestFSWithWatch {
|
||||
params.executingFilePath || getExecutingFilePathFromLibFile(),
|
||||
params.currentDirectory || "/",
|
||||
fileOrFolderList,
|
||||
params.newLine);
|
||||
params.newLine,
|
||||
params.useWindowsStylePaths);
|
||||
return host;
|
||||
}
|
||||
|
||||
@@ -52,7 +54,8 @@ namespace ts.TestFSWithWatch {
|
||||
params.executingFilePath || getExecutingFilePathFromLibFile(),
|
||||
params.currentDirectory || "/",
|
||||
fileOrFolderList,
|
||||
params.newLine);
|
||||
params.newLine,
|
||||
params.useWindowsStylePaths);
|
||||
return host;
|
||||
}
|
||||
|
||||
@@ -230,11 +233,14 @@ namespace ts.TestFSWithWatch {
|
||||
readonly watchedDirectories = createMultiMap<TestDirectoryWatcher>();
|
||||
readonly watchedDirectoriesRecursive = createMultiMap<TestDirectoryWatcher>();
|
||||
readonly watchedFiles = createMultiMap<TestFileWatcher>();
|
||||
private readonly executingFilePath: string;
|
||||
private readonly currentDirectory: string;
|
||||
|
||||
constructor(public withSafeList: boolean, public useCaseSensitiveFileNames: boolean, private executingFilePath: string, private currentDirectory: string, fileOrFolderList: ReadonlyArray<FileOrFolder>, public readonly newLine = "\n") {
|
||||
constructor(public withSafeList: boolean, public useCaseSensitiveFileNames: boolean, executingFilePath: string, currentDirectory: string, fileOrFolderList: ReadonlyArray<FileOrFolder>, public readonly newLine = "\n", public readonly useWindowsStylePath?: boolean) {
|
||||
this.getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
this.toPath = s => toPath(s, currentDirectory, this.getCanonicalFileName);
|
||||
|
||||
this.executingFilePath = this.getHostSpecificPath(executingFilePath);
|
||||
this.currentDirectory = this.getHostSpecificPath(currentDirectory);
|
||||
this.reloadFS(fileOrFolderList);
|
||||
}
|
||||
|
||||
@@ -250,11 +256,24 @@ namespace ts.TestFSWithWatch {
|
||||
return this.toPath(this.toNormalizedAbsolutePath(s));
|
||||
}
|
||||
|
||||
reloadFS(fileOrFolderList: ReadonlyArray<FileOrFolder>) {
|
||||
getHostSpecificPath(s: string) {
|
||||
if (this.useWindowsStylePath && s.startsWith(directorySeparator)) {
|
||||
return "c:/" + s.substring(1);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
reloadFS(fileOrFolderList: ReadonlyArray<FileOrFolder>, invokeDirectoryWatcherInsteadOfFileChanged?: boolean) {
|
||||
const mapNewLeaves = createMap<true>();
|
||||
const isNewFs = this.fs.size === 0;
|
||||
// always inject safelist file in the list of files
|
||||
for (const fileOrDirectory of fileOrFolderList.concat(this.withSafeList ? safeList : [])) {
|
||||
fileOrFolderList = fileOrFolderList.concat(this.withSafeList ? safeList : []);
|
||||
const filesOrFoldersToLoad: ReadonlyArray<FileOrFolder> = !this.useWindowsStylePath ? fileOrFolderList :
|
||||
fileOrFolderList.map<FileOrFolder>(f => {
|
||||
const result = clone(f);
|
||||
result.path = this.getHostSpecificPath(f.path);
|
||||
return result;
|
||||
});
|
||||
for (const fileOrDirectory of filesOrFoldersToLoad) {
|
||||
const path = this.toFullPath(fileOrDirectory.path);
|
||||
mapNewLeaves.set(path, true);
|
||||
// If its a change
|
||||
@@ -265,7 +284,12 @@ namespace ts.TestFSWithWatch {
|
||||
// Update file
|
||||
if (currentEntry.content !== fileOrDirectory.content) {
|
||||
currentEntry.content = fileOrDirectory.content;
|
||||
this.invokeFileWatcher(currentEntry.fullPath, FileWatcherEventKind.Changed);
|
||||
if (invokeDirectoryWatcherInsteadOfFileChanged) {
|
||||
this.invokeDirectoryWatcher(getDirectoryPath(currentEntry.fullPath), currentEntry.fullPath);
|
||||
}
|
||||
else {
|
||||
this.invokeFileWatcher(currentEntry.fullPath, FileWatcherEventKind.Changed);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -792,6 +792,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[不能在构造函数中访问类“{1}”中的抽象属性“{0}”。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1329,6 +1338,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[使用 JSDoc 中的类型批注]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[使用 JSDoc 中的类型批注]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1476,6 +1503,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[调用修饰器表达式。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1883,12 +1919,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[将 {0} 更改为 {1}。]]></Val>
|
||||
<Val><![CDATA[将“{0}”更改为“{1}”。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2004,6 +2040,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[类声明不能有多个 "@augments" 或 "@extends" 标记。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3786,6 +3831,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[从用法中推断出参数类型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[从用法中推断出“{0}”的类型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3978,20 +4041,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc "@augments {0}" 与“扩展 {1}”子句不匹配。]]></Val>
|
||||
<Val><![CDATA[JSDoc "@{0} {1}" 不匹配 "extends {2}" 子句。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc "@augments" 未附加到类声明。]]></Val>
|
||||
<Val><![CDATA[JSDoc "@{0}" 未附加到类。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7254,6 +7317,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[类型参数“{0}”具有循环默认值。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7734,6 +7806,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[“{0}”收到的参数过少,无法在此处充当修饰器。你是要先调用它,然后再写入 "@{0}()" 吗?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -792,6 +792,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[無法從建構函式存取類別 '{1}' 中的抽象屬性 '{0}'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1329,6 +1338,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[為來自 JSDoc 的類型標註]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[為來自 JSDoc 的類型標註]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1476,6 +1503,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[呼叫裝飾項目運算式。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1883,12 +1919,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[將 {0} 變更為 {1}。]]></Val>
|
||||
<Val><![CDATA[將 '{0}' 變更為 '{1}'。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2004,6 +2040,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[類別宣告只可有一個 '@augments' 或 '@extends' 標記。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3786,6 +3831,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[從用法推斷參數類型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[從用法推斷 '{0}' 的類型。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3978,20 +4041,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' 不符合 'extends {1}' 子句。]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' 不符合 'extends {2}' 子句。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc '@augments' 未連結至類別宣告。]]></Val>
|
||||
<Val><![CDATA[JSDoc ''@{0}' 未連結到類別。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7254,6 +7317,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[型別參數 '{0}' 包含循環的預設值。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7734,6 +7806,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' 在此只接受極少數的引數用為裝飾項目。要先呼叫此項目,然後再寫入 '@{0}()' 嗎?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -801,6 +801,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[K abstraktní vlastnosti {0} ve třídě {1} nelze získat přístup v konstruktoru.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1338,6 +1347,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Přidat poznámku s typem z JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Přidat poznámky s typy z JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1485,6 +1512,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Výraz pro volání dekoratéru]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1892,12 +1928,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Změnit {0} na {1}]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2013,6 +2049,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklarace tříd nemůžou obsahovat více než jednu značku @augments nebo @extends.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3795,6 +3840,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Odvodit typy parametrů z používání]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Odvodit typ {0} z používání]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3987,20 +4050,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Značka JSDoc @augments {0} neodpovídá klauzuli extends {1}.]]></Val>
|
||||
<Val><![CDATA[Značka JSDoc @{0} {1} neodpovídá klauzuli extends {2}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Značka JSDoc @augments není připojená k deklaraci třídy.]]></Val>
|
||||
<Val><![CDATA[Značka JSDoc @{0} není připojená k třídě.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7263,6 +7326,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Parametr typu {0} má cyklickou výchozí hodnotu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7743,6 +7815,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Objekt {0} přijímá málo argumentů k tomu, aby se dal použít jako dekoratér. Nechtěli jste ho nejprve volat a napsat @{0}()?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -801,6 +801,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[No se puede acceder a la propiedad abstracta "{0}" de la clase "{1}" en el constructor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1338,6 +1347,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Anotar con tipo de JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Anotar con tipos de JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1485,6 +1512,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Llame a la expresión decorador.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1892,12 +1928,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Cambia {0} a {1}.]]></Val>
|
||||
<Val><![CDATA[Cambie "{0}" a "{1}".]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2013,6 +2049,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Las declaraciones de clase no pueden tener más de una etiqueta "@augments" o "@extends".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3795,6 +3840,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Infiera los tipos de parámetro del uso.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Infiera el tipo de "{0}" del uso.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3987,20 +4050,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La etiqueta "@augments {0}" de JSDoc no coincide con la cláusula "extends {1}".]]></Val>
|
||||
<Val><![CDATA[La etiqueta "@{0} {1}" de JSDoc no coincide con la cláusula "extends {2}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La etiqueta "@augments" de JSDoc no está asociada a una declaración de clase.]]></Val>
|
||||
<Val><![CDATA[La etiqueta "@{0}" de JSDoc no está asociada a una clase.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7263,6 +7326,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El parámetro de tipo "{0}" tiene un valor circular predeterminado.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7743,6 +7815,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["{0}" no acepta suficientes argumentos para utilizarse como decorador aquí. ¿Pretendía llamar primero y escribir "@{0}()"?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -801,6 +801,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La propriété abstraite '{0}' de la classe '{1}' n'est pas accessible dans le constructeur.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1338,6 +1347,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Annoter avec le type de JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Annoter avec les types de JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1485,6 +1512,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Appelez l'expression de l'élément décoratif.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1892,12 +1928,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Changez {0} en {1}.]]></Val>
|
||||
<Val><![CDATA[Changez '{0}' en '{1}'.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2013,6 +2049,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Les déclarations de classes ne peuvent pas avoir plusieurs balises '@augments' ou '@extends'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3795,6 +3840,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Déduisez les types des paramètres à partir de l'utilisation.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Déduisez le type de '{0}' à partir de l'utilisation.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3987,20 +4050,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La balise JSDoc '@augments {0}' ne correspond pas à la clause 'extends {1}'.]]></Val>
|
||||
<Val><![CDATA[La balise JSDoc '@{0} {1}' ne correspond pas à la clause 'extends {2}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[La balise JSDoc '@augments' n'est pas attaché à une déclaration de classe.]]></Val>
|
||||
<Val><![CDATA[La balise JSDoc '@{0}' n'est pas attachée à une classe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7263,6 +7326,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le paramètre de type '{0}' a une valeur par défaut circulaire.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7743,6 +7815,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' accepte trop peu d'arguments pour pouvoir être utilisé ici en tant qu'élément décoratif. Voulez-vous vraiment l'appeler d'abord et écrire '@{0}()' ?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -792,6 +792,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile accedere alla proprietà astratta '{0}' nella classe '{1}' nel costruttore.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1329,6 +1338,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Annota con tipo di JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Annota con tipi di JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1476,6 +1503,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Chiama l'espressione Decorator.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1883,12 +1919,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Cambia {0} in {1}.]]></Val>
|
||||
<Val><![CDATA[Cambia '{0}' in '{1}'.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2004,6 +2040,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le dichiarazioni di classe non possono contenere più di un tag `@augments` o `@extends`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3786,6 +3831,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deriva i tipi di parametro dall'utilizzo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deriva il tipo di '{0}' dall'utilizzo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3978,20 +4041,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il tag '@augments {0}' di JSDoc non corrisponde alla clausola 'extends {1}'.]]></Val>
|
||||
<Val><![CDATA[Il tag '@{0} {1}' di JSDoc non corrisponde alla clausola 'extends {2}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il tag '@augments' di JSDoc non è collegato a una dichiarazione di classe.]]></Val>
|
||||
<Val><![CDATA[Il tag '@{0}' di JSDoc non è collegato a una classe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7254,6 +7317,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il parametro di tipo '{0}' contiene un'impostazione predefinita circolare.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7734,6 +7806,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' accetta un numero troppo ridotto di argomenti da usare come espressione Decorator in questo punto. Si intendeva chiamarlo prima e scrivere '@{0}()'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -792,6 +792,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[コンストラクター内でクラス '{1}' の抽象プロパティ '{0}' にアクセスできません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1329,6 +1338,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc の型で注釈を付けます]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc の型で注釈を付けます]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1476,6 +1503,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[デコレーター式を呼び出します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1883,12 +1919,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0} を {1} に変更します。]]></Val>
|
||||
<Val><![CDATA['{0}' を '{1}' に変更します。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2004,6 +2040,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[クラス宣言で複数の '@augments' または `@extends` タグを使用することはできません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3786,6 +3831,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[使用状況からパラメーターの型を推論します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[使用状況から型 '{0}' を推論します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3978,20 +4041,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' は 'extends {1}' 句と一致しません。]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' が 'extends {2}' 句と一致しません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc '@augments' はクラス宣言にアタッチされていません。]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' はクラスにアタッチされていません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7254,6 +7317,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[型パラメーター '{0}' に循環既定値があります。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7734,6 +7806,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' は受け入れる引数が少なすぎるので、ここでデコレーターとして使用することができません。最初にこれを呼び出してから、'@{0}()' を書き込むつもりでしたか?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -792,6 +792,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[생성자에서 '{1}' 클래스의 추상 속성 '{0}'에 액세스할 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1329,6 +1338,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc의 형식을 사용하여 주석 추가]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc의 형식을 사용하여 주석 추가]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1476,6 +1503,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[decorator 식을 호출합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1883,12 +1919,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[{0}을(를) {1}(으)로 변경합니다.]]></Val>
|
||||
<Val><![CDATA['{0}'을(를) '{1}'(으)로 변경합니다.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2004,6 +2040,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[클래스 선언은 '@augments' 또는 `@extends` 태그를 둘 이상 가질 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3786,6 +3831,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[사용량에서 매개 변수 형식을 유추합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[사용량에서 '{0}'의 형식을 유추합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3978,20 +4041,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc '@augments {0}'이(가) 'extends {1}' 절과 일치하지 않습니다.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}'이(가) 'extends {2}' 절과 일치하지 않습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc '@augments'가 클래스 선언에 연결되어 있지 않습니다.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}'이(가) 클래스에 연결되어 있지 않습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7254,6 +7317,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[형식 매개 변수 '{0}'에 순환 기본값이 있습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7734,6 +7806,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}'이(가) 여기에서 decorator로 사용할 인수를 너무 적게 허용합니다. 먼저 이를 호출하고 '@{0}()'을(를) 작성하시겠습니까?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -782,6 +782,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Właściwość abstrakcyjna „{0}” w klasie „{1}” jest niedostępna w konstruktorze.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1313,6 +1322,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Dodaj adnotację przy użyciu typu z JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Dodaj adnotację przy użyciu typów z JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1460,6 +1487,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Wywołaj wyrażenie dekoratora.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1867,10 +1903,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Zmień {0} na {1}.]]></Val>
|
||||
<Val><![CDATA[Zmień element „{0}” na „{1}”.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -1982,6 +2021,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Deklaracje klas nie mogą mieć więcej niż jeden tag „@augments” lub „@extends”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3758,6 +3806,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Wywnioskuj typy parametrów na podstawie użycia.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Wywnioskuj typ elementu „{0}” na podstawie użycia.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3950,20 +4016,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Element JSDoc „@augments {0}” jest niezgodny z klauzulą „extends {1}”.]]></Val>
|
||||
<Val><![CDATA[Element JSDoc „@{0} {1}” nie pasuje do klauzuli „extends {2}”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Element JSDoc „@augments” nie został dołączony do deklaracji klasy.]]></Val>
|
||||
<Val><![CDATA[Element JSDoc „@{0}” nie został dołączony do klasy.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7217,6 +7283,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Parametr typu „{0}” ma cykliczną wartość domyślną.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7697,6 +7772,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Element „{0}” akceptuje za mało argumentów, aby można go było użyć w tym miejscu jako dekorator. Czy chcesz najpierw go wywołać i zapisać tag „@{0}()”?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -782,6 +782,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[A propriedade abstrata '{0}' na classe '{1}' não pode ser acessada no construtor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1313,6 +1322,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Anotar com o tipo do JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Anotar com os tipos do JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1460,6 +1487,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Chamar expressão decoradora.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1867,10 +1903,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Alterar {0} para {1}.]]></Val>
|
||||
<Val><![CDATA[Alterar '{0}' para '{1}'.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -1982,6 +2021,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Declarações de classe não podem ter mais de uma marca `@augments` ou `@extends`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3758,6 +3806,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Inferir os tipos de parâmetro do uso.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Inferir o tipo de '{0}' do uso.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3950,20 +4016,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc "@augments {0}" não corresponde à cláusula "extends {1}".]]></Val>
|
||||
<Val><![CDATA[O '@{0} {1}' do JSDoc não corresponde à cláusula 'extends {2}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[JSDoc "@augments" não está anexado à declaração de classe.]]></Val>
|
||||
<Val><![CDATA[O '@{0}' do JSDoc não está anexado a uma classe.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7217,6 +7283,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O parâmetro de tipo '{0}' tem um padrão circular.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7697,6 +7772,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' aceita muito poucos argumentos para serem usados como um decorador aqui. Você quis dizer para chamá-lo primeiro e gravar '@{0}()'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -791,6 +791,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Абстрактное свойство "{0}" в классе "{1}" недоступно в конструкторе.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Accessibility_modifier_already_seen_1028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Accessibility modifier already seen.]]></Val>
|
||||
@@ -1328,6 +1337,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_type_from_JSDoc_95009" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with type from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Заметка с типом из JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Annotate_with_types_from_JSDoc_95010" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Annotate with types from JSDoc]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Заметки с типами из JSDoc]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Argument_expression_expected_1135" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Argument expression expected.]]></Val>
|
||||
@@ -1475,6 +1502,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_decorator_expression_90028" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call decorator expression.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Вызов выражения-декоратора.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Call signature, which lacks return-type annotation, implicitly has an 'any' return type.]]></Val>
|
||||
@@ -1882,12 +1918,12 @@
|
||||
</Item>
|
||||
<Item ItemId=";Change_0_to_1_90014" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
<Val><![CDATA[Change '{0}' to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Измените {0} на {1}.]]></Val>
|
||||
<Val><![CDATA[Замена "{0}" на "{1}".]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Change {0} to {1}]]></Val>
|
||||
<Val><![CDATA[Change {0} to {1}.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -2003,6 +2039,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class declarations cannot have more than one `@augments` or `@extends` tag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[В объявлении класса не может использоваться более одного тега "@augments" или "@extends".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Class_name_cannot_be_0_2414" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Class name cannot be '{0}'.]]></Val>
|
||||
@@ -3785,6 +3830,24 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_parameter_types_from_usage_95012" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer parameter types from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Вывод типов параметров на основе использования.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Infer_type_of_0_from_usage_95011" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Infer type of '{0}' from usage.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Вывод типа "{0}" на основе использования.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Initialize_property_0_in_the_constructor_90020" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Initialize property '{0}' in the constructor.]]></Val>
|
||||
@@ -3977,20 +4040,20 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_0_does_not_match_the_extends_1_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_1_does_not_match_the_extends_2_clause_8023" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments {0}' does not match the 'extends {1}' clause.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0} {1}' does not match the 'extends {2}' clause.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Параметр "@augments {0}" JSDoc не соответствует предложению "extends {1}".]]></Val>
|
||||
<Val><![CDATA[Параметр "@{0} {1}" JSDoc не соответствует предложению "extends {2}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";JSDoc_augments_is_not_attached_to_a_class_declaration_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";JSDoc_0_is_not_attached_to_a_class_8022" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[JSDoc '@augments' is not attached to a class declaration.]]></Val>
|
||||
<Val><![CDATA[JSDoc '@{0}' is not attached to a class.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Параметр "@augments" JSDoc не связан с объявлением класса.]]></Val>
|
||||
<Val><![CDATA[Параметр "@{0}" JSDoc не связан с классом.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -7253,6 +7316,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_has_a_circular_default_2716" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' has a circular default.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Параметр типа "{0}" по умолчанию является циклическим.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'.]]></Val>
|
||||
@@ -7733,6 +7805,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["{0}" принимает слишком мало аргументов для использования в качестве декоратора. Вы хотели сначала вызвать его и записать "@{0}()"?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA['{0}' are specified twice. The attribute named '{0}' will be overwritten.]]></Val>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function extractMessage(message: string) {
|
||||
export function extractMessage(message: string): string {
|
||||
// Read the content length
|
||||
const contentLengthPrefix = "Content-Length: ";
|
||||
const lines = message.split(/\r?\n/);
|
||||
@@ -198,7 +198,9 @@ namespace ts.server {
|
||||
const request = this.processRequest<protocol.CompletionDetailsRequest>(CommandNames.CompletionDetails, args);
|
||||
const response = this.processResponse<protocol.CompletionDetailsResponse>(request);
|
||||
Debug.assert(response.body.length === 1, "Unexpected length of completion details response body.");
|
||||
return response.body[0];
|
||||
|
||||
const convertedCodeActions = map(response.body[0].codeActions, codeAction => this.convertCodeActions(codeAction, fileName));
|
||||
return { ...response.body[0], codeActions: convertedCodeActions };
|
||||
}
|
||||
|
||||
getCompletionEntrySymbol(_fileName: string, _position: number, _entryName: string): Symbol {
|
||||
@@ -540,6 +542,8 @@ namespace ts.server {
|
||||
return response.body.map(entry => this.convertCodeActions(entry, file));
|
||||
}
|
||||
|
||||
applyCodeActionCommand = notImplemented;
|
||||
|
||||
private createFileLocationOrRangeRequestArgs(positionOrRange: number | TextRange, fileName: string): protocol.FileLocationOrRangeRequestArgs {
|
||||
return typeof positionOrRange === "number"
|
||||
? this.createFileLocationRequestArgs(fileName, positionOrRange)
|
||||
|
||||
@@ -569,6 +569,11 @@ namespace ts.server {
|
||||
});
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
hasPendingProjectUpdate(project: Project) {
|
||||
return this.pendingProjectUpdates.has(project.getProjectName());
|
||||
}
|
||||
|
||||
private sendProjectsUpdatedInBackgroundEvent() {
|
||||
if (!this.eventHandler) {
|
||||
return;
|
||||
@@ -810,8 +815,14 @@ namespace ts.server {
|
||||
);
|
||||
}
|
||||
|
||||
/** Gets the config file existence info for the configured project */
|
||||
/*@internal*/
|
||||
getConfigFileExistenceInfo(project: ConfiguredProject) {
|
||||
return this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath);
|
||||
}
|
||||
|
||||
private onConfigChangedForConfiguredProject(project: ConfiguredProject, eventKind: FileWatcherEventKind) {
|
||||
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath);
|
||||
const configFileExistenceInfo = this.getConfigFileExistenceInfo(project);
|
||||
if (eventKind === FileWatcherEventKind.Deleted) {
|
||||
// Update the cached status
|
||||
// We arent updating or removing the cached config file presence info as that will be taken care of by
|
||||
@@ -913,18 +924,6 @@ namespace ts.server {
|
||||
return project;
|
||||
}
|
||||
|
||||
private addToListOfOpenFiles(info: ScriptInfo) {
|
||||
Debug.assert(!info.isOrphan());
|
||||
for (const p of info.containingProjects) {
|
||||
// file is the part of configured project, addref the project
|
||||
if (p.projectKind === ProjectKind.Configured) {
|
||||
((<ConfiguredProject>p)).addOpenRef();
|
||||
}
|
||||
}
|
||||
|
||||
this.openFiles.push(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove this file from the set of open, non-configured files.
|
||||
* @param info The file that has been closed or newly configured
|
||||
@@ -947,10 +946,8 @@ namespace ts.server {
|
||||
if (info.hasMixedContent) {
|
||||
info.registerFileUpdate();
|
||||
}
|
||||
// Delete the reference to the open configured projects but
|
||||
// do not remove the project so that we can reuse this project
|
||||
// Do not remove the project so that we can reuse this project
|
||||
// if it would need to be re-created with next file open
|
||||
(<ConfiguredProject>p).deleteOpenRef();
|
||||
}
|
||||
else if (p.projectKind === ProjectKind.Inferred && p.isRoot(info)) {
|
||||
// If this was the open root file of inferred project
|
||||
@@ -1040,7 +1037,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
private setConfigFileExistenceByNewConfiguredProject(project: ConfiguredProject) {
|
||||
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath);
|
||||
const configFileExistenceInfo = this.getConfigFileExistenceInfo(project);
|
||||
if (configFileExistenceInfo) {
|
||||
Debug.assert(configFileExistenceInfo.exists);
|
||||
// close existing watcher
|
||||
@@ -1069,7 +1066,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
private setConfigFileExistenceInfoByClosedConfiguredProject(closedProject: ConfiguredProject) {
|
||||
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(closedProject.canonicalConfigFilePath);
|
||||
const configFileExistenceInfo = this.getConfigFileExistenceInfo(closedProject);
|
||||
Debug.assert(!!configFileExistenceInfo);
|
||||
if (configFileExistenceInfo.openFilesImpactedByConfigFile.size) {
|
||||
const configFileName = closedProject.getConfigFilePath();
|
||||
@@ -1353,10 +1350,10 @@ namespace ts.server {
|
||||
const projectOptions: ProjectOptions = {
|
||||
files: parsedCommandLine.fileNames,
|
||||
compilerOptions: parsedCommandLine.options,
|
||||
configHasExtendsProperty: parsedCommandLine.raw["extends"] !== undefined,
|
||||
configHasFilesProperty: parsedCommandLine.raw["files"] !== undefined,
|
||||
configHasIncludeProperty: parsedCommandLine.raw["include"] !== undefined,
|
||||
configHasExcludeProperty: parsedCommandLine.raw["exclude"] !== undefined,
|
||||
configHasExtendsProperty: parsedCommandLine.raw.extends !== undefined,
|
||||
configHasFilesProperty: parsedCommandLine.raw.files !== undefined,
|
||||
configHasIncludeProperty: parsedCommandLine.raw.include !== undefined,
|
||||
configHasExcludeProperty: parsedCommandLine.raw.exclude !== undefined,
|
||||
wildcardDirectories: createMapFromTemplate(parsedCommandLine.wildcardDirectories),
|
||||
typeAcquisition: parsedCommandLine.typeAcquisition,
|
||||
compileOnSave: parsedCommandLine.compileOnSave
|
||||
@@ -1958,7 +1955,8 @@ namespace ts.server {
|
||||
|
||||
this.assignOrphanScriptInfoToInferredProject(info, projectRootPath);
|
||||
}
|
||||
this.addToListOfOpenFiles(info);
|
||||
Debug.assert(!info.isOrphan());
|
||||
this.openFiles.push(info);
|
||||
|
||||
if (sendConfigFileDiagEvent) {
|
||||
configFileErrors = project.getAllProjectErrors();
|
||||
@@ -2058,11 +2056,14 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
private closeConfiguredProject(configFile: NormalizedPath): boolean {
|
||||
private closeConfiguredProjectReferencedFromExternalProject(configFile: NormalizedPath): boolean {
|
||||
const configuredProject = this.findConfiguredProjectByProjectName(configFile);
|
||||
if (configuredProject && configuredProject.deleteOpenRef() === 0) {
|
||||
this.removeProject(configuredProject);
|
||||
return true;
|
||||
if (configuredProject) {
|
||||
configuredProject.deleteExternalProjectReference();
|
||||
if (!configuredProject.hasOpenRef()) {
|
||||
this.removeProject(configuredProject);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2073,7 +2074,7 @@ namespace ts.server {
|
||||
if (configFiles) {
|
||||
let shouldRefreshInferredProjects = false;
|
||||
for (const configFile of configFiles) {
|
||||
if (this.closeConfiguredProject(configFile)) {
|
||||
if (this.closeConfiguredProjectReferencedFromExternalProject(configFile)) {
|
||||
shouldRefreshInferredProjects = true;
|
||||
}
|
||||
}
|
||||
@@ -2268,7 +2269,7 @@ namespace ts.server {
|
||||
const newConfig = tsConfigFiles[iNew];
|
||||
const oldConfig = oldConfigFiles[iOld];
|
||||
if (oldConfig < newConfig) {
|
||||
this.closeConfiguredProject(oldConfig);
|
||||
this.closeConfiguredProjectReferencedFromExternalProject(oldConfig);
|
||||
iOld++;
|
||||
}
|
||||
else if (oldConfig > newConfig) {
|
||||
@@ -2283,7 +2284,7 @@ namespace ts.server {
|
||||
}
|
||||
for (let i = iOld; i < oldConfigFiles.length; i++) {
|
||||
// projects for all remaining old config files should be closed
|
||||
this.closeConfiguredProject(oldConfigFiles[i]);
|
||||
this.closeConfiguredProjectReferencedFromExternalProject(oldConfigFiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2298,7 +2299,7 @@ namespace ts.server {
|
||||
}
|
||||
if (project && !contains(exisingConfigFiles, tsconfigFile)) {
|
||||
// keep project alive even if no documents are opened - its lifetime is bound to the lifetime of containing external project
|
||||
project.addOpenRef();
|
||||
project.addExternalProjectReference();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+57
-28
@@ -242,6 +242,16 @@ namespace ts.server {
|
||||
this.markAsDirty();
|
||||
}
|
||||
|
||||
isKnownTypesPackageName(name: string): boolean {
|
||||
return this.typingsCache.isKnownTypesPackageName(name);
|
||||
}
|
||||
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult> {
|
||||
return this.typingsCache.installPackage({ ...options, projectRootPath: this.toPath(this.currentDirectory) });
|
||||
}
|
||||
private get typingsCache(): TypingsCache {
|
||||
return this.projectService.typingsCache;
|
||||
}
|
||||
|
||||
// Method of LanguageServiceHost
|
||||
getCompilationSettings() {
|
||||
return this.compilerOptions;
|
||||
@@ -433,31 +443,33 @@ namespace ts.server {
|
||||
if (!this.builder) {
|
||||
this.builder = createBuilder({
|
||||
getCanonicalFileName: this.projectService.toCanonicalFileName,
|
||||
getEmitOutput: (_program, sourceFile, emitOnlyDts, isDetailed) =>
|
||||
this.getFileEmitOutput(sourceFile, emitOnlyDts, isDetailed),
|
||||
computeHash: data =>
|
||||
this.projectService.host.createHash(data),
|
||||
shouldEmitFile: sourceFile =>
|
||||
!this.projectService.getScriptInfoForPath(sourceFile.path).isDynamicOrHasMixedContent()
|
||||
computeHash: data => this.projectService.host.createHash(data)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private shouldEmitFile(scriptInfo: ScriptInfo) {
|
||||
return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent();
|
||||
}
|
||||
|
||||
getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[] {
|
||||
if (!this.languageServiceEnabled) {
|
||||
return [];
|
||||
}
|
||||
this.updateGraph();
|
||||
this.ensureBuilder();
|
||||
return this.builder.getFilesAffectedBy(this.program, scriptInfo.path);
|
||||
return mapDefined(this.builder.getFilesAffectedBy(this.program, scriptInfo.path),
|
||||
sourceFile => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if emit was conducted
|
||||
*/
|
||||
emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean {
|
||||
this.ensureBuilder();
|
||||
const { emitSkipped, outputFiles } = this.builder.emitFile(this.program, scriptInfo.path);
|
||||
if (!this.languageServiceEnabled || !this.shouldEmitFile(scriptInfo)) {
|
||||
return false;
|
||||
}
|
||||
const { emitSkipped, outputFiles } = this.getLanguageService(/*ensureSynchronized*/ false).getEmitOutput(scriptInfo.fileName);
|
||||
if (!emitSkipped) {
|
||||
for (const outputFile of outputFiles) {
|
||||
const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, this.currentDirectory);
|
||||
@@ -583,13 +595,6 @@ namespace ts.server {
|
||||
});
|
||||
}
|
||||
|
||||
private getFileEmitOutput(sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean) {
|
||||
if (!this.languageServiceEnabled) {
|
||||
return undefined;
|
||||
}
|
||||
return this.getLanguageService(/*ensureSynchronized*/ false).getEmitOutput(sourceFile.fileName, emitOnlyDtsFiles, isDetailed);
|
||||
}
|
||||
|
||||
getExcludedFiles(): ReadonlyArray<NormalizedPath> {
|
||||
return emptyArray;
|
||||
}
|
||||
@@ -898,9 +903,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
getScriptInfoForNormalizedPath(fileName: NormalizedPath) {
|
||||
const scriptInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(
|
||||
fileName, /*scriptKind*/ undefined, /*hasMixedContent*/ undefined, this.directoryStructureHost
|
||||
);
|
||||
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(fileName);
|
||||
if (scriptInfo && !scriptInfo.isAttached(this)) {
|
||||
return Errors.ThrowProjectDoesNotContainDocument(fileName, this);
|
||||
}
|
||||
@@ -908,7 +911,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
getScriptInfo(uncheckedFileName: string) {
|
||||
return this.getScriptInfoForNormalizedPath(toNormalizedPath(uncheckedFileName));
|
||||
return this.projectService.getScriptInfo(uncheckedFileName);
|
||||
}
|
||||
|
||||
filesToString(writeProjectFileNames: boolean) {
|
||||
@@ -1136,8 +1139,8 @@ namespace ts.server {
|
||||
|
||||
private plugins: PluginModule[] = [];
|
||||
|
||||
/** Used for configured projects which may have multiple open roots */
|
||||
openRefCount = 0;
|
||||
/** Ref count to the project when opened from external project */
|
||||
private externalProjectRefCount = 0;
|
||||
|
||||
private projectErrors: Diagnostic[];
|
||||
|
||||
@@ -1348,17 +1351,43 @@ namespace ts.server {
|
||||
super.close();
|
||||
}
|
||||
|
||||
addOpenRef() {
|
||||
this.openRefCount++;
|
||||
/* @internal */
|
||||
addExternalProjectReference() {
|
||||
this.externalProjectRefCount++;
|
||||
}
|
||||
|
||||
deleteOpenRef() {
|
||||
this.openRefCount--;
|
||||
return this.openRefCount;
|
||||
/* @internal */
|
||||
deleteExternalProjectReference() {
|
||||
this.externalProjectRefCount--;
|
||||
}
|
||||
|
||||
/** Returns true if the project is needed by any of the open script info/external project */
|
||||
/* @internal */
|
||||
hasOpenRef() {
|
||||
return !!this.openRefCount;
|
||||
if (!!this.externalProjectRefCount) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Closed project doesnt have any reference
|
||||
if (this.isClosed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const configFileExistenceInfo = this.projectService.getConfigFileExistenceInfo(this);
|
||||
if (this.projectService.hasPendingProjectUpdate(this)) {
|
||||
// If there is pending update for this project,
|
||||
// we dont know if this project would be needed by any of the open files impacted by this config file
|
||||
// In that case keep the project alive if there are open files impacted by this project
|
||||
return !!configFileExistenceInfo.openFilesImpactedByConfigFile.size;
|
||||
}
|
||||
|
||||
// If there is no pending update for this project,
|
||||
// We know exact set of open files that get impacted by this configured project as the files in the project
|
||||
// The project is referenced only if open files impacted by this project are present in this project
|
||||
return forEachEntry(
|
||||
configFileExistenceInfo.openFilesImpactedByConfigFile,
|
||||
(_value, infoPath) => this.containsScriptInfo(this.projectService.getScriptInfoForPath(infoPath as Path))
|
||||
) || false;
|
||||
}
|
||||
|
||||
getEffectiveTypeRoots() {
|
||||
|
||||
+33
-1
@@ -94,6 +94,7 @@ namespace ts.server.protocol {
|
||||
BreakpointStatement = "breakpointStatement",
|
||||
CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects",
|
||||
GetCodeFixes = "getCodeFixes",
|
||||
ApplyCodeActionCommand = "applyCodeActionCommand",
|
||||
/* @internal */
|
||||
GetCodeFixesFull = "getCodeFixes-full",
|
||||
GetSupportedCodeFixes = "getSupportedCodeFixes",
|
||||
@@ -125,6 +126,8 @@ namespace ts.server.protocol {
|
||||
* Client-initiated request message
|
||||
*/
|
||||
export interface Request extends Message {
|
||||
type: "request";
|
||||
|
||||
/**
|
||||
* The command to execute
|
||||
*/
|
||||
@@ -147,6 +150,8 @@ namespace ts.server.protocol {
|
||||
* Server-initiated event message
|
||||
*/
|
||||
export interface Event extends Message {
|
||||
type: "event";
|
||||
|
||||
/**
|
||||
* Name of event
|
||||
*/
|
||||
@@ -162,6 +167,8 @@ namespace ts.server.protocol {
|
||||
* Response by server to client request message.
|
||||
*/
|
||||
export interface Response extends Message {
|
||||
type: "response";
|
||||
|
||||
/**
|
||||
* Sequence number of the request message.
|
||||
*/
|
||||
@@ -178,7 +185,8 @@ namespace ts.server.protocol {
|
||||
command: string;
|
||||
|
||||
/**
|
||||
* Contains error message if success === false.
|
||||
* If success === false, this should always be provided.
|
||||
* Otherwise, may (or may not) contain a success message.
|
||||
*/
|
||||
message?: string;
|
||||
|
||||
@@ -520,6 +528,14 @@ namespace ts.server.protocol {
|
||||
arguments: CodeFixRequestArgs;
|
||||
}
|
||||
|
||||
export interface ApplyCodeActionCommandRequest extends Request {
|
||||
command: CommandTypes.ApplyCodeActionCommand;
|
||||
arguments: ApplyCodeActionCommandRequestArgs;
|
||||
}
|
||||
|
||||
// All we need is the `success` and `message` fields of Response.
|
||||
export interface ApplyCodeActionCommandResponse extends Response {}
|
||||
|
||||
export interface FileRangeRequestArgs extends FileRequestArgs {
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
@@ -564,6 +580,10 @@ namespace ts.server.protocol {
|
||||
errorCodes?: number[];
|
||||
}
|
||||
|
||||
export interface ApplyCodeActionCommandRequestArgs extends FileRequestArgs {
|
||||
command: {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Response for GetCodeFixes request.
|
||||
*/
|
||||
@@ -1541,6 +1561,8 @@ namespace ts.server.protocol {
|
||||
description: string;
|
||||
/** Text changes to apply to each file as part of the code action */
|
||||
changes: FileCodeEdits[];
|
||||
/** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
|
||||
commands?: {}[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1658,6 +1680,11 @@ namespace ts.server.protocol {
|
||||
* this span should be used instead of the default one.
|
||||
*/
|
||||
replacementSpan?: TextSpan;
|
||||
/**
|
||||
* Indicates whether commiting this completion entry will require additional code actions to be
|
||||
* made to avoid errors. The CompletionEntryDetails will have these actions.
|
||||
*/
|
||||
hasAction?: true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1690,6 +1717,11 @@ namespace ts.server.protocol {
|
||||
* JSDoc tags for the symbol.
|
||||
*/
|
||||
tags: JSDocTagInfo[];
|
||||
|
||||
/**
|
||||
* The associated code actions for this entry
|
||||
*/
|
||||
codeActions?: CodeAction[];
|
||||
}
|
||||
|
||||
export interface CompletionsResponse extends Response {
|
||||
|
||||
+55
-9
@@ -250,6 +250,9 @@ namespace ts.server {
|
||||
private activeRequestCount = 0;
|
||||
private requestQueue: QueuedOperation[] = [];
|
||||
private requestMap = createMap<QueuedOperation>(); // Maps operation ID to newest requestQueue entry with that ID
|
||||
/** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */
|
||||
private requestedRegistry: boolean;
|
||||
private typesRegistryCache: Map<void> | undefined;
|
||||
|
||||
// This number is essentially arbitrary. Processing more than one typings request
|
||||
// at a time makes sense, but having too many in the pipe results in a hang
|
||||
@@ -258,7 +261,7 @@ namespace ts.server {
|
||||
// buffer, but we have yet to find a way to retrieve that value.
|
||||
private static readonly maxActiveRequestCount = 10;
|
||||
private static readonly requestDelayMillis = 100;
|
||||
|
||||
private packageInstalledPromise: { resolve(value: ApplyCodeActionCommandResult): void, reject(reason: any): void };
|
||||
|
||||
constructor(
|
||||
private readonly telemetryEnabled: boolean,
|
||||
@@ -278,6 +281,31 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
isKnownTypesPackageName(name: string): boolean {
|
||||
// We want to avoid looking this up in the registry as that is expensive. So first check that it's actually an NPM package.
|
||||
const validationResult = JsTyping.validatePackageName(name);
|
||||
if (validationResult !== JsTyping.PackageNameValidationResult.Ok) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.requestedRegistry) {
|
||||
return !!this.typesRegistryCache && this.typesRegistryCache.has(name);
|
||||
}
|
||||
|
||||
this.requestedRegistry = true;
|
||||
this.send({ kind: "typesRegistry" });
|
||||
return false;
|
||||
}
|
||||
|
||||
installPackage(options: InstallPackageOptionsWithProjectRootPath): Promise<ApplyCodeActionCommandResult> {
|
||||
const rq: InstallPackageRequest = { kind: "installPackage", ...options };
|
||||
this.send(rq);
|
||||
Debug.assert(this.packageInstalledPromise === undefined);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.packageInstalledPromise = { resolve, reject };
|
||||
});
|
||||
}
|
||||
|
||||
private reportInstallerProcessId() {
|
||||
if (this.installerPidReported) {
|
||||
return;
|
||||
@@ -343,23 +371,27 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
onProjectClosed(p: Project): void {
|
||||
this.installer.send({ projectName: p.getProjectName(), kind: "closeProject" });
|
||||
this.send({ projectName: p.getProjectName(), kind: "closeProject" });
|
||||
}
|
||||
|
||||
private send(rq: TypingInstallerRequestUnion): void {
|
||||
this.installer.send(rq);
|
||||
}
|
||||
|
||||
enqueueInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>): void {
|
||||
const request = createInstallTypingsRequest(project, typeAcquisition, unresolvedImports);
|
||||
if (this.logger.hasLevel(LogLevel.verbose)) {
|
||||
if (this.logger.hasLevel(LogLevel.verbose)) {
|
||||
this.logger.info(`Scheduling throttled operation: ${JSON.stringify(request)}`);
|
||||
this.logger.info(`Scheduling throttled operation:${stringifyIndented(request)}`);
|
||||
}
|
||||
}
|
||||
|
||||
const operationId = project.getProjectName();
|
||||
const operation = () => {
|
||||
if (this.logger.hasLevel(LogLevel.verbose)) {
|
||||
this.logger.info(`Sending request: ${JSON.stringify(request)}`);
|
||||
this.logger.info(`Sending request:${stringifyIndented(request)}`);
|
||||
}
|
||||
this.installer.send(request);
|
||||
this.send(request);
|
||||
};
|
||||
const queuedRequest: QueuedOperation = { operationId, operation };
|
||||
|
||||
@@ -375,12 +407,26 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
private handleMessage(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | InitializationFailedResponse) {
|
||||
private handleMessage(response: TypesRegistryResponse | PackageInstalledResponse | SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | InitializationFailedResponse) {
|
||||
if (this.logger.hasLevel(LogLevel.verbose)) {
|
||||
this.logger.info(`Received response: ${JSON.stringify(response)}`);
|
||||
this.logger.info(`Received response:${stringifyIndented(response)}`);
|
||||
}
|
||||
|
||||
switch (response.kind) {
|
||||
case EventTypesRegistry:
|
||||
this.typesRegistryCache = ts.createMapFromTemplate(response.typesRegistry);
|
||||
break;
|
||||
case EventPackageInstalled: {
|
||||
const { success, message } = response;
|
||||
if (success) {
|
||||
this.packageInstalledPromise.resolve({ successMessage: message });
|
||||
}
|
||||
else {
|
||||
this.packageInstalledPromise.reject(message);
|
||||
}
|
||||
this.packageInstalledPromise = undefined;
|
||||
break;
|
||||
}
|
||||
case EventInitializationFailed:
|
||||
{
|
||||
if (!this.eventSender) {
|
||||
@@ -580,7 +626,7 @@ namespace ts.server {
|
||||
function createLogger() {
|
||||
const cmdLineLogFileName = findArgument("--logFile");
|
||||
const cmdLineVerbosity = getLogLevel(findArgument("--logVerbosity"));
|
||||
const envLogOptions = parseLoggingEnvironmentString(process.env["TSS_LOG"]);
|
||||
const envLogOptions = parseLoggingEnvironmentString(process.env.TSS_LOG);
|
||||
|
||||
const logFileName = cmdLineLogFileName
|
||||
? stripQuotes(cmdLineLogFileName)
|
||||
@@ -780,7 +826,7 @@ namespace ts.server {
|
||||
try {
|
||||
const args = [combinePaths(__dirname, "watchGuard.js"), path];
|
||||
if (logger.hasLevel(LogLevel.verbose)) {
|
||||
logger.info(`Starting ${process.execPath} with args ${JSON.stringify(args)}`);
|
||||
logger.info(`Starting ${process.execPath} with args:${stringifyIndented(args)}`);
|
||||
}
|
||||
childProcess.execFileSync(process.execPath, args, { stdio: "ignore", env: { "ELECTRON_RUN_AS_NODE": "1" } });
|
||||
status = true;
|
||||
|
||||
+72
-36
@@ -131,7 +131,7 @@ namespace ts.server {
|
||||
|
||||
const json = JSON.stringify(msg);
|
||||
if (verboseLogging) {
|
||||
logger.info(msg.type + ": " + json);
|
||||
logger.info(`${msg.type}:${indent(json)}`);
|
||||
}
|
||||
|
||||
const len = byteLength(json, "utf8");
|
||||
@@ -383,9 +383,9 @@ namespace ts.server {
|
||||
public logError(err: Error, cmd: string) {
|
||||
let msg = "Exception on executing command " + cmd;
|
||||
if (err.message) {
|
||||
msg += ":\n" + err.message;
|
||||
msg += ":\n" + indent(err.message);
|
||||
if ((<StackTraceError>err).stack) {
|
||||
msg += "\n" + (<StackTraceError>err).stack;
|
||||
msg += "\n" + indent((<StackTraceError>err).stack);
|
||||
}
|
||||
}
|
||||
this.logger.msg(msg, Msg.Err);
|
||||
@@ -411,19 +411,27 @@ namespace ts.server {
|
||||
this.send(ev);
|
||||
}
|
||||
|
||||
public output(info: any, cmdName: string, reqSeq = 0, errorMsg?: string) {
|
||||
// For backwards-compatibility only.
|
||||
public output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void {
|
||||
this.doOutput(info, cmdName, reqSeq, /*success*/ !errorMsg, errorMsg);
|
||||
}
|
||||
|
||||
private doOutput(info: {} | undefined, cmdName: string, reqSeq: number, success: boolean, message?: string): void {
|
||||
const res: protocol.Response = {
|
||||
seq: 0,
|
||||
type: "response",
|
||||
command: cmdName,
|
||||
request_seq: reqSeq,
|
||||
success: !errorMsg,
|
||||
success,
|
||||
};
|
||||
if (!errorMsg) {
|
||||
if (success) {
|
||||
res.body = info;
|
||||
}
|
||||
else {
|
||||
res.message = errorMsg;
|
||||
Debug.assert(info === undefined);
|
||||
}
|
||||
if (message) {
|
||||
res.message = message;
|
||||
}
|
||||
this.send(res);
|
||||
}
|
||||
@@ -1178,11 +1186,12 @@ namespace ts.server {
|
||||
|
||||
const completions = project.getLanguageService().getCompletionsAtPosition(file, position);
|
||||
if (simplifiedResult) {
|
||||
return mapDefined(completions && completions.entries, entry => {
|
||||
return mapDefined<CompletionEntry, protocol.CompletionEntry>(completions && completions.entries, entry => {
|
||||
if (completions.isMemberCompletion || (entry.name.toLowerCase().indexOf(prefix.toLowerCase()) === 0)) {
|
||||
const { name, kind, kindModifiers, sortText, replacementSpan } = entry;
|
||||
const { name, kind, kindModifiers, sortText, replacementSpan, hasAction } = entry;
|
||||
const convertedSpan = replacementSpan ? this.decorateSpan(replacementSpan, scriptInfo) : undefined;
|
||||
return { name, kind, kindModifiers, sortText, replacementSpan: convertedSpan };
|
||||
// Use `hasAction || undefined` to avoid serializing `false`.
|
||||
return { name, kind, kindModifiers, sortText, replacementSpan: convertedSpan, hasAction: hasAction || undefined };
|
||||
}
|
||||
}).sort((a, b) => compareStrings(a.name, b.name));
|
||||
}
|
||||
@@ -1193,10 +1202,20 @@ namespace ts.server {
|
||||
|
||||
private getCompletionEntryDetails(args: protocol.CompletionDetailsRequestArgs): ReadonlyArray<protocol.CompletionEntryDetails> {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
const position = this.getPositionInFile(args, file);
|
||||
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file);
|
||||
const position = this.getPosition(args, scriptInfo);
|
||||
const formattingOptions = project.projectService.getFormatCodeOptions(file);
|
||||
|
||||
return mapDefined(args.entryNames, entryName =>
|
||||
project.getLanguageService().getCompletionEntryDetails(file, position, entryName));
|
||||
return mapDefined(args.entryNames, entryName => {
|
||||
const details = project.getLanguageService().getCompletionEntryDetails(file, position, entryName, formattingOptions);
|
||||
if (details) {
|
||||
const mappedCodeActions = map(details.codeActions, action => this.mapCodeAction(action, scriptInfo));
|
||||
return { ...details, codeActions: mappedCodeActions };
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getCompileOnSaveAffectedFileList(args: protocol.FileRequestArgs): ReadonlyArray<protocol.CompileOnSaveAffectedFileListSingleProject> {
|
||||
@@ -1296,7 +1315,7 @@ namespace ts.server {
|
||||
this.changeSeq++;
|
||||
// make sure no changes happen before this one is finished
|
||||
if (project.reloadScript(file, tempFileName)) {
|
||||
this.output(undefined, CommandNames.Reload, reqSeq);
|
||||
this.doOutput(/*info*/ undefined, CommandNames.Reload, reqSeq, /*success*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1534,6 +1553,15 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
private applyCodeActionCommand(commandName: string, requestSeq: number, args: protocol.ApplyCodeActionCommandRequestArgs): void {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
const output = (success: boolean, message: string) => this.doOutput({}, commandName, requestSeq, success, message);
|
||||
const command = args.command as CodeActionCommand; // They should be sending back the command we sent them.
|
||||
project.getLanguageService().applyCodeActionCommand(file, command).then(
|
||||
({ successMessage }) => { output(/*success*/ true, successMessage); },
|
||||
error => { output(/*success*/ false, error); });
|
||||
}
|
||||
|
||||
private getStartAndEndPosition(args: protocol.FileRangeRequestArgs, scriptInfo: ScriptInfo) {
|
||||
let startPosition: number = undefined, endPosition: number = undefined;
|
||||
if (args.startPosition !== undefined) {
|
||||
@@ -1556,14 +1584,12 @@ namespace ts.server {
|
||||
return { startPosition, endPosition };
|
||||
}
|
||||
|
||||
private mapCodeAction(codeAction: CodeAction, scriptInfo: ScriptInfo): protocol.CodeAction {
|
||||
return {
|
||||
description: codeAction.description,
|
||||
changes: codeAction.changes.map(change => ({
|
||||
fileName: change.fileName,
|
||||
textChanges: change.textChanges.map(textChange => this.convertTextChangeToCodeEdit(textChange, scriptInfo))
|
||||
}))
|
||||
};
|
||||
private mapCodeAction({ description, changes: unmappedChanges, commands }: CodeAction, scriptInfo: ScriptInfo): protocol.CodeAction {
|
||||
const changes = unmappedChanges.map(change => ({
|
||||
fileName: change.fileName,
|
||||
textChanges: change.textChanges.map(textChange => this.convertTextChangeToCodeEdit(textChange, scriptInfo))
|
||||
}));
|
||||
return { description, changes, commands };
|
||||
}
|
||||
|
||||
private mapTextChangesToCodeEdits(project: Project, textChanges: FileTextChanges): protocol.FileCodeEdits {
|
||||
@@ -1649,15 +1675,15 @@ namespace ts.server {
|
||||
exit() {
|
||||
}
|
||||
|
||||
private notRequired() {
|
||||
private notRequired(): HandlerResponse {
|
||||
return { responseRequired: false };
|
||||
}
|
||||
|
||||
private requiredResponse(response: any) {
|
||||
private requiredResponse(response: {}): HandlerResponse {
|
||||
return { response, responseRequired: true };
|
||||
}
|
||||
|
||||
private handlers = createMapFromTemplate<(request: protocol.Request) => { response?: any, responseRequired?: boolean }>({
|
||||
private handlers = createMapFromTemplate<(request: protocol.Request) => HandlerResponse>({
|
||||
[CommandNames.OpenExternalProject]: (request: protocol.OpenExternalProjectRequest) => {
|
||||
this.projectService.openExternalProject(request.arguments, /*suppressRefreshOfInferredProjects*/ false);
|
||||
// TODO: report errors
|
||||
@@ -1835,7 +1861,7 @@ namespace ts.server {
|
||||
},
|
||||
[CommandNames.Configure]: (request: protocol.ConfigureRequest) => {
|
||||
this.projectService.setHostConfiguration(request.arguments);
|
||||
this.output(undefined, CommandNames.Configure, request.seq);
|
||||
this.doOutput(/*info*/ undefined, CommandNames.Configure, request.seq, /*success*/ true);
|
||||
return this.notRequired();
|
||||
},
|
||||
[CommandNames.Reload]: (request: protocol.ReloadRequest) => {
|
||||
@@ -1902,6 +1928,10 @@ namespace ts.server {
|
||||
[CommandNames.GetCodeFixesFull]: (request: protocol.CodeFixRequest) => {
|
||||
return this.requiredResponse(this.getCodeFixes(request.arguments, /*simplifiedResult*/ false));
|
||||
},
|
||||
[CommandNames.ApplyCodeActionCommand]: (request: protocol.ApplyCodeActionCommandRequest) => {
|
||||
this.applyCodeActionCommand(request.command, request.seq, request.arguments);
|
||||
return this.notRequired(); // Response will come asynchronously.
|
||||
},
|
||||
[CommandNames.GetSupportedCodeFixes]: () => {
|
||||
return this.requiredResponse(this.getSupportedCodeFixes());
|
||||
},
|
||||
@@ -1916,7 +1946,7 @@ namespace ts.server {
|
||||
}
|
||||
});
|
||||
|
||||
public addProtocolHandler(command: string, handler: (request: protocol.Request) => { response?: any, responseRequired: boolean }) {
|
||||
public addProtocolHandler(command: string, handler: (request: protocol.Request) => HandlerResponse) {
|
||||
if (this.handlers.has(command)) {
|
||||
throw new Error(`Protocol handler already exists for command "${command}"`);
|
||||
}
|
||||
@@ -1945,14 +1975,14 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
public executeCommand(request: protocol.Request): { response?: any, responseRequired?: boolean } {
|
||||
public executeCommand(request: protocol.Request): HandlerResponse {
|
||||
const handler = this.handlers.get(request.command);
|
||||
if (handler) {
|
||||
return this.executeWithRequestId(request.seq, () => handler(request));
|
||||
}
|
||||
else {
|
||||
this.logger.msg(`Unrecognized JSON command: ${JSON.stringify(request)}`, Msg.Err);
|
||||
this.output(undefined, CommandNames.Unknown, request.seq, `Unrecognized JSON command: ${request.command}`);
|
||||
this.logger.msg(`Unrecognized JSON command:${stringifyIndented(request)}`, Msg.Err);
|
||||
this.doOutput(/*info*/ undefined, CommandNames.Unknown, request.seq, /*success*/ false, `Unrecognized JSON command: ${request.command}`);
|
||||
return { responseRequired: false };
|
||||
}
|
||||
}
|
||||
@@ -1963,7 +1993,7 @@ namespace ts.server {
|
||||
if (this.logger.hasLevel(LogLevel.requestTime)) {
|
||||
start = this.hrtime();
|
||||
if (this.logger.hasLevel(LogLevel.verbose)) {
|
||||
this.logger.info(`request: ${message}`);
|
||||
this.logger.info(`request:${indent(message)}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1983,25 +2013,31 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
if (response) {
|
||||
this.output(response, request.command, request.seq);
|
||||
this.doOutput(response, request.command, request.seq, /*success*/ true);
|
||||
}
|
||||
else if (responseRequired) {
|
||||
this.output(undefined, request.command, request.seq, "No content available.");
|
||||
this.doOutput(/*info*/ undefined, request.command, request.seq, /*success*/ false, "No content available.");
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
if (err instanceof OperationCanceledException) {
|
||||
// Handle cancellation exceptions
|
||||
this.output({ canceled: true }, request.command, request.seq);
|
||||
this.doOutput({ canceled: true }, request.command, request.seq, /*success*/ true);
|
||||
return;
|
||||
}
|
||||
this.logError(err, message);
|
||||
this.output(
|
||||
undefined,
|
||||
this.doOutput(
|
||||
/*info*/ undefined,
|
||||
request ? request.command : CommandNames.Unknown,
|
||||
request ? request.seq : 0,
|
||||
/*success*/ false,
|
||||
"Error processing request. " + (<StackTraceError>err).message + "\n" + (<StackTraceError>err).stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface HandlerResponse {
|
||||
response?: {};
|
||||
responseRequired?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
namespace ts.server {
|
||||
export const ActionSet: ActionSet = "action::set";
|
||||
export const ActionInvalidate: ActionInvalidate = "action::invalidate";
|
||||
export const EventTypesRegistry: EventTypesRegistry = "event::typesRegistry";
|
||||
export const EventPackageInstalled: EventPackageInstalled = "event::packageInstalled";
|
||||
export const EventBeginInstallTypes: EventBeginInstallTypes = "event::beginInstallTypes";
|
||||
export const EventEndInstallTypes: EventEndInstallTypes = "event::endInstallTypes";
|
||||
export const EventInitializationFailed: EventInitializationFailed = "event::initializationFailed";
|
||||
|
||||
+35
-5
@@ -28,12 +28,14 @@ declare namespace ts.server {
|
||||
" __sortedArrayBrand": any;
|
||||
}
|
||||
|
||||
export interface TypingInstallerRequest {
|
||||
export interface TypingInstallerRequestWithProjectName {
|
||||
readonly projectName: string;
|
||||
readonly kind: "discover" | "closeProject";
|
||||
}
|
||||
|
||||
export interface DiscoverTypings extends TypingInstallerRequest {
|
||||
/* @internal */
|
||||
export type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest;
|
||||
|
||||
export interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
|
||||
readonly fileNames: string[];
|
||||
readonly projectRootPath: Path;
|
||||
readonly compilerOptions: CompilerOptions;
|
||||
@@ -43,18 +45,46 @@ declare namespace ts.server {
|
||||
readonly kind: "discover";
|
||||
}
|
||||
|
||||
export interface CloseProject extends TypingInstallerRequest {
|
||||
export interface CloseProject extends TypingInstallerRequestWithProjectName {
|
||||
readonly kind: "closeProject";
|
||||
}
|
||||
|
||||
export interface TypesRegistryRequest {
|
||||
readonly kind: "typesRegistry";
|
||||
}
|
||||
|
||||
export interface InstallPackageRequest {
|
||||
readonly kind: "installPackage";
|
||||
readonly fileName: Path;
|
||||
readonly packageName: string;
|
||||
readonly projectRootPath: Path;
|
||||
}
|
||||
|
||||
export type ActionSet = "action::set";
|
||||
export type ActionInvalidate = "action::invalidate";
|
||||
export type EventTypesRegistry = "event::typesRegistry";
|
||||
export type EventPackageInstalled = "event::packageInstalled";
|
||||
export type EventBeginInstallTypes = "event::beginInstallTypes";
|
||||
export type EventEndInstallTypes = "event::endInstallTypes";
|
||||
export type EventInitializationFailed = "event::initializationFailed";
|
||||
|
||||
export interface TypingInstallerResponse {
|
||||
readonly kind: ActionSet | ActionInvalidate | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
||||
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | EventPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
|
||||
}
|
||||
/* @internal */
|
||||
export type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse;
|
||||
|
||||
/* @internal */
|
||||
export interface TypesRegistryResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventTypesRegistry;
|
||||
readonly typesRegistry: MapLike<void>;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface PackageInstalledResponse extends TypingInstallerResponse {
|
||||
readonly kind: EventPackageInstalled;
|
||||
readonly success: boolean;
|
||||
readonly message: string;
|
||||
}
|
||||
|
||||
export interface InitializationFailedResponse extends TypingInstallerResponse {
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
/// <reference path="project.ts"/>
|
||||
|
||||
namespace ts.server {
|
||||
export interface InstallPackageOptionsWithProjectRootPath extends InstallPackageOptions {
|
||||
projectRootPath: Path;
|
||||
}
|
||||
|
||||
export interface ITypingsInstaller {
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptionsWithProjectRootPath): Promise<ApplyCodeActionCommandResult>;
|
||||
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>): void;
|
||||
attach(projectService: ProjectService): void;
|
||||
onProjectClosed(p: Project): void;
|
||||
@@ -9,6 +15,9 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
export const nullTypingsInstaller: ITypingsInstaller = {
|
||||
isKnownTypesPackageName: returnFalse,
|
||||
// Should never be called because we never provide a types registry.
|
||||
installPackage: notImplemented,
|
||||
enqueueInstallTypingsRequest: noop,
|
||||
attach: noop,
|
||||
onProjectClosed: noop,
|
||||
@@ -77,6 +86,14 @@ namespace ts.server {
|
||||
constructor(private readonly installer: ITypingsInstaller) {
|
||||
}
|
||||
|
||||
isKnownTypesPackageName(name: string): boolean {
|
||||
return this.installer.isKnownTypesPackageName(name);
|
||||
}
|
||||
|
||||
installPackage(options: InstallPackageOptionsWithProjectRootPath): Promise<ApplyCodeActionCommandResult> {
|
||||
return this.installer.installPackage(options);
|
||||
}
|
||||
|
||||
getTypingsForProject(project: Project, unresolvedImports: SortedReadonlyArray<string>, forceRefresh: boolean): SortedReadonlyArray<string> {
|
||||
const typeAcquisition = project.getTypeAcquisition();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
try {
|
||||
const content = <TypesRegistryFile>JSON.parse(host.readFile(typesRegistryFilePath));
|
||||
return createMapFromTemplate<void>(content.entries);
|
||||
return createMapFromTemplate(content.entries);
|
||||
}
|
||||
catch (e) {
|
||||
if (log.isEnabled()) {
|
||||
@@ -79,7 +79,7 @@ namespace ts.server.typingsInstaller {
|
||||
private readonly npmPath: string;
|
||||
readonly typesRegistry: Map<void>;
|
||||
|
||||
private delayedInitializationError: InitializationFailedResponse;
|
||||
private delayedInitializationError: InitializationFailedResponse | undefined;
|
||||
|
||||
constructor(globalTypingsCacheLocation: string, typingSafeListLocation: string, typesMapLocation: string, npmLocation: string | undefined, throttleLimit: number, log: Log) {
|
||||
super(
|
||||
@@ -127,7 +127,7 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
|
||||
listen() {
|
||||
process.on("message", (req: DiscoverTypings | CloseProject) => {
|
||||
process.on("message", (req: TypingInstallerRequestUnion) => {
|
||||
if (this.delayedInitializationError) {
|
||||
// report initializationFailed error
|
||||
this.sendResponse(this.delayedInitializationError);
|
||||
@@ -139,13 +139,41 @@ namespace ts.server.typingsInstaller {
|
||||
break;
|
||||
case "closeProject":
|
||||
this.closeProject(req);
|
||||
break;
|
||||
case "typesRegistry": {
|
||||
const typesRegistry: { [key: string]: void } = {};
|
||||
this.typesRegistry.forEach((value, key) => {
|
||||
typesRegistry[key] = value;
|
||||
});
|
||||
const response: TypesRegistryResponse = { kind: EventTypesRegistry, typesRegistry };
|
||||
this.sendResponse(response);
|
||||
break;
|
||||
}
|
||||
case "installPackage": {
|
||||
const { fileName, packageName, projectRootPath } = req;
|
||||
const cwd = getDirectoryOfPackageJson(fileName, this.installTypingHost) || projectRootPath;
|
||||
if (cwd) {
|
||||
this.installWorker(-1, [packageName], cwd, success => {
|
||||
const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`;
|
||||
const response: PackageInstalledResponse = { kind: EventPackageInstalled, success, message };
|
||||
this.sendResponse(response);
|
||||
});
|
||||
}
|
||||
else {
|
||||
const response: PackageInstalledResponse = { kind: EventPackageInstalled, success: false, message: "Could not determine a project root path." };
|
||||
this.sendResponse(response);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Debug.assertNever(req);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes | InitializationFailedResponse) {
|
||||
protected sendResponse(response: TypingInstallerResponseUnion) {
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine(`Sending response: ${JSON.stringify(response)}`);
|
||||
this.log.writeLine(`Sending response:\n ${JSON.stringify(response)}`);
|
||||
}
|
||||
process.send(response);
|
||||
if (this.log.isEnabled()) {
|
||||
@@ -153,11 +181,11 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
protected installWorker(requestId: number, args: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void {
|
||||
protected installWorker(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void {
|
||||
if (this.log.isEnabled()) {
|
||||
this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(args)}'.`);
|
||||
this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(packageNames)}'.`);
|
||||
}
|
||||
const command = `${this.npmPath} install --ignore-scripts ${args.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`;
|
||||
const command = `${this.npmPath} install --ignore-scripts ${packageNames.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`;
|
||||
const start = Date.now();
|
||||
const hasError = this.execSyncAndLog(command, { cwd });
|
||||
if (this.log.isEnabled()) {
|
||||
@@ -186,6 +214,14 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
function getDirectoryOfPackageJson(fileName: string, host: InstallTypingHost): string | undefined {
|
||||
return forEachAncestorDirectory(getDirectoryPath(fileName), directory => {
|
||||
if (host.fileExists(combinePaths(directory, "package.json"))) {
|
||||
return directory;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const logFilePath = findArgument(server.Arguments.LogFile);
|
||||
const globalTypingsCacheLocation = findArgument(server.Arguments.GlobalCacheLocation);
|
||||
const typingSafeListLocation = findArgument(server.Arguments.TypingSafeListLocation);
|
||||
|
||||
@@ -32,50 +32,11 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
export enum PackageNameValidationResult {
|
||||
Ok,
|
||||
ScopedPackagesNotSupported,
|
||||
EmptyName,
|
||||
NameTooLong,
|
||||
NameStartsWithDot,
|
||||
NameStartsWithUnderscore,
|
||||
NameContainsNonURISafeCharacters
|
||||
}
|
||||
|
||||
|
||||
export const MaxPackageNameLength = 214;
|
||||
/**
|
||||
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
|
||||
*/
|
||||
export function validatePackageName(packageName: string): PackageNameValidationResult {
|
||||
if (!packageName) {
|
||||
return PackageNameValidationResult.EmptyName;
|
||||
}
|
||||
if (packageName.length > MaxPackageNameLength) {
|
||||
return PackageNameValidationResult.NameTooLong;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === CharacterCodes.dot) {
|
||||
return PackageNameValidationResult.NameStartsWithDot;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === CharacterCodes._) {
|
||||
return PackageNameValidationResult.NameStartsWithUnderscore;
|
||||
}
|
||||
// check if name is scope package like: starts with @ and has one '/' in the middle
|
||||
// scoped packages are not currently supported
|
||||
// TODO: when support will be added we'll need to split and check both scope and package name
|
||||
if (/^@[^/]+\/[^/]+$/.test(packageName)) {
|
||||
return PackageNameValidationResult.ScopedPackagesNotSupported;
|
||||
}
|
||||
if (encodeURIComponent(packageName) !== packageName) {
|
||||
return PackageNameValidationResult.NameContainsNonURISafeCharacters;
|
||||
}
|
||||
return PackageNameValidationResult.Ok;
|
||||
}
|
||||
|
||||
export type RequestCompletedAction = (success: boolean) => void;
|
||||
interface PendingRequest {
|
||||
requestId: number;
|
||||
args: string[];
|
||||
packageNames: string[];
|
||||
cwd: string;
|
||||
onRequestCompleted: RequestCompletedAction;
|
||||
}
|
||||
@@ -255,8 +216,8 @@ namespace ts.server.typingsInstaller {
|
||||
if (this.missingTypingsSet.get(typing) || this.packageNameToTypingLocation.get(typing)) {
|
||||
continue;
|
||||
}
|
||||
const validationResult = validatePackageName(typing);
|
||||
if (validationResult === PackageNameValidationResult.Ok) {
|
||||
const validationResult = JsTyping.validatePackageName(typing);
|
||||
if (validationResult === JsTyping.PackageNameValidationResult.Ok) {
|
||||
if (this.typesRegistry.has(typing)) {
|
||||
result.push(typing);
|
||||
}
|
||||
@@ -270,26 +231,7 @@ namespace ts.server.typingsInstaller {
|
||||
// add typing name to missing set so we won't process it again
|
||||
this.missingTypingsSet.set(typing, true);
|
||||
if (this.log.isEnabled()) {
|
||||
switch (validationResult) {
|
||||
case PackageNameValidationResult.EmptyName:
|
||||
this.log.writeLine(`Package name '${typing}' cannot be empty`);
|
||||
break;
|
||||
case PackageNameValidationResult.NameTooLong:
|
||||
this.log.writeLine(`Package name '${typing}' should be less than ${MaxPackageNameLength} characters`);
|
||||
break;
|
||||
case PackageNameValidationResult.NameStartsWithDot:
|
||||
this.log.writeLine(`Package name '${typing}' cannot start with '.'`);
|
||||
break;
|
||||
case PackageNameValidationResult.NameStartsWithUnderscore:
|
||||
this.log.writeLine(`Package name '${typing}' cannot start with '_'`);
|
||||
break;
|
||||
case PackageNameValidationResult.ScopedPackagesNotSupported:
|
||||
this.log.writeLine(`Package '${typing}' is scoped and currently is not supported`);
|
||||
break;
|
||||
case PackageNameValidationResult.NameContainsNonURISafeCharacters:
|
||||
this.log.writeLine(`Package name '${typing}' contains non URI safe characters`);
|
||||
break;
|
||||
}
|
||||
this.log.writeLine(JsTyping.renderPackageNameValidationFailure(validationResult, typing));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,8 +372,8 @@ namespace ts.server.typingsInstaller {
|
||||
};
|
||||
}
|
||||
|
||||
private installTypingsAsync(requestId: number, args: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void {
|
||||
this.pendingRunRequests.unshift({ requestId, args, cwd, onRequestCompleted });
|
||||
private installTypingsAsync(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void {
|
||||
this.pendingRunRequests.unshift({ requestId, packageNames, cwd, onRequestCompleted });
|
||||
this.executeWithThrottling();
|
||||
}
|
||||
|
||||
@@ -439,7 +381,7 @@ namespace ts.server.typingsInstaller {
|
||||
while (this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length) {
|
||||
this.inFlightRequestCount++;
|
||||
const request = this.pendingRunRequests.pop();
|
||||
this.installWorker(request.requestId, request.args, request.cwd, ok => {
|
||||
this.installWorker(request.requestId, request.packageNames, request.cwd, ok => {
|
||||
this.inFlightRequestCount--;
|
||||
request.onRequestCompleted(ok);
|
||||
this.executeWithThrottling();
|
||||
@@ -447,7 +389,7 @@ namespace ts.server.typingsInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract installWorker(requestId: number, args: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void;
|
||||
protected abstract installWorker(requestId: number, packageNames: string[], cwd: string, onRequestCompleted: RequestCompletedAction): void;
|
||||
protected abstract sendResponse(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -318,4 +318,15 @@ namespace ts.server {
|
||||
deleted(oldItems[oldIndex++]);
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function indent(string: string): string {
|
||||
return "\n " + string;
|
||||
}
|
||||
|
||||
/** Put stringified JSON on the next line, indented. */
|
||||
/* @internal */
|
||||
export function stringifyIndented(json: {}): string {
|
||||
return "\n " + JSON.stringify(json);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,13 @@ namespace ts {
|
||||
getCodeActions(context: CodeFixContext): CodeAction[] | undefined;
|
||||
}
|
||||
|
||||
export interface CodeFixContext {
|
||||
export interface CodeFixContext extends textChanges.TextChangesContext {
|
||||
errorCode: number;
|
||||
sourceFile: SourceFile;
|
||||
span: TextSpan;
|
||||
program: Program;
|
||||
newLineCharacter: string;
|
||||
host: LanguageServiceHost;
|
||||
cancellationToken: CancellationToken;
|
||||
rulesProvider: formatting.RulesProvider;
|
||||
}
|
||||
|
||||
export namespace codefix {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/* @internal */
|
||||
namespace ts.codefix {
|
||||
registerCodeFix({
|
||||
errorCodes: [
|
||||
Diagnostics.Cannot_find_module_0.code,
|
||||
Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
|
||||
],
|
||||
getCodeActions: context => {
|
||||
const { sourceFile, span: { start } } = context;
|
||||
const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false);
|
||||
if (!isStringLiteral(token)) {
|
||||
throw Debug.fail(); // These errors should only happen on the module name.
|
||||
}
|
||||
|
||||
const action = tryGetCodeActionForInstallPackageTypes(context.host, token.text);
|
||||
return action && [action];
|
||||
},
|
||||
});
|
||||
|
||||
export function tryGetCodeActionForInstallPackageTypes(host: LanguageServiceHost, moduleName: string): CodeAction | undefined {
|
||||
const { packageName } = getPackageName(moduleName);
|
||||
|
||||
if (!host.isKnownTypesPackageName(packageName)) {
|
||||
// If !registry, registry not available yet, can't do anything.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const typesPackageName = getTypesPackageName(packageName);
|
||||
return {
|
||||
description: `Install '${typesPackageName}'`,
|
||||
changes: [],
|
||||
commands: [{ type: "install package", packageName: typesPackageName }],
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
/// <reference path="fixClassIncorrectlyImplementsInterface.ts" />
|
||||
/// <reference path="fixAddMissingMember.ts" />
|
||||
/// <reference path="fixSpelling.ts" />
|
||||
/// <reference path="fixCannotFindModule.ts" />
|
||||
/// <reference path="fixClassDoesntImplementInheritedAbstractMember.ts" />
|
||||
/// <reference path="fixClassSuperMustPrecedeThisAccess.ts" />
|
||||
/// <reference path="fixConstructorForDerivedNeedSuperCall.ts" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -521,7 +521,7 @@ namespace ts.codefix {
|
||||
if (!usageContext.properties) {
|
||||
usageContext.properties = createUnderscoreEscapedMap<UsageContext>();
|
||||
}
|
||||
const propertyUsageContext = {};
|
||||
const propertyUsageContext = usageContext.properties.get(name) || { };
|
||||
inferTypeFromContext(parent, checker, propertyUsageContext);
|
||||
usageContext.properties.set(name, propertyUsageContext);
|
||||
}
|
||||
@@ -575,7 +575,7 @@ namespace ts.codefix {
|
||||
if (usageContext.properties) {
|
||||
usageContext.properties.forEach((context, name) => {
|
||||
const symbol = checker.createSymbol(SymbolFlags.Property, name);
|
||||
symbol.type = getTypeFromUsageContext(context, checker);
|
||||
symbol.type = getTypeFromUsageContext(context, checker) || checker.getAnyType();
|
||||
members.set(name, symbol);
|
||||
});
|
||||
}
|
||||
@@ -636,7 +636,7 @@ namespace ts.codefix {
|
||||
symbol.type = checker.getWidenedType(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i]));
|
||||
parameters.push(symbol);
|
||||
}
|
||||
const returnType = getTypeFromUsageContext(callContext.returnType, checker);
|
||||
const returnType = getTypeFromUsageContext(callContext.returnType, checker) || checker.getVoidType();
|
||||
return checker.createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, parameters, returnType, /*typePredicate*/ undefined, callContext.argumentTypes.length, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
|
||||
}
|
||||
|
||||
|
||||
+174
-32
@@ -4,13 +4,31 @@
|
||||
namespace ts.Completions {
|
||||
export type Log = (message: string) => void;
|
||||
|
||||
interface SymbolOriginInfo {
|
||||
moduleSymbol: Symbol;
|
||||
isDefaultExport: boolean;
|
||||
}
|
||||
/**
|
||||
* Map from symbol id -> SymbolOriginInfo.
|
||||
* Only populated for symbols that come from other modules.
|
||||
*/
|
||||
type SymbolOriginInfoMap = SymbolOriginInfo[];
|
||||
|
||||
const enum KeywordCompletionFilters {
|
||||
None,
|
||||
ClassElementKeywords, // Keywords at class keyword
|
||||
ConstructorParameterKeywords, // Keywords at constructor parameter
|
||||
}
|
||||
|
||||
export function getCompletionsAtPosition(host: LanguageServiceHost, typeChecker: TypeChecker, log: Log, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number): CompletionInfo | undefined {
|
||||
export function getCompletionsAtPosition(
|
||||
host: LanguageServiceHost,
|
||||
typeChecker: TypeChecker,
|
||||
log: Log,
|
||||
compilerOptions: CompilerOptions,
|
||||
sourceFile: SourceFile,
|
||||
position: number,
|
||||
allSourceFiles: ReadonlyArray<SourceFile>,
|
||||
): CompletionInfo | undefined {
|
||||
if (isInReferenceComment(sourceFile, position)) {
|
||||
return PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host);
|
||||
}
|
||||
@@ -19,12 +37,12 @@ namespace ts.Completions {
|
||||
return getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log);
|
||||
}
|
||||
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position);
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles);
|
||||
if (!completionData) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, request, keywordFilters } = completionData;
|
||||
const { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, request, keywordFilters, symbolToOriginInfoMap } = completionData;
|
||||
|
||||
if (sourceFile.languageVariant === LanguageVariant.JSX &&
|
||||
location && location.parent && location.parent.kind === SyntaxKind.JsxClosingElement) {
|
||||
@@ -56,7 +74,7 @@ namespace ts.Completions {
|
||||
const entries: CompletionEntry[] = [];
|
||||
|
||||
if (isSourceFileJavaScript(sourceFile)) {
|
||||
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral);
|
||||
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, symbolToOriginInfoMap);
|
||||
getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries);
|
||||
}
|
||||
else {
|
||||
@@ -64,7 +82,7 @@ namespace ts.Completions {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral);
|
||||
getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, symbolToOriginInfoMap);
|
||||
}
|
||||
|
||||
// TODO add filter for keyword based on type/value/namespace and also location
|
||||
@@ -134,7 +152,17 @@ namespace ts.Completions {
|
||||
};
|
||||
}
|
||||
|
||||
function getCompletionEntriesFromSymbols(symbols: Symbol[], entries: Push<CompletionEntry>, location: Node, performCharacterChecks: boolean, typeChecker: TypeChecker, target: ScriptTarget, log: Log, allowStringLiteral: boolean): Map<true> {
|
||||
function getCompletionEntriesFromSymbols(
|
||||
symbols: ReadonlyArray<Symbol>,
|
||||
entries: Push<CompletionEntry>,
|
||||
location: Node,
|
||||
performCharacterChecks: boolean,
|
||||
typeChecker: TypeChecker,
|
||||
target: ScriptTarget,
|
||||
log: Log,
|
||||
allowStringLiteral: boolean,
|
||||
symbolToOriginInfoMap?: SymbolOriginInfoMap,
|
||||
): Map<true> {
|
||||
const start = timestamp();
|
||||
const uniqueNames = createMap<true>();
|
||||
if (symbols) {
|
||||
@@ -143,6 +171,9 @@ namespace ts.Completions {
|
||||
if (entry) {
|
||||
const id = entry.name;
|
||||
if (!uniqueNames.has(id)) {
|
||||
if (symbolToOriginInfoMap && symbolToOriginInfoMap[getUniqueSymbolId(symbol, typeChecker)]) {
|
||||
entry.hasAction = true;
|
||||
}
|
||||
entries.push(entry);
|
||||
uniqueNames.set(id, true);
|
||||
}
|
||||
@@ -298,53 +329,89 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
export function getCompletionEntryDetails(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): CompletionEntryDetails {
|
||||
export function getCompletionEntryDetails(
|
||||
typeChecker: TypeChecker,
|
||||
log: (message: string) => void,
|
||||
compilerOptions: CompilerOptions,
|
||||
sourceFile: SourceFile,
|
||||
position: number,
|
||||
name: string,
|
||||
allSourceFiles: ReadonlyArray<SourceFile>,
|
||||
host: LanguageServiceHost,
|
||||
rulesProvider: formatting.RulesProvider,
|
||||
): CompletionEntryDetails {
|
||||
|
||||
// Compute all the completion symbols again.
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position);
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles);
|
||||
if (completionData) {
|
||||
const { symbols, location, allowStringLiteral } = completionData;
|
||||
const { symbols, location, allowStringLiteral, symbolToOriginInfoMap } = completionData;
|
||||
|
||||
// Find the symbol with the matching entry name.
|
||||
// We don't need to perform character checks here because we're only comparing the
|
||||
// name against 'entryName' (which is known to be good), not building a new
|
||||
// completion entry.
|
||||
const symbol = forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral) === entryName ? s : undefined);
|
||||
const symbol = find(symbols, s => getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral) === name);
|
||||
|
||||
if (symbol) {
|
||||
const codeActions = getCompletionEntryCodeActions(symbolToOriginInfoMap, symbol, typeChecker, host, compilerOptions, sourceFile, rulesProvider);
|
||||
const kindModifiers = SymbolDisplay.getSymbolModifiers(symbol);
|
||||
const { displayParts, documentation, symbolKind, tags } = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, SemanticMeaning.All);
|
||||
return {
|
||||
name: entryName,
|
||||
kindModifiers: SymbolDisplay.getSymbolModifiers(symbol),
|
||||
kind: symbolKind,
|
||||
displayParts,
|
||||
documentation,
|
||||
tags
|
||||
};
|
||||
return { name, kindModifiers, kind: symbolKind, displayParts, documentation, tags, codeActions };
|
||||
}
|
||||
}
|
||||
|
||||
// Didn't find a symbol with this name. See if we can find a keyword instead.
|
||||
const keywordCompletion = forEach(
|
||||
getKeywordCompletions(KeywordCompletionFilters.None),
|
||||
c => c.name === entryName
|
||||
c => c.name === name
|
||||
);
|
||||
if (keywordCompletion) {
|
||||
return {
|
||||
name: entryName,
|
||||
name,
|
||||
kind: ScriptElementKind.keyword,
|
||||
kindModifiers: ScriptElementKindModifier.none,
|
||||
displayParts: [displayPart(entryName, SymbolDisplayPartKind.keyword)],
|
||||
displayParts: [displayPart(name, SymbolDisplayPartKind.keyword)],
|
||||
documentation: undefined,
|
||||
tags: undefined
|
||||
tags: undefined,
|
||||
codeActions: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getCompletionEntrySymbol(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): Symbol | undefined {
|
||||
function getCompletionEntryCodeActions(symbolToOriginInfoMap: SymbolOriginInfoMap, symbol: Symbol, checker: TypeChecker, host: LanguageServiceHost, compilerOptions: CompilerOptions, sourceFile: SourceFile, rulesProvider: formatting.RulesProvider): CodeAction[] | undefined {
|
||||
const symbolOriginInfo = symbolToOriginInfoMap[getUniqueSymbolId(symbol, checker)];
|
||||
if (!symbolOriginInfo) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { moduleSymbol, isDefaultExport } = symbolOriginInfo;
|
||||
return codefix.getCodeActionForImport(moduleSymbol, {
|
||||
host,
|
||||
checker,
|
||||
newLineCharacter: host.getNewLine(),
|
||||
compilerOptions,
|
||||
sourceFile,
|
||||
rulesProvider,
|
||||
symbolName: symbol.name,
|
||||
getCanonicalFileName: createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false),
|
||||
symbolToken: undefined,
|
||||
kind: isDefaultExport ? codefix.ImportKind.Default : codefix.ImportKind.Named,
|
||||
});
|
||||
}
|
||||
|
||||
export function getCompletionEntrySymbol(
|
||||
typeChecker: TypeChecker,
|
||||
log: (message: string) => void,
|
||||
compilerOptions: CompilerOptions,
|
||||
sourceFile: SourceFile,
|
||||
position: number,
|
||||
entryName: string,
|
||||
allSourceFiles: ReadonlyArray<SourceFile>,
|
||||
): Symbol | undefined {
|
||||
// Compute all the completion symbols again.
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position);
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles);
|
||||
if (!completionData) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -353,7 +420,7 @@ namespace ts.Completions {
|
||||
// We don't need to perform character checks here because we're only comparing the
|
||||
// name against 'entryName' (which is known to be good), not building a new
|
||||
// completion entry.
|
||||
return forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral) === entryName ? s : undefined);
|
||||
return find(symbols, s => getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral) === entryName);
|
||||
}
|
||||
|
||||
interface CompletionData {
|
||||
@@ -366,10 +433,17 @@ namespace ts.Completions {
|
||||
isRightOfDot: boolean;
|
||||
request?: Request;
|
||||
keywordFilters: KeywordCompletionFilters;
|
||||
symbolToOriginInfoMap: SymbolOriginInfoMap;
|
||||
}
|
||||
type Request = { kind: "JsDocTagName" } | { kind: "JsDocTag" } | { kind: "JsDocParameterName", tag: JSDocParameterTag };
|
||||
|
||||
function getCompletionData(typeChecker: TypeChecker, log: (message: string) => void, sourceFile: SourceFile, position: number): CompletionData | undefined {
|
||||
function getCompletionData(
|
||||
typeChecker: TypeChecker,
|
||||
log: (message: string) => void,
|
||||
sourceFile: SourceFile,
|
||||
position: number,
|
||||
allSourceFiles: ReadonlyArray<SourceFile>,
|
||||
): CompletionData | undefined {
|
||||
const isJavaScriptFile = isSourceFileJavaScript(sourceFile);
|
||||
|
||||
let request: Request | undefined;
|
||||
@@ -441,7 +515,18 @@ namespace ts.Completions {
|
||||
}
|
||||
|
||||
if (request) {
|
||||
return { symbols: undefined, isGlobalCompletion: false, isMemberCompletion: false, allowStringLiteral: false, isNewIdentifierLocation: false, location: undefined, isRightOfDot: false, request, keywordFilters: KeywordCompletionFilters.None };
|
||||
return {
|
||||
symbols: undefined,
|
||||
isGlobalCompletion: false,
|
||||
isMemberCompletion: false,
|
||||
allowStringLiteral: false,
|
||||
isNewIdentifierLocation: false,
|
||||
location: undefined,
|
||||
isRightOfDot: false,
|
||||
request,
|
||||
keywordFilters: KeywordCompletionFilters.None,
|
||||
symbolToOriginInfoMap: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
if (!insideJsDocTagTypeExpression) {
|
||||
@@ -543,6 +628,7 @@ namespace ts.Completions {
|
||||
let isNewIdentifierLocation: boolean;
|
||||
let keywordFilters = KeywordCompletionFilters.None;
|
||||
let symbols: Symbol[] = [];
|
||||
const symbolToOriginInfoMap: SymbolOriginInfoMap = [];
|
||||
|
||||
if (isRightOfDot) {
|
||||
getTypeScriptMemberSymbols();
|
||||
@@ -579,7 +665,7 @@ namespace ts.Completions {
|
||||
|
||||
log("getCompletionData: Semantic work: " + (timestamp() - semanticStart));
|
||||
|
||||
return { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request, keywordFilters };
|
||||
return { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request, keywordFilters, symbolToOriginInfoMap };
|
||||
|
||||
type JSDocTagWithTypeExpression = JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag;
|
||||
|
||||
@@ -752,13 +838,16 @@ namespace ts.Completions {
|
||||
}
|
||||
|
||||
const symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias;
|
||||
symbols = filterGlobalCompletion(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings));
|
||||
|
||||
symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings);
|
||||
getSymbolsFromOtherSourceFileExports(symbols, previousToken && isIdentifier(previousToken) ? previousToken.text : "");
|
||||
filterGlobalCompletion(symbols);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function filterGlobalCompletion(symbols: Symbol[]) {
|
||||
return filter(symbols, symbol => {
|
||||
function filterGlobalCompletion(symbols: Symbol[]): void {
|
||||
filterMutate(symbols, symbol => {
|
||||
if (!isSourceFile(location)) {
|
||||
// export = /**/ here we want to get all meanings, so any symbol is ok
|
||||
if (isExportAssignment(location.parent)) {
|
||||
@@ -832,6 +921,59 @@ namespace ts.Completions {
|
||||
}
|
||||
}
|
||||
|
||||
function getSymbolsFromOtherSourceFileExports(symbols: Symbol[], tokenText: string): void {
|
||||
const tokenTextLowerCase = tokenText.toLowerCase();
|
||||
const symbolIdMap = arrayToNumericMap(symbols, s => getUniqueSymbolId(s, typeChecker));
|
||||
|
||||
codefix.forEachExternalModule(typeChecker, allSourceFiles, moduleSymbol => {
|
||||
if (moduleSymbol === sourceFile.symbol) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let symbol of typeChecker.getExportsOfModule(moduleSymbol)) {
|
||||
let { name } = symbol;
|
||||
const isDefaultExport = name === "default";
|
||||
if (isDefaultExport) {
|
||||
const localSymbol = getLocalSymbolForExportDefault(symbol);
|
||||
if (localSymbol) {
|
||||
symbol = localSymbol;
|
||||
name = localSymbol.name;
|
||||
}
|
||||
}
|
||||
|
||||
const id = getUniqueSymbolId(symbol, typeChecker);
|
||||
if (!symbolIdMap[id] && stringContainsCharactersInOrder(name.toLowerCase(), tokenTextLowerCase)) {
|
||||
symbols.push(symbol);
|
||||
symbolToOriginInfoMap[id] = { moduleSymbol, isDefaultExport };
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* True if you could remove some characters in `a` to get `b`.
|
||||
* E.g., true for "abcdef" and "bdf".
|
||||
* But not true for "abcdef" and "dbf".
|
||||
*/
|
||||
function stringContainsCharactersInOrder(str: string, characters: string): boolean {
|
||||
if (characters.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let characterIndex = 0;
|
||||
for (let strIndex = 0; strIndex < str.length; strIndex++) {
|
||||
if (str.charCodeAt(strIndex) === characters.charCodeAt(characterIndex)) {
|
||||
characterIndex++;
|
||||
if (characterIndex === characters.length) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Did not find all characters
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the first node that "embraces" the position, so that one may
|
||||
* accurately aggregate locals from the closest containing scope.
|
||||
@@ -1627,7 +1769,7 @@ namespace ts.Completions {
|
||||
// First check of the displayName is not external module; if it is an external module, it is not valid entry
|
||||
if (symbol.flags & SymbolFlags.Namespace) {
|
||||
const firstCharCode = name.charCodeAt(0);
|
||||
if (firstCharCode === CharacterCodes.singleQuote || firstCharCode === CharacterCodes.doubleQuote) {
|
||||
if (isSingleOrDoubleQuote(firstCharCode)) {
|
||||
// If the symbol is external module, don't show it in the completion list
|
||||
// (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there)
|
||||
return undefined;
|
||||
|
||||
@@ -377,19 +377,26 @@ namespace ts.FindAllReferences.Core {
|
||||
|
||||
const result: SymbolAndEntries[] = [];
|
||||
const state = new State(sourceFiles, /*isForConstructor*/ node.kind === SyntaxKind.ConstructorKeyword, checker, cancellationToken, searchMeaning, options, result);
|
||||
const search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) });
|
||||
|
||||
// Try to get the smallest valid scope that we can limit our search to;
|
||||
// otherwise we'll need to search globally (i.e. include each file).
|
||||
const scope = getSymbolScope(symbol);
|
||||
if (scope) {
|
||||
getReferencesInContainer(scope, scope.getSourceFile(), search, state);
|
||||
if (node.kind === SyntaxKind.DefaultKeyword) {
|
||||
addReference(node, symbol, node, state);
|
||||
searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: ExportKind.Default }, state);
|
||||
}
|
||||
else {
|
||||
// Global search
|
||||
for (const sourceFile of state.sourceFiles) {
|
||||
state.cancellationToken.throwIfCancellationRequested();
|
||||
searchForName(sourceFile, search, state);
|
||||
const search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) });
|
||||
|
||||
// Try to get the smallest valid scope that we can limit our search to;
|
||||
// otherwise we'll need to search globally (i.e. include each file).
|
||||
const scope = getSymbolScope(symbol);
|
||||
if (scope) {
|
||||
getReferencesInContainer(scope, scope.getSourceFile(), search, state);
|
||||
}
|
||||
else {
|
||||
// Global search
|
||||
for (const sourceFile of state.sourceFiles) {
|
||||
state.cancellationToken.throwIfCancellationRequested();
|
||||
searchForName(sourceFile, search, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -246,4 +246,65 @@ namespace ts.JsTyping {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const enum PackageNameValidationResult {
|
||||
Ok,
|
||||
ScopedPackagesNotSupported,
|
||||
EmptyName,
|
||||
NameTooLong,
|
||||
NameStartsWithDot,
|
||||
NameStartsWithUnderscore,
|
||||
NameContainsNonURISafeCharacters
|
||||
}
|
||||
|
||||
const MaxPackageNameLength = 214;
|
||||
|
||||
/**
|
||||
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
|
||||
*/
|
||||
export function validatePackageName(packageName: string): PackageNameValidationResult {
|
||||
if (!packageName) {
|
||||
return PackageNameValidationResult.EmptyName;
|
||||
}
|
||||
if (packageName.length > MaxPackageNameLength) {
|
||||
return PackageNameValidationResult.NameTooLong;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === CharacterCodes.dot) {
|
||||
return PackageNameValidationResult.NameStartsWithDot;
|
||||
}
|
||||
if (packageName.charCodeAt(0) === CharacterCodes._) {
|
||||
return PackageNameValidationResult.NameStartsWithUnderscore;
|
||||
}
|
||||
// check if name is scope package like: starts with @ and has one '/' in the middle
|
||||
// scoped packages are not currently supported
|
||||
// TODO: when support will be added we'll need to split and check both scope and package name
|
||||
if (/^@[^/]+\/[^/]+$/.test(packageName)) {
|
||||
return PackageNameValidationResult.ScopedPackagesNotSupported;
|
||||
}
|
||||
if (encodeURIComponent(packageName) !== packageName) {
|
||||
return PackageNameValidationResult.NameContainsNonURISafeCharacters;
|
||||
}
|
||||
return PackageNameValidationResult.Ok;
|
||||
}
|
||||
|
||||
export function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string {
|
||||
switch (result) {
|
||||
case PackageNameValidationResult.EmptyName:
|
||||
return `Package name '${typing}' cannot be empty`;
|
||||
case PackageNameValidationResult.NameTooLong:
|
||||
return `Package name '${typing}' should be less than ${MaxPackageNameLength} characters`;
|
||||
case PackageNameValidationResult.NameStartsWithDot:
|
||||
return `Package name '${typing}' cannot start with '.'`;
|
||||
case PackageNameValidationResult.NameStartsWithUnderscore:
|
||||
return `Package name '${typing}' cannot start with '_'`;
|
||||
case PackageNameValidationResult.ScopedPackagesNotSupported:
|
||||
return `Package '${typing}' is scoped and currently is not supported`;
|
||||
case PackageNameValidationResult.NameContainsNonURISafeCharacters:
|
||||
return `Package name '${typing}' contains non URI safe characters`;
|
||||
case PackageNameValidationResult.Ok:
|
||||
throw Debug.fail(); // Shouldn't have called this.
|
||||
default:
|
||||
Debug.assertNever(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ namespace ts.Completions.PathCompletions {
|
||||
}
|
||||
}
|
||||
else if (host.getDirectories) {
|
||||
let typeRoots: string[];
|
||||
let typeRoots: ReadonlyArray<string>;
|
||||
try {
|
||||
// Wrap in try catch because getEffectiveTypeRoots touches the filesystem
|
||||
typeRoots = getEffectiveTypeRoots(options, host);
|
||||
|
||||
@@ -14,13 +14,12 @@ namespace ts {
|
||||
getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined;
|
||||
}
|
||||
|
||||
export interface RefactorContext {
|
||||
export interface RefactorContext extends textChanges.TextChangesContext {
|
||||
file: SourceFile;
|
||||
startPosition: number;
|
||||
endPosition?: number;
|
||||
program: Program;
|
||||
newLineCharacter: string;
|
||||
rulesProvider?: formatting.RulesProvider;
|
||||
host: LanguageServiceHost;
|
||||
cancellationToken?: CancellationToken;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,16 +5,9 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
const annotateTypeFromJSDoc: Refactor = {
|
||||
name: "Annotate with type from JSDoc",
|
||||
description: Diagnostics.Annotate_with_type_from_JSDoc.message,
|
||||
getEditsForAction: getEditsForAnnotation,
|
||||
getEditsForAction,
|
||||
getAvailableActions
|
||||
};
|
||||
const annotateFunctionFromJSDoc: Refactor = {
|
||||
name: "Annotate with types from JSDoc",
|
||||
description: Diagnostics.Annotate_with_types_from_JSDoc.message,
|
||||
getEditsForAction: getEditsForFunctionAnnotation,
|
||||
getAvailableActions
|
||||
};
|
||||
|
||||
type DeclarationWithType =
|
||||
| FunctionLikeDeclaration
|
||||
| VariableDeclaration
|
||||
@@ -23,13 +16,41 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
| PropertyDeclaration;
|
||||
|
||||
registerRefactor(annotateTypeFromJSDoc);
|
||||
registerRefactor(annotateFunctionFromJSDoc);
|
||||
|
||||
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined {
|
||||
if (isInJavaScriptFile(context.file)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const node = getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false);
|
||||
if (hasUsableJSDoc(findAncestor(node, isDeclarationWithType))) {
|
||||
return [{
|
||||
name: annotateTypeFromJSDoc.name,
|
||||
description: annotateTypeFromJSDoc.description,
|
||||
actions: [
|
||||
{
|
||||
description: annotateTypeFromJSDoc.description,
|
||||
name: actionName
|
||||
}
|
||||
]
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
function hasUsableJSDoc(decl: DeclarationWithType): boolean {
|
||||
if (!decl) {
|
||||
return false;
|
||||
}
|
||||
if (isFunctionLikeDeclaration(decl)) {
|
||||
return decl.parameters.some(hasUsableJSDoc) || (!decl.type && !!getJSDocReturnType(decl));
|
||||
}
|
||||
return !decl.type && !!getJSDocType(decl);
|
||||
}
|
||||
|
||||
function getEditsForAction(context: RefactorContext, action: string): RefactorEditInfo | undefined {
|
||||
if (actionName !== action) {
|
||||
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
|
||||
}
|
||||
const node = getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false);
|
||||
const decl = findAncestor(node, isDeclarationWithType);
|
||||
if (!decl || decl.type) {
|
||||
@@ -37,28 +58,18 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
}
|
||||
const jsdocType = getJSDocType(decl);
|
||||
const isFunctionWithJSDoc = isFunctionLikeDeclaration(decl) && (getJSDocReturnType(decl) || decl.parameters.some(p => !!getJSDocType(p)));
|
||||
const refactor = (isFunctionWithJSDoc || jsdocType && decl.kind === SyntaxKind.Parameter) ? annotateFunctionFromJSDoc :
|
||||
jsdocType ? annotateTypeFromJSDoc :
|
||||
undefined;
|
||||
if (refactor) {
|
||||
return [{
|
||||
name: refactor.name,
|
||||
description: refactor.description,
|
||||
actions: [
|
||||
{
|
||||
description: refactor.description,
|
||||
name: actionName
|
||||
}
|
||||
]
|
||||
}];
|
||||
if (isFunctionWithJSDoc || jsdocType && decl.kind === SyntaxKind.Parameter) {
|
||||
return getEditsForFunctionAnnotation(context);
|
||||
}
|
||||
else if (jsdocType) {
|
||||
return getEditsForAnnotation(context);
|
||||
}
|
||||
else {
|
||||
Debug.assert(!!refactor, "No applicable refactor found.");
|
||||
}
|
||||
}
|
||||
|
||||
function getEditsForAnnotation(context: RefactorContext, action: string): RefactorEditInfo | undefined {
|
||||
if (actionName !== action) {
|
||||
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
|
||||
}
|
||||
|
||||
function getEditsForAnnotation(context: RefactorContext): RefactorEditInfo | undefined {
|
||||
const sourceFile = context.file;
|
||||
const token = getTokenAtPosition(sourceFile, context.startPosition, /*includeJsDocComment*/ false);
|
||||
const decl = findAncestor(token, isDeclarationWithType);
|
||||
@@ -78,11 +89,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
};
|
||||
}
|
||||
|
||||
function getEditsForFunctionAnnotation(context: RefactorContext, action: string): RefactorEditInfo | undefined {
|
||||
if (actionName !== action) {
|
||||
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
|
||||
}
|
||||
|
||||
function getEditsForFunctionAnnotation(context: RefactorContext): RefactorEditInfo | undefined {
|
||||
const sourceFile = context.file;
|
||||
const token = getTokenAtPosition(sourceFile, context.startPosition, /*includeJsDocComment*/ false);
|
||||
const decl = findAncestor(token, isFunctionLikeDeclaration);
|
||||
@@ -166,7 +173,9 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
case SyntaxKind.TypeReference:
|
||||
return transformJSDocTypeReference(node as TypeReferenceNode);
|
||||
default:
|
||||
return visitEachChild(node, transformJSDocType, /*context*/ undefined) as TypeNode;
|
||||
const visited = visitEachChild(node, transformJSDocType, /*context*/ undefined) as TypeNode;
|
||||
setEmitFlags(visited, EmitFlags.SingleLine);
|
||||
return visited;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +208,9 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
let name = node.typeName;
|
||||
let args = node.typeArguments;
|
||||
if (isIdentifier(node.typeName)) {
|
||||
if (isJSDocIndexSignature(node)) {
|
||||
return transformJSDocIndexSignature(node);
|
||||
}
|
||||
let text = node.typeName.text;
|
||||
switch (node.typeName.text) {
|
||||
case "String":
|
||||
@@ -223,4 +235,18 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
|
||||
}
|
||||
return createTypeReferenceNode(name, args);
|
||||
}
|
||||
|
||||
function transformJSDocIndexSignature(node: TypeReferenceNode) {
|
||||
const index = createParameter(
|
||||
/*decorators*/ undefined,
|
||||
/*modifiers*/ undefined,
|
||||
/*dotDotDotToken*/ undefined,
|
||||
node.typeArguments[0].kind === SyntaxKind.NumberKeyword ? "n" : "s",
|
||||
/*questionToken*/ undefined,
|
||||
createTypeReferenceNode(node.typeArguments[0].kind === SyntaxKind.NumberKeyword ? "number" : "string", []),
|
||||
/*initializer*/ undefined);
|
||||
const indexSignature = createTypeLiteralNode([createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]);
|
||||
setEmitFlags(indexSignature, EmitFlags.SingleLine);
|
||||
return indexSignature;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ namespace ts.refactor.extractSymbol {
|
||||
* you may be able to extract into a class method *or* local closure *or* namespace function,
|
||||
* depending on what's in the extracted body.
|
||||
*/
|
||||
function collectEnclosingScopes(range: TargetRange): Scope[] | undefined {
|
||||
function collectEnclosingScopes(range: TargetRange): Scope[] {
|
||||
let current: Node = isReadonlyArray(range.range) ? first(range.range) : range.range;
|
||||
if (range.facts & RangeFacts.UsesThis) {
|
||||
// if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class
|
||||
@@ -483,30 +483,27 @@ namespace ts.refactor.extractSymbol {
|
||||
}
|
||||
}
|
||||
|
||||
const start = current;
|
||||
const scopes: Scope[] = [];
|
||||
while (true) {
|
||||
current = current.parent;
|
||||
// A function parameter's initializer is actually in the outer scope, not the function declaration
|
||||
if (current.kind === SyntaxKind.Parameter) {
|
||||
// Skip all the way to the outer scope of the function that declared this parameter
|
||||
current = findAncestor(current, parent => isFunctionLikeDeclaration(parent)).parent;
|
||||
}
|
||||
|
||||
let scopes: Scope[] | undefined = undefined;
|
||||
while (current) {
|
||||
// We want to find the nearest parent where we can place an "equivalent" sibling to the node we're extracting out of.
|
||||
// Walk up to the closest parent of a place where we can logically put a sibling:
|
||||
// * Function declaration
|
||||
// * Class declaration or expression
|
||||
// * Module/namespace or source file
|
||||
if (current !== start && isScope(current)) {
|
||||
(scopes = scopes || []).push(current);
|
||||
if (isScope(current)) {
|
||||
scopes.push(current);
|
||||
if (current.kind === SyntaxKind.SourceFile) {
|
||||
return scopes;
|
||||
}
|
||||
}
|
||||
|
||||
// A function parameter's initializer is actually in the outer scope, not the function declaration
|
||||
if (current && current.parent && current.parent.kind === SyntaxKind.Parameter) {
|
||||
// Skip all the way to the outer scope of the function that declared this parameter
|
||||
current = findAncestor(current, parent => isFunctionLikeDeclaration(parent)).parent;
|
||||
}
|
||||
else {
|
||||
current = current.parent;
|
||||
}
|
||||
|
||||
}
|
||||
return scopes;
|
||||
}
|
||||
|
||||
function getFunctionExtractionAtIndex(targetRange: TargetRange, context: RefactorContext, requestedChangesIndex: number): RefactorEditInfo {
|
||||
@@ -592,15 +589,7 @@ namespace ts.refactor.extractSymbol {
|
||||
function getPossibleExtractionsWorker(targetRange: TargetRange, context: RefactorContext): { readonly scopes: Scope[], readonly readsAndWrites: ReadsAndWrites } {
|
||||
const { file: sourceFile } = context;
|
||||
|
||||
if (targetRange === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const scopes = collectEnclosingScopes(targetRange);
|
||||
if (scopes === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile);
|
||||
const readsAndWrites = collectReadsAndWrites(
|
||||
targetRange,
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/* @internal */
|
||||
namespace ts.refactor.installTypesForPackage {
|
||||
const actionName = "install";
|
||||
|
||||
const installTypesForPackage: Refactor = {
|
||||
name: "Install missing types package",
|
||||
description: "Install missing types package",
|
||||
getEditsForAction,
|
||||
getAvailableActions,
|
||||
};
|
||||
|
||||
registerRefactor(installTypesForPackage);
|
||||
|
||||
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined {
|
||||
if (context.program.getCompilerOptions().noImplicitAny) {
|
||||
// Then it will be available via `fixCannotFindModule`.
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const action = getAction(context);
|
||||
return action && [
|
||||
{
|
||||
name: installTypesForPackage.name,
|
||||
description: installTypesForPackage.description,
|
||||
actions: [
|
||||
{
|
||||
description: action.description,
|
||||
name: actionName,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function getEditsForAction(context: RefactorContext, _actionName: string): RefactorEditInfo | undefined {
|
||||
Debug.assertEqual(actionName, _actionName);
|
||||
const action = getAction(context)!; // Should be defined if we said there was an action available.
|
||||
return {
|
||||
edits: [],
|
||||
renameFilename: undefined,
|
||||
renameLocation: undefined,
|
||||
commands: action.commands,
|
||||
};
|
||||
}
|
||||
|
||||
function getAction(context: RefactorContext): CodeAction | undefined {
|
||||
const { file, startPosition } = context;
|
||||
const node = getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false);
|
||||
if (isStringLiteral(node) && isModuleIdentifier(node) && getResolvedModule(file, node.text) === undefined) {
|
||||
return codefix.tryGetCodeActionForInstallPackageTypes(context.host, node.text);
|
||||
}
|
||||
}
|
||||
|
||||
function isModuleIdentifier(node: StringLiteral): boolean {
|
||||
switch (node.parent.kind) {
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
case SyntaxKind.ExternalModuleReference:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user