Merge branch 'master' into referencesDogfood_1

This commit is contained in:
Ryan Cavanaugh 2018-04-12 12:26:10 -07:00
commit ff60520460
63 changed files with 361 additions and 985 deletions

View File

@ -1311,12 +1311,13 @@ namespace ts {
* the same key with the given 'makeKey' function, then the element with the higher
* index in the array will be the one associated with the produced key.
*/
export function arrayToMap<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string): Map<T>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string, makeValue: (value: T) => U): Map<U>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string, makeValue: (value: T) => T | U = identity): Map<T | U> {
export function arrayToMap<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined): Map<T>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined, makeValue: (value: T) => U): Map<U>;
export function arrayToMap<T, U>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined, makeValue: (value: T) => T | U = identity): Map<T | U> {
const result = createMap<T | U>();
for (const value of array) {
result.set(makeKey(value), makeValue(value));
const key = makeKey(value);
if (key !== undefined) result.set(key, makeValue(value));
}
return result;
}
@ -1337,8 +1338,9 @@ namespace ts {
* @param array the array of input elements.
*/
export function arrayToSet(array: ReadonlyArray<string>): Map<true>;
export function arrayToSet<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string): Map<true>;
export function arrayToSet(array: ReadonlyArray<any>, makeKey?: (value: any) => string): Map<true> {
export function arrayToSet<T>(array: ReadonlyArray<T>, makeKey: (value: T) => string | undefined): Map<true>;
export function arrayToSet<T>(array: ReadonlyArray<T>, makeKey: (value: T) => __String | undefined): UnderscoreEscapedMap<true>;
export function arrayToSet(array: ReadonlyArray<any>, makeKey?: (value: any) => string | __String | undefined): Map<true> | UnderscoreEscapedMap<true> {
return arrayToMap<any, true>(array, makeKey || (s => s), () => true);
}

View File

@ -6323,4 +6323,9 @@ namespace ts {
export function isStringLiteralLike(node: Node): node is StringLiteralLike {
return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral;
}
/** @internal */
export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports {
return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports;
}
}

View File

@ -247,6 +247,24 @@ import D from "lib";
},
libFile);
testOrganizeImports("Unused_false_positive_shorthand_assignment",
{
path: "/test.ts",
content: `
import { x } from "a";
const o = { x };
`
});
testOrganizeImports("Unused_false_positive_export_shorthand",
{
path: "/test.ts",
content: `
import { x } from "a";
export { x };
`
});
testOrganizeImports("MoveToTop",
{
path: "/test.ts",

View File

@ -642,6 +642,9 @@
<Item ItemId=";A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A rest parameter or binding pattern may not have a trailing comma.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[REST 參數或繫結模式的結尾不得為逗點。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -903,18 +906,27 @@
<Item ItemId=";Add_all_missing_async_modifiers_95041" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing 'async' modifiers]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增缺少的所有 'async' 修飾詞]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_members_95022" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing members]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增遺漏的所有成員]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_all_missing_super_calls_95039" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add all missing super calls]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[新增缺少的所有 super 呼叫]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -939,6 +951,9 @@
<Item ItemId=";Add_definite_assignment_assertions_to_all_uninitialized_properties_95028" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add definite assignment assertions to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未初始化的屬性新增明確的指派判斷提示]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -966,6 +981,9 @@
<Item ItemId=";Add_initializers_to_all_uninitialized_properties_95027" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add initializers to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未初始化的屬性新增初始設定式]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -984,6 +1002,9 @@
<Item ItemId=";Add_this_to_all_unresolved_variables_matching_a_member_name_95037" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add 'this.' to all unresolved variables matching a member name]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有用以比對成員名稱未解析的變數新增 'this.']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -1002,18 +1023,27 @@
<Item ItemId=";Add_to_all_uncalled_decorators_95044" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '()' to all uncalled decorators]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未呼叫的裝飾項目新增 '()']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_ts_ignore_to_all_error_messages_95042" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add '@ts-ignore' to all error messages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有錯誤訊息新增 '@ts-ignore']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Add_undefined_type_to_all_uninitialized_properties_95029" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Add undefined type to all uninitialized properties]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[為所有未初始化的屬性新增未定義的類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -1524,6 +1554,9 @@
<Item ItemId=";Annotate_everything_with_types_from_JSDoc_95043" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Annotate everything with types from JSDoc]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[標註具備 JSDoc 之類型的所有項目 ]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -2151,18 +2184,27 @@
<Item ItemId=";Change_all_extended_interfaces_to_implements_95038" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all extended interfaces to 'implements']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有延伸介面變更為 'implements']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_95030" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有 jsdoc 樣式的類型變更為 TypeScript]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有 jsdoc 樣式的類型變更為 TypeScript (並為 null 類型新增 '| undefined')]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -2475,12 +2517,18 @@
<Item ItemId=";Convert_all_constructor_functions_to_classes_95045" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all constructor functions to classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將所有建構函式轉換為類別]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_all_to_default_imports_95035" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert all to default imports]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[全部轉換為預設匯入]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -2664,6 +2712,9 @@
<Item ItemId=";Delete_all_unused_declarations_95024" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused declarations]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[刪除所有未使用的宣告]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3714,6 +3765,27 @@
<Item ItemId=";Fix_all_detected_spelling_errors_95026" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Fix all detected spelling errors]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[修正偵測到的所有拼字錯誤]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_0_errors_6194" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found {0} errors.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[找到 {0} 個錯誤。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Found_1_error_6193" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Found 1 error.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[找到 1 個錯誤。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -3825,6 +3897,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generate_get_and_set_accessors_95046" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generate 'get' and 'set' accessors]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
@ -4032,12 +4110,18 @@
<Item ItemId=";Implement_all_inherited_abstract_classes_95040" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all inherited abstract classes]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[實作所有繼承的抽象類別]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Implement_all_unimplemented_interfaces_95032" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Implement all unimplemented interfaces]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[實作所有未實作的介面]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -4239,6 +4323,9 @@
<Item ItemId=";Infer_all_types_from_usage_95023" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Infer all types from usage]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[從用法推斷所有類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -4356,6 +4443,9 @@
<Item ItemId=";Install_all_missing_types_packages_95033" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Install all missing types packages]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[安裝缺少的所有類型套件]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -4851,6 +4941,9 @@
<Item ItemId=";Make_all_super_calls_the_first_statement_in_their_constructor_95036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Make all 'super()' calls the first statement in their constructor]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[在其建構函式的第一個陳述式中呼叫所有的 'super()']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -4950,12 +5043,18 @@
<Item ItemId=";Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_1340" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a type, but is used as a type here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[模組 '{0}' 未參考任何類型,但在此用為類型。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Module '{0}' does not refer to a value, but is used as a value here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[模組 '{0}' 未參考任何值,但在此用為值。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -5853,6 +5952,9 @@
<Item ItemId=";Prefix_all_unused_declarations_with_where_possible_95025" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Prefix all unused declarations with '_' where possible]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[若可行,為所有未使用的宣告加上前置詞 '_']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -5910,6 +6012,12 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await_2570" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?]]></Val>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@ -6756,6 +6864,9 @@
<Item ItemId=";Rewrite_all_as_indexed_access_types_95034" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rewrite all as indexed access types]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將全部重寫為經過編製索引的存取類型]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -7500,6 +7611,9 @@
<Item ItemId=";The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['for...in' 陳述式的右方必須是類型 'any'、物件類型或型別參數,但此處為類型 '{0}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -7821,6 +7935,9 @@
<Item ItemId=";Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 不是陣列類型。請使用編譯器選項 '-downlevelIteration' 允許逐一查看迭代器。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -7836,6 +7953,9 @@
<Item ItemId=";Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 不是陣列類型或字串類型。請使用編譯器選項 '-downlevelIteration' 允許逐一查看迭代器。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -7896,12 +8016,18 @@
<Item ItemId=";Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.asyncIterator]5D;()' method that returns an async iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 必須具備會傳回非同步迭代器的 '[Symbol.asyncIterator]5D;()' 方法。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' must have a '[Symbol.iterator]5D;()' method that returns an iterator.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[類型 '{0}' 必須具備會傳回迭代器的 '[Symbol.iterator]5D;()' 方法。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
@ -7986,6 +8112,9 @@
<Item ItemId=";Type_arguments_cannot_be_used_here_1342" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type arguments cannot be used here.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[此處不得使用型別引數。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>

View File

@ -556,7 +556,8 @@ namespace ts.server {
const request = this.processRequest<protocol.CodeFixRequest>(CommandNames.GetCodeFixes, args);
const response = this.processResponse<protocol.CodeFixResponse>(request);
return response.body.map(({ description, changes, fixId, fixAllDescription }) => ({ description, changes: this.convertChanges(changes, file), fixId, fixAllDescription }));
return response.body.map<CodeFixAction>(({ fixName, description, changes, commands, fixId, fixAllDescription }) =>
({ fixName, description, changes: this.convertChanges(changes, file), commands: commands as CodeActionCommand[], fixId, fixAllDescription }));
}
getCombinedCodeFix = notImplemented;

View File

@ -1698,6 +1698,8 @@ namespace ts.server.protocol {
}
export interface CodeFixAction extends CodeAction {
/** Short name to identify the fix, for use by telemetry. */
fixName: string;
/**
* If present, one may call 'getCombinedCodeFix' with this fixId.
* This may be omitted to indicate that the code fix can't be applied in a group.

View File

@ -1663,7 +1663,7 @@ namespace ts.server {
}
}
private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.CodeAction> | ReadonlyArray<CodeAction> {
private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.CodeFixAction> | ReadonlyArray<CodeFixAction> {
if (args.errorCodes.length === 0) {
return undefined;
}
@ -1673,15 +1673,7 @@ namespace ts.server {
const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo);
const codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
if (!codeActions) {
return undefined;
}
if (simplifiedResult) {
return codeActions.map(codeAction => this.mapCodeAction(project, codeAction));
}
else {
return codeActions;
}
return simplifiedResult ? codeActions.map(codeAction => this.mapCodeFixAction(project, codeAction)) : codeActions;
}
private getCombinedCodeFix({ scope, fixId }: protocol.GetCombinedCodeFixRequestArgs, simplifiedResult: boolean): protocol.CombinedCodeActions | CombinedCodeActions {
@ -1729,9 +1721,12 @@ namespace ts.server {
return { startPosition, endPosition };
}
private mapCodeAction(project: Project, { description, changes: unmappedChanges, commands, fixId, fixAllDescription }: CodeFixAction): protocol.CodeFixAction {
const changes = unmappedChanges.map(change => this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(toNormalizedPath(change.fileName))));
return { description, changes, commands, fixId, fixAllDescription };
private mapCodeAction(project: Project, { description, changes, commands }: CodeAction): protocol.CodeAction {
return { description, changes: this.mapTextChangesToCodeEdits(project, changes), commands };
}
private mapCodeFixAction(project: Project, { fixName, description, changes, commands, fixId, fixAllDescription }: CodeFixAction): protocol.CodeFixAction {
return { fixName, description, changes: this.mapTextChangesToCodeEdits(project, changes), commands, fixId, fixAllDescription };
}
private mapTextChangesToCodeEdits(project: Project, textChanges: ReadonlyArray<FileTextChanges>): protocol.FileCodeEdits[] {

View File

@ -24,7 +24,7 @@ namespace ts {
}
export namespace codefix {
const codeFixRegistrations: CodeFixRegistration[][] = [];
const errorCodeToFixes = createMultiMap<CodeFixRegistration>();
const fixIdToRegistration = createMap<CodeFixRegistration>();
type DiagnosticAndArguments = DiagnosticMessage | [DiagnosticMessage, string] | [DiagnosticMessage, string, string];
@ -34,26 +34,21 @@ namespace ts {
: getLocaleSpecificMessage(diag);
}
export function createCodeFixActionNoFixId(changes: FileTextChanges[], description: DiagnosticAndArguments) {
return createCodeFixActionWorker(diagnosticToString(description), changes, /*fixId*/ undefined, /*fixAllDescription*/ undefined);
export function createCodeFixActionNoFixId(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments) {
return createCodeFixActionWorker(fixName, diagnosticToString(description), changes, /*fixId*/ undefined, /*fixAllDescription*/ undefined);
}
export function createCodeFixAction(changes: FileTextChanges[], description: DiagnosticAndArguments, fixId: {}, fixAllDescription: DiagnosticAndArguments, command?: CodeActionCommand): CodeFixAction {
return createCodeFixActionWorker(diagnosticToString(description), changes, fixId, diagnosticToString(fixAllDescription), command);
export function createCodeFixAction(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments, fixId: {}, fixAllDescription: DiagnosticAndArguments, command?: CodeActionCommand): CodeFixAction {
return createCodeFixActionWorker(fixName, diagnosticToString(description), changes, fixId, diagnosticToString(fixAllDescription), command);
}
function createCodeFixActionWorker(description: string, changes: FileTextChanges[], fixId?: {}, fixAllDescription?: string, command?: CodeActionCommand): CodeFixAction {
return { description, changes, fixId, fixAllDescription, commands: command ? [command] : undefined };
function createCodeFixActionWorker(fixName: string, description: string, changes: FileTextChanges[], fixId?: {}, fixAllDescription?: string, command?: CodeActionCommand): CodeFixAction {
return { fixName, description, changes, fixId, fixAllDescription, commands: command ? [command] : undefined };
}
export function registerCodeFix(reg: CodeFixRegistration) {
for (const error of reg.errorCodes) {
let registrations = codeFixRegistrations[error];
if (!registrations) {
registrations = [];
codeFixRegistrations[error] = registrations;
}
registrations.push(reg);
errorCodeToFixes.add(String(error), reg);
}
if (reg.fixIds) {
for (const fixId of reg.fixIds) {
@ -63,29 +58,12 @@ namespace ts {
}
}
export function getSupportedErrorCodes() {
return Object.keys(codeFixRegistrations);
export function getSupportedErrorCodes(): string[] {
return arrayFrom(errorCodeToFixes.keys());
}
export function getFixes(context: CodeFixContext): CodeFixAction[] {
const fixes = codeFixRegistrations[context.errorCode];
const allActions: CodeFixAction[] = [];
forEach(fixes, f => {
const actions = f.getCodeActions(context);
if (actions && actions.length > 0) {
for (const action of actions) {
if (action === undefined) {
context.host.log(`Action for error code ${context.errorCode} added an invalid action entry; please log a bug`);
}
else {
allActions.push(action);
}
}
}
});
return allActions;
return flatMap(errorCodeToFixes.get(String(context.errorCode)) || emptyArray, f => f.getCodeActions(context));
}
export function getAllFixes(context: CodeFixAllContext): CombinedCodeActions {

View File

@ -6,7 +6,7 @@ namespace ts.codefix {
errorCodes,
getCodeActions: (context) => {
const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start));
return [createCodeFixAction(changes, Diagnostics.Call_decorator_expression, fixId, Diagnostics.Add_to_all_uncalled_decorators)];
return [createCodeFixAction(fixId, changes, Diagnostics.Call_decorator_expression, fixId, Diagnostics.Add_to_all_uncalled_decorators)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file!, diag.start!)),

View File

@ -8,7 +8,7 @@ namespace ts.codefix {
const decl = getDeclaration(context.sourceFile, context.span.start);
if (!decl) return;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, decl));
return [createCodeFixAction(changes, Diagnostics.Annotate_with_type_from_JSDoc, fixId, Diagnostics.Annotate_everything_with_types_from_JSDoc)];
return [createCodeFixAction(fixId, changes, Diagnostics.Annotate_with_type_from_JSDoc, fixId, Diagnostics.Annotate_everything_with_types_from_JSDoc)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -6,7 +6,7 @@ namespace ts.codefix {
errorCodes,
getCodeActions(context: CodeFixContext) {
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, context.span.start, context.program.getTypeChecker()));
return [createCodeFixAction(changes, Diagnostics.Convert_function_to_an_ES2015_class, fixId, Diagnostics.Convert_all_constructor_functions_to_classes)];
return [createCodeFixAction(fixId, changes, Diagnostics.Convert_function_to_an_ES2015_class, fixId, Diagnostics.Convert_all_constructor_functions_to_classes)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, err) => doChange(changes, err.file!, err.start, context.program.getTypeChecker())),

View File

@ -13,7 +13,7 @@ namespace ts.codefix {
}
});
// No support for fix-all since this applies to the whole file at once anyway.
return [createCodeFixActionNoFixId(changes, Diagnostics.Convert_to_ES6_module)];
return [createCodeFixActionNoFixId("convertToEs6Module", changes, Diagnostics.Convert_to_ES6_module)];
},
});

View File

@ -9,7 +9,7 @@ namespace ts.codefix {
if (!qualifiedName) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, qualifiedName));
const newText = `${qualifiedName.left.text}["${qualifiedName.right.text}"]`;
return [createCodeFixAction(changes, [Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, Diagnostics.Rewrite_all_as_indexed_access_types)];
return [createCodeFixAction(fixId, changes, [Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, Diagnostics.Rewrite_all_as_indexed_access_types)];
},
fixIds: [fixId],
getAllCodeActions: (context) => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -1,5 +1,6 @@
/* @internal */
namespace ts.codefix {
const fixName = "disableJsDiagnostics";
const fixId = "disableJsDiagnostics";
const errorCodes = mapDefined(Object.keys(Diagnostics) as ReadonlyArray<keyof typeof Diagnostics>, key => {
const diag = Diagnostics[key];
@ -18,6 +19,7 @@ namespace ts.codefix {
const fixes: CodeFixAction[] = [
// fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file.
createCodeFixActionNoFixId(
fixName,
[createFileTextChanges(sourceFile.fileName, [
createTextChange(sourceFile.checkJsDirective
? createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
@ -27,7 +29,7 @@ namespace ts.codefix {
];
if (textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
fixes.unshift(createCodeFixAction(textChanges.ChangeTracker.with(context, t => makeChange(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId, Diagnostics.Add_ts_ignore_to_all_error_messages));
fixes.unshift(createCodeFixAction(fixName, textChanges.ChangeTracker.with(context, t => makeChange(t, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId, Diagnostics.Add_ts_ignore_to_all_error_messages));
}
return fixes;

View File

@ -1,5 +1,6 @@
/* @internal */
namespace ts.codefix {
const fixName = "addMissingMember";
const errorCodes = [
Diagnostics.Property_0_does_not_exist_on_type_1.code,
Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,
@ -75,7 +76,7 @@ namespace ts.codefix {
function getActionsForAddMissingMemberInJavaScriptFile(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, makeStatic: boolean): CodeFixAction | undefined {
const changes = textChanges.ChangeTracker.with(context, t => addMissingMemberInJs(t, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic));
return changes.length === 0 ? undefined
: createCodeFixAction(changes, [makeStatic ? Diagnostics.Initialize_static_property_0 : Diagnostics.Initialize_property_0_in_the_constructor, tokenName], fixId, Diagnostics.Add_all_missing_members);
: createCodeFixAction(fixName, changes, [makeStatic ? Diagnostics.Initialize_static_property_0 : Diagnostics.Initialize_property_0_in_the_constructor, tokenName], fixId, Diagnostics.Add_all_missing_members);
}
function addMissingMemberInJs(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, makeStatic: boolean): void {
@ -120,7 +121,7 @@ namespace ts.codefix {
function createAddPropertyDeclarationAction(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, makeStatic: boolean, tokenName: string, typeNode: TypeNode): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic));
return createCodeFixAction(changes, [makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, tokenName], fixId, Diagnostics.Add_all_missing_members);
return createCodeFixAction(fixName, changes, [makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, tokenName], fixId, Diagnostics.Add_all_missing_members);
}
function addPropertyDeclaration(changeTracker: textChanges.ChangeTracker, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, typeNode: TypeNode, makeStatic: boolean): void {
@ -153,7 +154,7 @@ namespace ts.codefix {
const changes = textChanges.ChangeTracker.with(context, t => t.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, indexSignature));
// No fixId here because code-fix-all currently only works on adding individual named properties.
return createCodeFixActionNoFixId(changes, [Diagnostics.Add_index_signature_for_property_0, tokenName]);
return createCodeFixActionNoFixId(fixName, changes, [Diagnostics.Add_index_signature_for_property_0, tokenName]);
}
function getActionForMethodDeclaration(
@ -167,7 +168,7 @@ namespace ts.codefix {
preferences: UserPreferences,
): CodeFixAction | undefined {
const changes = textChanges.ChangeTracker.with(context, t => addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs, preferences));
return createCodeFixAction(changes, [makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, token.text], fixId, Diagnostics.Add_all_missing_members);
return createCodeFixAction(fixName, changes, [makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, token.text], fixId, Diagnostics.Add_all_missing_members);
}
function addMethodDeclaration(

View File

@ -12,7 +12,7 @@ namespace ts.codefix {
const nodes = getNodes(sourceFile, span.start);
if (!nodes) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, nodes));
return [createCodeFixAction(changes, Diagnostics.Add_async_modifier_to_containing_function, fixId, Diagnostics.Add_all_missing_async_modifiers)];
return [createCodeFixAction(fixId, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId, Diagnostics.Add_all_missing_async_modifiers)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -8,7 +8,7 @@ namespace ts.codefix {
const { host, sourceFile, span: { start } } = context;
const packageName = getTypesPackageNameToInstall(host, sourceFile, start);
return packageName === undefined ? []
: [createCodeFixAction(/*changes*/ [], [Diagnostics.Install_0, packageName], fixId, Diagnostics.Install_all_missing_types_packages, getCommand(sourceFile.fileName, packageName))];
: [createCodeFixAction(fixId, /*changes*/ [], [Diagnostics.Install_0, packageName], fixId, Diagnostics.Install_all_missing_types_packages, getCommand(sourceFile.fileName, packageName))];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (_, diag, commands) => {

View File

@ -11,7 +11,7 @@ namespace ts.codefix {
const { program, sourceFile, span } = context;
const changes = textChanges.ChangeTracker.with(context, t =>
addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t, context.preferences));
return changes.length === 0 ? undefined : [createCodeFixAction(changes, Diagnostics.Implement_inherited_abstract_class, fixId, Diagnostics.Implement_all_inherited_abstract_classes)];
return changes.length === 0 ? undefined : [createCodeFixAction(fixId, changes, Diagnostics.Implement_inherited_abstract_class, fixId, Diagnostics.Implement_all_inherited_abstract_classes)];
},
fixIds: [fixId],
getAllCodeActions: context => {

View File

@ -11,7 +11,7 @@ namespace ts.codefix {
const checker = program.getTypeChecker();
return mapDefined<ExpressionWithTypeArguments, CodeFixAction>(getClassImplementsHeritageClauseElements(classDeclaration), implementedTypeNode => {
const changes = textChanges.ChangeTracker.with(context, t => addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t, context.preferences));
return changes.length === 0 ? undefined : createCodeFixAction(changes, [Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, Diagnostics.Implement_all_unimplemented_interfaces);
return changes.length === 0 ? undefined : createCodeFixAction(fixId, changes, [Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, Diagnostics.Implement_all_unimplemented_interfaces);
});
},
fixIds: [fixId],

View File

@ -10,7 +10,7 @@ namespace ts.codefix {
if (!nodes) return undefined;
const { constructor, superCall } = nodes;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, constructor, superCall));
return [createCodeFixAction(changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)];
return [createCodeFixAction(fixId, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)];
},
fixIds: [fixId],
getAllCodeActions(context) {

View File

@ -8,7 +8,7 @@ namespace ts.codefix {
const { sourceFile, span } = context;
const ctr = getNode(sourceFile, span.start);
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, ctr));
return [createCodeFixAction(changes, Diagnostics.Add_missing_super_call, fixId, Diagnostics.Add_all_missing_super_calls)];
return [createCodeFixAction(fixId, changes, Diagnostics.Add_missing_super_call, fixId, Diagnostics.Add_all_missing_super_calls)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) =>

View File

@ -10,7 +10,7 @@ namespace ts.codefix {
if (!nodes) return undefined;
const { extendsToken, heritageClauses } = nodes;
const changes = textChanges.ChangeTracker.with(context, t => doChanges(t, sourceFile, extendsToken, heritageClauses));
return [createCodeFixAction(changes, Diagnostics.Change_extends_to_implements, fixId, Diagnostics.Change_all_extended_interfaces_to_implements)];
return [createCodeFixAction(fixId, changes, Diagnostics.Change_extends_to_implements, fixId, Diagnostics.Change_all_extended_interfaces_to_implements)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -11,7 +11,7 @@ namespace ts.codefix {
return undefined;
}
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, token));
return [createCodeFixAction(changes, Diagnostics.Add_this_to_unresolved_variable, fixId, Diagnostics.Add_this_to_all_unresolved_variables_matching_a_member_name)];
return [createCodeFixAction(fixId, changes, Diagnostics.Add_this_to_unresolved_variable, fixId, Diagnostics.Add_this_to_all_unresolved_variables_matching_a_member_name)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -1,5 +1,7 @@
/* @internal */
namespace ts.codefix {
const fixName = "invalidImportSyntax";
registerCodeFix({
errorCodes: [Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime.code],
getCodeActions: getActionsForInvalidImport
@ -43,7 +45,7 @@ namespace ts.codefix {
function createAction(context: CodeFixContext, sourceFile: SourceFile, node: Node, replacement: Node): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => t.replaceNode(sourceFile, node, replacement));
return createCodeFixActionNoFixId(changes, [Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]);
return createCodeFixActionNoFixId("invalidImportSyntax", changes, [Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]);
}
registerCodeFix({
@ -72,7 +74,7 @@ namespace ts.codefix {
addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport));
}
const changes = textChanges.ChangeTracker.with(context, t => t.replaceNode(sourceFile, expr, createPropertyAccess(expr, "default"), {}));
fixes.push(createCodeFixActionNoFixId(changes, Diagnostics.Use_synthetic_default_member));
fixes.push(createCodeFixActionNoFixId(fixName, changes, Diagnostics.Use_synthetic_default_member));
return fixes;
}
}

View File

@ -22,7 +22,7 @@ namespace ts.codefix {
function fix(type: Type, fixId: string, fixAllDescription: DiagnosticMessage): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, typeNode, type, checker));
return createCodeFixAction(changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type)], fixId, fixAllDescription);
return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type)], fixId, fixAllDescription);
}
},
fixIds: [fixIdPlain, fixIdNullable],

View File

@ -15,7 +15,7 @@ namespace ts.codefix {
const { node, suggestion } = info;
const { target } = context.host.getCompilationSettings();
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, node, suggestion, target));
return [createCodeFixAction(changes, [Diagnostics.Change_spelling_to_0, suggestion], fixId, Diagnostics.Fix_all_detected_spelling_errors)];
return [createCodeFixAction("spelling", changes, [Diagnostics.Change_spelling_to_0, suggestion], fixId, Diagnostics.Fix_all_detected_spelling_errors)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -1,5 +1,6 @@
/* @internal */
namespace ts.codefix {
const fixName = "strictClassInitialization";
const fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions";
const fixIdAddUndefinedType = "addMissingPropertyUndefinedType";
const fixIdAddInitializer = "addMissingPropertyInitializer";
@ -53,7 +54,7 @@ namespace ts.codefix {
function getActionForAddMissingDefiniteAssignmentAssertion (context: CodeFixContext, propertyDeclaration: PropertyDeclaration): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => addDefiniteAssignmentAssertion(t, context.sourceFile, propertyDeclaration));
return createCodeFixAction(changes, [Diagnostics.Add_definite_assignment_assertion_to_property_0, propertyDeclaration.getText()], fixIdAddDefiniteAssignmentAssertions, Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties);
return createCodeFixAction(fixName, changes, [Diagnostics.Add_definite_assignment_assertion_to_property_0, propertyDeclaration.getText()], fixIdAddDefiniteAssignmentAssertions, Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties);
}
function addDefiniteAssignmentAssertion(changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration): void {
@ -71,7 +72,7 @@ namespace ts.codefix {
function getActionForAddMissingUndefinedType (context: CodeFixContext, propertyDeclaration: PropertyDeclaration): CodeFixAction {
const changes = textChanges.ChangeTracker.with(context, t => addUndefinedType(t, context.sourceFile, propertyDeclaration));
return createCodeFixAction(changes, [Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, Diagnostics.Add_undefined_type_to_all_uninitialized_properties);
return createCodeFixAction(fixName, changes, [Diagnostics.Add_undefined_type_to_property_0, propertyDeclaration.name.getText()], fixIdAddUndefinedType, Diagnostics.Add_undefined_type_to_all_uninitialized_properties);
}
function addUndefinedType(changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration): void {
@ -86,7 +87,7 @@ namespace ts.codefix {
if (!initializer) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => addInitializer(t, context.sourceFile, propertyDeclaration, initializer));
return createCodeFixAction(changes, [Diagnostics.Add_initializer_to_property_0, propertyDeclaration.name.getText()], fixIdAddInitializer, Diagnostics.Add_initializers_to_all_uninitialized_properties);
return createCodeFixAction(fixName, changes, [Diagnostics.Add_initializer_to_property_0, propertyDeclaration.name.getText()], fixIdAddInitializer, Diagnostics.Add_initializers_to_all_uninitialized_properties);
}
function addInitializer (changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration, initializer: Expression): void {

View File

@ -1,5 +1,6 @@
/* @internal */
namespace ts.codefix {
const fixName = "unusedIdentifier";
const fixIdPrefix = "unusedIdentifier_prefix";
const fixIdDelete = "unusedIdentifier_delete";
const errorCodes = [
@ -14,7 +15,7 @@ namespace ts.codefix {
const importDecl = tryGetFullImport(sourceFile, context.span.start);
if (importDecl) {
const changes = textChanges.ChangeTracker.with(context, t => t.deleteNode(sourceFile, importDecl));
return [createCodeFixAction(changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDelete, Diagnostics.Delete_all_unused_declarations)];
return [createCodeFixAction(fixName, changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDelete, Diagnostics.Delete_all_unused_declarations)];
}
const token = getToken(sourceFile, textSpanEnd(context.span));
@ -22,12 +23,12 @@ namespace ts.codefix {
const deletion = textChanges.ChangeTracker.with(context, t => tryDeleteDeclaration(t, sourceFile, token));
if (deletion.length) {
result.push(createCodeFixAction(deletion, [Diagnostics.Remove_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDelete, Diagnostics.Delete_all_unused_declarations));
result.push(createCodeFixAction(fixName, deletion, [Diagnostics.Remove_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDelete, Diagnostics.Delete_all_unused_declarations));
}
const prefix = textChanges.ChangeTracker.with(context, t => tryPrefixDeclaration(t, errorCode, sourceFile, token));
if (prefix.length) {
result.push(createCodeFixAction(prefix, [Diagnostics.Prefix_0_with_an_underscore, token.getText(sourceFile)], fixIdPrefix, Diagnostics.Prefix_all_unused_declarations_with_where_possible));
result.push(createCodeFixAction(fixName, prefix, [Diagnostics.Prefix_0_with_an_underscore, token.getText(sourceFile)], fixIdPrefix, Diagnostics.Prefix_all_unused_declarations_with_where_possible));
}
return result;

View File

@ -25,8 +25,7 @@ namespace ts.codefix {
}
const declaration = declarations[0];
// Clone name to remove leading trivia.
const name = getSynthesizedDeepClone(getNameOfDeclaration(declaration)) as PropertyName;
const name = getSynthesizedDeepClone(getNameOfDeclaration(declaration), /*includeTrivia*/ false) as PropertyName;
const visibilityModifier = createVisibilityModifier(getModifierFlags(declaration));
const modifiers = visibilityModifier ? createNodeArray([visibilityModifier]) : undefined;
const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
@ -69,7 +68,7 @@ namespace ts.codefix {
for (const signature of signatures) {
// Need to ensure nodes are fresh each time so they can have different positions.
outputMethod(signature, getSynthesizedDeepClones(modifiers), getSynthesizedDeepClone(name));
outputMethod(signature, getSynthesizedDeepClones(modifiers, /*includeTrivia*/ false), getSynthesizedDeepClone(name, /*includeTrivia*/ false));
}
if (declarations.length > signatures.length) {
@ -103,10 +102,6 @@ namespace ts.codefix {
return signatureDeclaration;
}
function getSynthesizedDeepClones<T extends Node>(nodes: NodeArray<T> | undefined): NodeArray<T> | undefined {
return nodes && createNodeArray(nodes.map(getSynthesizedDeepClone));
}
export function createMethodFromCallExpression(
{ typeArguments, arguments: args }: CallExpression,
methodName: string,

View File

@ -35,7 +35,7 @@ namespace ts.codefix {
function createCodeAction(descriptionDiagnostic: DiagnosticMessage, diagnosticArgs: [string, string], changes: FileTextChanges[]): CodeFixAction {
// TODO: GH#20315
return createCodeFixActionNoFixId(changes, [descriptionDiagnostic, ...diagnosticArgs] as [DiagnosticMessage, string, string]);
return createCodeFixActionNoFixId("import", changes, [descriptionDiagnostic, ...diagnosticArgs] as [DiagnosticMessage, string, string]);
}
function convertToImportCodeFixContext(context: CodeFixContext, symbolToken: Node, symbolName: string): ImportCodeFixContext {
@ -240,6 +240,7 @@ namespace ts.codefix {
preferences: UserPreferences,
): ReadonlyArray<NewImportInfo> {
const { baseUrl, paths, rootDirs } = compilerOptions;
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
const addJsExtension = usesJsExtensionOnImports(sourceFile);
const choicesForEachExportingModule = flatMap<SymbolExportInfo, NewImportInfo[]>(moduleSymbols, ({ moduleSymbol, importKind }) => {
const modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(moduleFileName => {
@ -252,7 +253,7 @@ namespace ts.codefix {
return [global];
}
const relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), compilerOptions, addJsExtension);
const relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), moduleResolutionKind, addJsExtension);
if (!baseUrl || preferences.importModuleSpecifierPreference === "relative") {
return [relativePath];
}
@ -262,7 +263,7 @@ namespace ts.codefix {
return [relativePath];
}
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, compilerOptions, addJsExtension);
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, moduleResolutionKind, addJsExtension);
if (paths) {
const fromPaths = tryGetModuleNameFromPaths(removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
if (fromPaths) {
@ -390,7 +391,8 @@ namespace ts.codefix {
return firstDefined(roots, unNormalizedTypeRoot => {
const typeRoot = toPath(unNormalizedTypeRoot, /*basePath*/ undefined, getCanonicalFileName);
if (startsWith(moduleFileName, typeRoot)) {
return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options, addJsExtension);
// For a type definition, we can strip `/index` even with classic resolution.
return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), ModuleResolutionKind.NodeJs, addJsExtension);
}
});
}
@ -527,11 +529,11 @@ namespace ts.codefix {
});
}
function removeExtensionAndIndexPostFix(fileName: string, options: CompilerOptions, addJsExtension: boolean): string {
function removeExtensionAndIndexPostFix(fileName: string, moduleResolutionKind: ModuleResolutionKind, addJsExtension: boolean): string {
const noExtension = removeFileExtension(fileName);
return addJsExtension
? noExtension + ".js"
: getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeJs
: moduleResolutionKind === ModuleResolutionKind.NodeJs
? removeSuffix(noExtension, "/index")
: noExtension;
}

View File

@ -34,7 +34,7 @@ namespace ts.codefix {
let declaration!: Declaration;
const changes = textChanges.ChangeTracker.with(context, changes => { declaration = doChange(changes, sourceFile, token, errorCode, program, cancellationToken); });
return changes.length === 0 ? undefined
: [createCodeFixAction(changes, [getDiagnostic(errorCode, token), getNameOfDeclaration(declaration).getText(sourceFile)], fixId, Diagnostics.Infer_all_types_from_usage)];
: [createCodeFixAction(fixId, changes, [getDiagnostic(errorCode, token), getNameOfDeclaration(declaration).getText(sourceFile)], fixId, Diagnostics.Infer_all_types_from_usage)];
},
fixIds: [fixId],
getAllCodeActions(context) {

View File

@ -9,7 +9,7 @@ namespace ts.codefix {
const info = getInfo(sourceFile, start);
if (!info) return undefined;
const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, info));
return [createCodeFixAction(changes, Diagnostics.Convert_to_default_import, fixId, Diagnostics.Convert_all_to_default_imports)];
return [createCodeFixAction(fixId, changes, Diagnostics.Convert_to_default_import, fixId, Diagnostics.Convert_all_to_default_imports)];
},
fixIds: [fixId],
getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => {

View File

@ -842,7 +842,7 @@ namespace ts.Completions {
// Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS|
// Skip this partial identifier and adjust the contextToken to the token that precedes it.
if (contextToken && position <= contextToken.end && isWord(contextToken.kind)) {
if (contextToken && position <= contextToken.end && (isIdentifier(contextToken) || isKeyword(contextToken.kind))) {
const start = timestamp();
contextToken = findPrecedingToken(contextToken.getFullStart(), sourceFile, /*startNode*/ undefined, insideJsDocTagTypeExpression);
log("getCompletionData: Get previous token 2: " + (timestamp() - start));
@ -1553,32 +1553,22 @@ namespace ts.Completions {
* @returns true if 'symbols' was successfully populated; false otherwise.
*/
function tryGetImportOrExportClauseCompletionSymbols(): GlobalsSearch {
const namedImportsOrExports = tryGetNamedImportsOrExportsForCompletion(contextToken);
if (!namedImportsOrExports) return undefined;
// `import { |` or `import { a as 0, | }`
const namedImportsOrExports = contextToken && (contextToken.kind === SyntaxKind.OpenBraceToken || contextToken.kind === SyntaxKind.CommaToken)
? tryCast(contextToken.parent, isNamedImportsOrExports) : undefined;
if (!namedImportsOrExports) return GlobalsSearch.Continue;
// cursor is in an import clause
// try to show exported member for imported module
const declarationKind = namedImportsOrExports.kind === SyntaxKind.NamedImports ?
SyntaxKind.ImportDeclaration :
SyntaxKind.ExportDeclaration;
const importOrExportDeclaration = <ImportDeclaration | ExportDeclaration>getAncestor(namedImportsOrExports, declarationKind);
const moduleSpecifier = importOrExportDeclaration.moduleSpecifier;
if (!moduleSpecifier) {
return GlobalsSearch.Fail;
}
const { moduleSpecifier } = namedImportsOrExports.kind === SyntaxKind.NamedImports ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier);
if (!moduleSpecifierSymbol) return GlobalsSearch.Fail;
completionKind = CompletionKind.MemberLike;
isNewIdentifierLocation = false;
const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier);
if (!moduleSpecifierSymbol) {
symbols = emptyArray;
return GlobalsSearch.Fail;
}
const exports = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol);
symbols = filterNamedImportOrExportCompletionItems(exports, namedImportsOrExports.elements);
const existing = arrayToSet<ImportOrExportSpecifier>(namedImportsOrExports.elements, n => isCurrentlyEditingNode(n) ? undefined : (n.propertyName || n.name).escapedText);
symbols = exports.filter(e => e.escapedName !== InternalSymbolName.Default && !existing.get(e.escapedName));
return GlobalsSearch.Success;
}
@ -1646,26 +1636,6 @@ namespace ts.Completions {
return undefined;
}
/**
* Returns the containing list of named imports or exports of a context token,
* on the condition that one exists and that the context implies completion should be given.
*/
function tryGetNamedImportsOrExportsForCompletion(contextToken: Node): NamedImportsOrExports {
if (contextToken) {
switch (contextToken.kind) {
case SyntaxKind.OpenBraceToken: // import { |
case SyntaxKind.CommaToken: // import { a as 0, |
switch (contextToken.parent.kind) {
case SyntaxKind.NamedImports:
case SyntaxKind.NamedExports:
return <NamedImportsOrExports>contextToken.parent;
}
}
}
return undefined;
}
function isConstructorParameterCompletion(node: Node): boolean {
return !!node.parent && isParameter(node.parent) && isConstructorDeclaration(node.parent.parent)
&& (isParameterPropertyModifier(node.kind) || isDeclarationName(node));
@ -1909,31 +1879,6 @@ namespace ts.Completions {
return false;
}
/**
* Filters out completion suggestions for named imports or exports.
*
* @param exportsOfModule The list of symbols which a module exposes.
* @param namedImportsOrExports The list of existing import/export specifiers in the import/export clause.
*
* @returns Symbols to be suggested at an import/export clause, barring those whose named imports/exports
* do not occur at the current position and have not otherwise been typed.
*/
function filterNamedImportOrExportCompletionItems(exportsOfModule: Symbol[], namedImportsOrExports: ReadonlyArray<ImportOrExportSpecifier>): Symbol[] {
const existingImportsOrExports = createUnderscoreEscapedMap<boolean>();
for (const element of namedImportsOrExports) {
// If this is the current item we are editing right now, do not filter it out
if (isCurrentlyEditingNode(element)) {
continue;
}
const name = element.propertyName || element.name;
existingImportsOrExports.set(name.escapedText, true);
}
return exportsOfModule.filter(e => e.escapedName !== InternalSymbolName.Default && !existingImportsOrExports.get(e.escapedName));
}
/**
* Filters out completion suggestions for named imports or exports.
*

View File

@ -1,7 +1,7 @@
/* @internal */
namespace ts.DocumentHighlights {
export function getDocumentHighlights(program: Program, cancellationToken: CancellationToken, sourceFile: SourceFile, position: number, sourceFilesToSearch: ReadonlyArray<SourceFile>): DocumentHighlights[] | undefined {
const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true);
const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true);
if (node.parent && (isJsxOpeningElement(node.parent) && node.parent.tagName === node || isJsxClosingElement(node.parent))) {
// For a JSX element, just highlight the matching tag, not all references.

View File

@ -706,10 +706,18 @@ namespace ts.FindAllReferences.Core {
if (!symbol) return true; // Be lenient with invalid code.
return getPossibleSymbolReferencePositions(sourceFile, symbol.name).some(position => {
const token = tryCast(getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true), isIdentifier);
return token && token !== definition && token.escapedText === definition.escapedText && checker.getSymbolAtLocation(token) === symbol;
if (!token || token === definition || token.escapedText !== definition.escapedText) return false;
const referenceSymbol = checker.getSymbolAtLocation(token);
return referenceSymbol === symbol
|| checker.getShorthandAssignmentValueSymbol(token.parent) === symbol
|| isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol;
});
}
function getPossibleSymbolReferenceNodes(sourceFile: SourceFile, symbolName: string, container: Node = sourceFile): ReadonlyArray<Node> {
return getPossibleSymbolReferencePositions(sourceFile, symbolName, container).map(pos => getTouchingPropertyName(sourceFile, pos, /*includeJsDocComment*/ true));
}
function getPossibleSymbolReferencePositions(sourceFile: SourceFile, symbolName: string, container: Node = sourceFile): ReadonlyArray<number> {
const positions: number[] = [];
@ -748,11 +756,9 @@ namespace ts.FindAllReferences.Core {
function getLabelReferencesInNode(container: Node, targetLabel: Identifier): SymbolAndEntries[] {
const sourceFile = container.getSourceFile();
const labelName = targetLabel.text;
const references = mapDefined(getPossibleSymbolReferencePositions(sourceFile, labelName, container), position => {
const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false);
const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), node =>
// Only pick labels that are either the target label, or have a target that is the target label
return node && (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) ? nodeEntry(node) : undefined;
});
node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel) ? nodeEntry(node) : undefined);
return [{ definition: { type: "label", node: targetLabel }, references }];
}
@ -782,10 +788,8 @@ namespace ts.FindAllReferences.Core {
function getAllReferencesForKeyword(sourceFiles: ReadonlyArray<SourceFile>, keywordKind: SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] {
const references = flatMap(sourceFiles, sourceFile => {
cancellationToken.throwIfCancellationRequested();
return mapDefined(getPossibleSymbolReferencePositions(sourceFile, tokenToString(keywordKind), sourceFile), position => {
const referenceLocation = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true);
return referenceLocation.kind === keywordKind ? nodeEntry(referenceLocation) : undefined;
});
return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, tokenToString(keywordKind), sourceFile), referenceLocation =>
referenceLocation.kind === keywordKind ? nodeEntry(referenceLocation) : undefined);
});
return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references }] : undefined;
}
@ -1249,9 +1253,8 @@ namespace ts.FindAllReferences.Core {
}
const sourceFile = searchSpaceNode.getSourceFile();
const references = mapDefined(getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode), position => {
const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false);
if (!node || node.kind !== SyntaxKind.SuperKeyword) {
const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "super", searchSpaceNode), node => {
if (node.kind !== SyntaxKind.SuperKeyword) {
return;
}
@ -1301,12 +1304,30 @@ namespace ts.FindAllReferences.Core {
return undefined;
}
const references: Entry[] = [];
for (const sourceFile of searchSpaceNode.kind === SyntaxKind.SourceFile ? sourceFiles : [searchSpaceNode.getSourceFile()]) {
const references = flatMap(searchSpaceNode.kind === SyntaxKind.SourceFile ? sourceFiles : [searchSpaceNode.getSourceFile()], sourceFile => {
cancellationToken.throwIfCancellationRequested();
const positions = getPossibleSymbolReferencePositions(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode);
getThisReferencesInFile(sourceFile, searchSpaceNode.kind === SyntaxKind.SourceFile ? sourceFile : searchSpaceNode, positions, staticFlag, references);
}
return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(node => {
if (!isThis(node)) {
return false;
}
const container = getThisContainer(node, /* includeArrowFunctions */ false);
switch (searchSpaceNode.kind) {
case SyntaxKind.FunctionExpression:
case SyntaxKind.FunctionDeclaration:
return searchSpaceNode.symbol === container.symbol;
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol;
case SyntaxKind.ClassExpression:
case SyntaxKind.ClassDeclaration:
// Make sure the container belongs to the same class
// and has the appropriate static modifier from the original container.
return container.parent && searchSpaceNode.symbol === container.parent.symbol && (getModifierFlags(container) & ModifierFlags.Static) === staticFlag;
case SyntaxKind.SourceFile:
return container.kind === SyntaxKind.SourceFile && !isExternalModule(<SourceFile>container);
}
});
}).map(n => nodeEntry(n));
return [{
definition: { type: "this", node: thisOrSuperKeyword },
@ -1314,52 +1335,11 @@ namespace ts.FindAllReferences.Core {
}];
}
function getThisReferencesInFile(sourceFile: SourceFile, searchSpaceNode: Node, possiblePositions: ReadonlyArray<number>, staticFlag: ModifierFlags, result: Push<Entry>): void {
forEach(possiblePositions, position => {
const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false);
if (!node || !isThis(node)) {
return;
}
const container = getThisContainer(node, /* includeArrowFunctions */ false);
switch (searchSpaceNode.kind) {
case SyntaxKind.FunctionExpression:
case SyntaxKind.FunctionDeclaration:
if (searchSpaceNode.symbol === container.symbol) {
result.push(nodeEntry(node));
}
break;
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
if (isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) {
result.push(nodeEntry(node));
}
break;
case SyntaxKind.ClassExpression:
case SyntaxKind.ClassDeclaration:
// Make sure the container belongs to the same class
// and has the appropriate static modifier from the original container.
if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (getModifierFlags(container) & ModifierFlags.Static) === staticFlag) {
result.push(nodeEntry(node));
}
break;
case SyntaxKind.SourceFile:
if (container.kind === SyntaxKind.SourceFile && !isExternalModule(<SourceFile>container)) {
result.push(nodeEntry(node));
}
break;
}
});
}
function getReferencesForStringLiteral(node: StringLiteral, sourceFiles: ReadonlyArray<SourceFile>, cancellationToken: CancellationToken): SymbolAndEntries[] {
const references = flatMap(sourceFiles, sourceFile => {
cancellationToken.throwIfCancellationRequested();
return mapDefined(getPossibleSymbolReferencePositions(sourceFile, node.text), position => {
const ref = tryCast(getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false), isStringLiteral);
return ref && ref.text === node.text ? nodeEntry(ref, /*isInString*/ true) : undefined;
});
return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, node.text), ref =>
isStringLiteral(ref) && ref.text === node.text ? nodeEntry(ref, /*isInString*/ true) : undefined);
});
return [{

View File

@ -131,9 +131,7 @@ namespace ts.OrganizeImports {
}
function getExternalModuleName(specifier: Expression) {
return isStringLiteral(specifier) || isNoSubstitutionTemplateLiteral(specifier)
? specifier.text
: undefined;
return isStringLiteralLike(specifier) ? specifier.text : undefined;
}
/* @internal */ // Internal for testing

View File

@ -47,8 +47,10 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor {
const { isStatic, fieldName, accessorName, type, container, declaration } = fieldInfo;
const isInClassLike = isClassLike(container);
const accessorModifiers = getAccessorModifiers(isJS, declaration, isStatic, isInClassLike);
const fieldModifiers = getFieldModifiers(isJS, isStatic, isInClassLike);
const accessorModifiers = isInClassLike
? !declaration.modifiers || getModifierFlags(declaration) & ModifierFlags.Private ? getModifiers(isJS, isStatic, SyntaxKind.PublicKeyword) : declaration.modifiers
: undefined;
const fieldModifiers = isInClassLike ? getModifiers(isJS, isStatic, SyntaxKind.PrivateKeyword) : undefined;
updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers, container);
@ -82,24 +84,9 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor {
return isIdentifier(fieldName) ? createPropertyAccess(leftHead, fieldName) : createElementAccess(leftHead, createLiteral(fieldName));
}
function getAccessorModifiers(isJS: boolean, declaration: AcceptedDeclaration, isStatic: boolean, isClassLike: boolean): NodeArray<Modifier> | undefined {
if (!isClassLike) return undefined;
if (!declaration.modifiers || getModifierFlags(declaration) & ModifierFlags.Private) {
const modifiers = append<Modifier>(
!isJS ? [createToken(SyntaxKind.PublicKeyword)] : undefined,
isStatic ? createToken(SyntaxKind.StaticKeyword) : undefined
);
return modifiers && createNodeArray(modifiers);
}
return declaration.modifiers;
}
function getFieldModifiers(isJS: boolean, isStatic: boolean, isClassLike: boolean): NodeArray<Modifier> | undefined {
if (!isClassLike) return undefined;
function getModifiers(isJS: boolean, isStatic: boolean, accessModifier: SyntaxKind.PublicKeyword | SyntaxKind.PrivateKeyword): NodeArray<Modifier> {
const modifiers = append<Modifier>(
!isJS ? [createToken(SyntaxKind.PrivateKeyword)] : undefined,
!isJS ? [createToken(accessModifier) as Token<SyntaxKind.PublicKeyword> | Token<SyntaxKind.PrivateKeyword>] : undefined,
isStatic ? createToken(SyntaxKind.StaticKeyword) : undefined
);
return modifiers && createNodeArray(modifiers);

View File

@ -2,7 +2,7 @@
namespace ts.Rename {
export function getRenameInfo(typeChecker: TypeChecker, defaultLibFileName: string, getCanonicalFileName: GetCanonicalFileName, sourceFile: SourceFile, position: number): RenameInfo {
const getCanonicalDefaultLibName = memoize(() => getCanonicalFileName(normalizePath(defaultLibFileName)));
const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true);
const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true);
const renameInfo = node && nodeIsEligibleForRename(node)
? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile)
: undefined;

View File

@ -446,6 +446,8 @@ namespace ts {
}
export interface CodeFixAction extends CodeAction {
/** Short name to identify the fix, for use by telemetry. */
fixName: string;
/**
* If present, one may call 'getCombinedCodeFix' with this fixId.
* This may be omitted to indicate that the code fix can't be applied in a group.

View File

@ -627,18 +627,12 @@ namespace ts {
return syntaxList;
}
/* Gets the token whose text has range [start, end) and
* position >= start and (position < end or (position === end && token is keyword or identifier))
*/
export function getTouchingWord(sourceFile: SourceFile, position: number, includeJsDocComment: boolean): Node {
return getTouchingToken(sourceFile, position, includeJsDocComment, n => isWord(n.kind));
}
/* Gets the token whose text has range [start, end) and position >= start
* and (position < end or (position === end && token is keyword or identifier or numeric/string literal))
/**
* Gets the token whose text has range [start, end) and
* position >= start and (position < end or (position === end && token is literal or keyword or identifier))
*/
export function getTouchingPropertyName(sourceFile: SourceFile, position: number, includeJsDocComment: boolean): Node {
return getTouchingToken(sourceFile, position, includeJsDocComment, n => isPropertyName(n.kind));
return getTouchingToken(sourceFile, position, includeJsDocComment, n => isPropertyNameLiteral(n) || isKeyword(n.kind));
}
/**
@ -1059,14 +1053,6 @@ namespace ts {
return undefined;
}
export function isWord(kind: SyntaxKind): boolean {
return kind === SyntaxKind.Identifier || isKeyword(kind);
}
function isPropertyName(kind: SyntaxKind): boolean {
return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || isWord(kind);
}
export function isComment(kind: SyntaxKind): boolean {
return kind === SyntaxKind.SingleLineCommentTrivia || kind === SyntaxKind.MultiLineCommentTrivia;
}
@ -1459,11 +1445,13 @@ namespace ts {
* WARNING: This is an expensive operation and is only intended to be used in refactorings
* and code fixes (because those are triggered by explicit user actions).
*/
export function getSynthesizedDeepClone<T extends Node>(node: T | undefined): T | undefined {
if (node === undefined) {
return undefined;
}
export function getSynthesizedDeepClone<T extends Node>(node: T | undefined, includeTrivia = true): T | undefined {
const clone = node && getSynthesizedDeepCloneWorker(node);
if (clone && !includeTrivia) suppressLeadingAndTrailingTrivia(clone);
return clone;
}
function getSynthesizedDeepCloneWorker<T extends Node>(node: T): T | undefined {
const visited = visitEachChild(node, getSynthesizedDeepClone, nullTransformationContext);
if (visited === node) {
// This only happens for leaf nodes - internal nodes always see their children change.
@ -1474,22 +1462,18 @@ namespace ts {
else if (isNumericLiteral(clone)) {
clone.numericLiteralFlags = (node as any).numericLiteralFlags;
}
clone.pos = node.pos;
clone.end = node.end;
return clone;
return setTextRange(clone, node);
}
// PERF: As an optimization, rather than calling getSynthesizedClone, we'll update
// the new node created by visitEachChild with the extra changes getSynthesizedClone
// would have made.
visited.parent = undefined;
return visited;
}
export function getSynthesizedDeepClones<T extends Node>(nodes: NodeArray<T> | undefined): NodeArray<T> | undefined {
return nodes && createNodeArray(nodes.map(getSynthesizedDeepClone), nodes.hasTrailingComma);
export function getSynthesizedDeepClones<T extends Node>(nodes: NodeArray<T> | undefined, includeTrivia = true): NodeArray<T> | undefined {
return nodes && createNodeArray(nodes.map(n => getSynthesizedDeepClone(n, includeTrivia)), nodes.hasTrailingComma);
}
/**

View File

@ -4526,6 +4526,8 @@ declare namespace ts {
commands?: CodeActionCommand[];
}
interface CodeFixAction extends CodeAction {
/** Short name to identify the fix, for use by telemetry. */
fixName: string;
/**
* If present, one may call 'getCombinedCodeFix' with this fixId.
* This may be omitted to indicate that the code fix can't be applied in a group.

View File

@ -0,0 +1,9 @@
// ==ORIGINAL==
import { x } from "a";
export { x };
// ==ORGANIZED==
import { x } from "a";
export { x };

View File

@ -0,0 +1,9 @@
// ==ORIGINAL==
import { x } from "a";
const o = { x };
// ==ORGANIZED==
import { x } from "a";
const o = { x };

View File

@ -1,62 +1,10 @@
Exit Code: 1
Standard output:
../../../../node_modules/@types/node/index.d.ts(138,13): error TS2300: Duplicate identifier 'require'.
../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type 'Module', but here has type 'NodeModule'.
../../../../node_modules/@types/node/index.d.ts(174,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'Buffer' must be of type 'typeof Buffer', but here has type '{ new (str: string, encoding?: string | undefined): Buffer; new (size: number): Buffer; new (arra...'.
node_modules/bcryptjs/dist/bcrypt.js(37,16): error TS2345: Argument of type 'never[]' is not assignable to parameter of type 'string'.
node_modules/bcryptjs/dist/bcrypt.js(134,18): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/bcryptjs/dist/bcrypt.js(190,9): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
node_modules/bcryptjs/dist/bcrypt.js(200,18): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/bcryptjs/dist/bcrypt.js(278,18): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/bcryptjs/dist/bcrypt.js(563,42): error TS2531: Object is possibly 'null'.
node_modules/bcryptjs/dist/bcrypt.js(566,44): error TS2531: Object is possibly 'null'.
node_modules/bcryptjs/dist/bcrypt.js(566,59): error TS2533: Object is possibly 'null' or 'undefined'.
node_modules/bcryptjs/dist/bcrypt.js(569,44): error TS2531: Object is possibly 'null'.
node_modules/bcryptjs/dist/bcrypt.js(569,61): error TS2533: Object is possibly 'null' or 'undefined'.
node_modules/bcryptjs/dist/bcrypt.js(569,76): error TS2533: Object is possibly 'null' or 'undefined'.
node_modules/bcryptjs/dist/bcrypt.js(1203,26): error TS2345: Argument of type 'Int32Array | number[]' is not assignable to parameter of type 'number[]'.
Type 'Int32Array' is not assignable to type 'number[]'.
Property 'flatMap' is missing in type 'Int32Array'.
node_modules/bcryptjs/dist/bcrypt.js(1233,30): error TS2345: Argument of type 'null' is not assignable to parameter of type 'Error'.
node_modules/bcryptjs/dist/bcrypt.js(1345,27): error TS2345: Argument of type 'number[] | undefined' is not assignable to parameter of type 'number[]'.
Type 'undefined' is not assignable to type 'number[]'.
node_modules/bcryptjs/dist/bcrypt.js(1351,35): error TS2345: Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
node_modules/bcryptjs/dist/bcrypt.js(1353,30): error TS2345: Argument of type 'null' is not assignable to parameter of type 'Error'.
node_modules/bcryptjs/dist/bcrypt.js(1353,43): error TS2345: Argument of type 'number[] | undefined' is not assignable to parameter of type 'number[]'.
Type 'undefined' is not assignable to type 'number[]'.
node_modules/bcryptjs/externs/bcrypt.js(36,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/bcrypt.js(50,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/bcrypt.js(65,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/bcrypt.js(80,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/bcrypt.js(87,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/minimal-env.js(10,10): error TS2300: Duplicate identifier 'require'.
node_modules/bcryptjs/externs/minimal-env.js(48,1): error TS8022: JSDoc '@extends' is not attached to a class.
node_modules/bcryptjs/externs/minimal-env.js(63,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/minimal-env.js(65,8): error TS2339: Property 'randomBytes' does not exist on type 'Crypto'.
node_modules/bcryptjs/externs/minimal-env.js(70,8): error TS2540: Cannot assign to 'crypto' because it is a constant or a read-only property.
node_modules/bcryptjs/externs/minimal-env.js(75,1): error TS2322: Type '(array: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array) => void' is not assignable to type '(array: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8Clamp...'.
Type 'void' is not assignable to type 'Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray ...'.
node_modules/bcryptjs/externs/minimal-env.js(90,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/externs/minimal-env.js(96,14): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/bcryptjs/scripts/build.js(5,20): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(6,19): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(7,20): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(8,24): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(12,18): error TS2339: Property 'version' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(18,4): error TS2339: Property 'writeFileSync' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(19,10): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(20,16): error TS2339: Property 'transform' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(20,29): error TS2339: Property 'readFileSync' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(20,58): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(1,26): error TS2307: Cannot find module 'metascript'.
node_modules/bcryptjs/scripts/build.js(32,1): error TS2322: Type '{ VERSION: any; }' is not assignable to type '{ [x: string]: any; VERSION: any; ISAAC: boolean; }'.
Property 'ISAAC' is missing in type '{ VERSION: any; }'.
node_modules/bcryptjs/scripts/build.js(32,24): error TS2339: Property 'version' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(34,4): error TS2339: Property 'writeFileSync' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(35,10): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(36,16): error TS2339: Property 'transform' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(36,29): error TS2339: Property 'readFileSync' does not exist on type 'void'.
node_modules/bcryptjs/scripts/build.js(36,58): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/src/bcrypt.js(25,13): error TS2322: Type 'Buffer' is not assignable to type 'number[]'.
Property 'flatMap' is missing in type 'Buffer'.
node_modules/bcryptjs/src/bcrypt.js(94,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/bcryptjs/src/bcrypt.js(150,5): error TS2322: Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
@ -64,6 +12,7 @@ node_modules/bcryptjs/src/bcrypt.js(160,14): error TS2366: Function lacks ending
node_modules/bcryptjs/src/bcrypt.js(238,14): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
node_modules/bcryptjs/src/bcrypt/impl.js(516,22): error TS2345: Argument of type 'Int32Array | number[]' is not assignable to parameter of type 'number[]'.
Type 'Int32Array' is not assignable to type 'number[]'.
Property 'flatMap' is missing in type 'Int32Array'.
node_modules/bcryptjs/src/bcrypt/impl.js(546,26): error TS2345: Argument of type 'null' is not assignable to parameter of type 'Error'.
node_modules/bcryptjs/src/bcrypt/impl.js(658,23): error TS2345: Argument of type 'number[] | undefined' is not assignable to parameter of type 'number[]'.
Type 'undefined' is not assignable to type 'number[]'.
@ -78,63 +27,11 @@ node_modules/bcryptjs/src/bcrypt/prng/accum.js(65,74): error TS2339: Property 'd
node_modules/bcryptjs/src/bcrypt/prng/accum.js(66,22): error TS2339: Property 'detachEvent' does not exist on type 'Document'.
node_modules/bcryptjs/src/bcrypt/prng/accum.js(67,22): error TS2339: Property 'detachEvent' does not exist on type 'Document'.
node_modules/bcryptjs/src/bcrypt/util.js(20,5): error TS2304: Cannot find name 'utfx'.
node_modules/bcryptjs/src/wrap.js(38,16): error TS2345: Argument of type 'never[]' is not assignable to parameter of type 'string'.
node_modules/bcryptjs/tests/suite.js(4,27): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(15,26): error TS2339: Property 'encodeBase64' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(21,28): error TS2339: Property 'decodeBase64' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(27,27): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(35,16): error TS2339: Property 'genSalt' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(45,20): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(47,30): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(47,60): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(52,16): error TS2339: Property 'hash' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(60,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(61,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(62,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(63,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(64,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(65,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(68,24): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(69,27): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(70,27): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(73,24): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(74,27): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(75,27): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(78,24): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(79,27): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(80,27): error TS2339: Property 'compareSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(86,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(87,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(88,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(90,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(91,16): error TS2339: Property 'compare' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(94,20): error TS2339: Property 'compare' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(97,24): error TS2339: Property 'compare' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(100,28): error TS2339: Property 'compare' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(111,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(111,53): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(112,27): error TS2339: Property 'getSalt' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(113,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(119,28): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(119,53): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(120,27): error TS2339: Property 'getRounds' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(125,16): error TS2339: Property 'genSalt' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(128,20): error TS2339: Property 'hash' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(142,16): error TS2339: Property 'genSalt' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(144,20): error TS2339: Property 'hash' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(147,24): error TS2339: Property 'compare' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(150,28): error TS2339: Property 'genSalt' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(170,27): error TS2339: Property 'readFileSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(170,45): error TS2339: Property 'join' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(171,31): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(172,33): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(173,32): error TS2339: Property 'hashSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(179,32): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(180,33): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(184,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(185,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(189,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/tests/suite.js(190,28): error TS2339: Property 'genSaltSync' does not exist on type 'void'.
node_modules/bcryptjs/src/wrap.js(37,26): error TS2304: Cannot find name 'define'.
node_modules/bcryptjs/src/wrap.js(37,51): error TS2304: Cannot find name 'define'.
node_modules/bcryptjs/src/wrap.js(38,9): error TS2304: Cannot find name 'define'.
node_modules/bcryptjs/src/wrap.js(49,12): error TS2552: Cannot find name 'bcrypt'. Did you mean 'Crypto'?
node_modules/bcryptjs/tests/suite.js(3,23): error TS2307: Cannot find module 'bcrypt'.

View File

@ -1,216 +1,5 @@
Exit Code: 1
Standard output:
node_modules/bluebird/js/browser/bluebird.core.js(30,116): error TS2304: Cannot find name 'define'.
node_modules/bluebird/js/browser/bluebird.core.js(30,124): error TS2304: Cannot find name 'define'.
node_modules/bluebird/js/browser/bluebird.core.js(30,135): error TS2304: Cannot find name 'define'.
node_modules/bluebird/js/browser/bluebird.core.js(30,266): error TS2532: Object is possibly 'undefined'.
node_modules/bluebird/js/browser/bluebird.core.js(30,268): error TS2339: Property 'Promise' does not exist on type 'Window | Global'.
Property 'Promise' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.core.js(30,394): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.core.js(30,415): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.core.js(30,521): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/bluebird/js/browser/bluebird.core.js(30,694): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.core.js(30,715): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.core.js(122,21): error TS2300: Duplicate identifier 'invokeLater'.
node_modules/bluebird/js/browser/bluebird.core.js(123,21): error TS2300: Duplicate identifier 'invoke'.
node_modules/bluebird/js/browser/bluebird.core.js(124,21): error TS2300: Duplicate identifier 'settlePromises'.
node_modules/bluebird/js/browser/bluebird.core.js(126,21): error TS2300: Duplicate identifier 'invokeLater'.
node_modules/bluebird/js/browser/bluebird.core.js(138,21): error TS2300: Duplicate identifier 'invoke'.
node_modules/bluebird/js/browser/bluebird.core.js(148,21): error TS2300: Duplicate identifier 'settlePromises'.
node_modules/bluebird/js/browser/bluebird.core.js(681,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'event' must be of type 'CustomEvent<any>', but here has type 'Event'.
node_modules/bluebird/js/browser/bluebird.core.js(687,26): error TS2339: Property 'detail' does not exist on type 'Event'.
node_modules/bluebird/js/browser/bluebird.core.js(1068,46): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.core.js(1242,5): error TS2721: Cannot invoke an object which is possibly 'null'.
node_modules/bluebird/js/browser/bluebird.core.js(1260,30): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
node_modules/bluebird/js/browser/bluebird.core.js(1266,37): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
node_modules/bluebird/js/browser/bluebird.core.js(1305,38): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
node_modules/bluebird/js/browser/bluebird.core.js(1314,25): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.core.js(1500,49): error TS2350: Only a void function can be called with the 'new' keyword.
node_modules/bluebird/js/browser/bluebird.core.js(2125,24): error TS2339: Property 'PromiseInspection' does not exist on type 'typeof Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2138,32): error TS2322: Type 'null' is not assignable to type 'Domain'.
node_modules/bluebird/js/browser/bluebird.core.js(2241,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2266,14): error TS2551: Property 'isFulfilled' does not exist on type 'Promise'. Did you mean '_setFulfilled'?
node_modules/bluebird/js/browser/bluebird.core.js(2267,37): error TS2339: Property 'value' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2269,21): error TS2551: Property 'isRejected' does not exist on type 'Promise'. Did you mean '_setRejected'?
node_modules/bluebird/js/browser/bluebird.core.js(2270,36): error TS2339: Property 'reason' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2278,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2295,9): error TS2339: Property '_captureStackTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2325,9): error TS2339: Property '_captureStackTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2356,63): error TS2339: Property '_boundTo' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2359,14): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2371,20): error TS2339: Property '_unsetRejectionIsUnhandled' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2375,20): error TS2339: Property '_attachExtraTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2413,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2418,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2423,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2440,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2457,42): error TS2339: Property '_isBound' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2552,26): error TS2339: Property '_propagateFrom' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2589,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2591,10): error TS2339: Property '_attachExtraTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2598,10): error TS2339: Property '_captureStackTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2599,10): error TS2339: Property '_pushContext' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2601,18): error TS2339: Property '_execute' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2607,10): error TS2339: Property '_popContext' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2748,14): error TS2339: Property '_attachExtraTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2776,14): error TS2339: Property '_ensurePossibleRejectionHandled' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2816,10): error TS2339: Property '_clearCancellationData' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.core.js(2951,18): error TS2339: Property '_resolveEmptyArray' does not exist on type 'PromiseArray'.
node_modules/bluebird/js/browser/bluebird.core.js(2989,30): error TS2554: Expected 0-1 arguments, but got 2.
node_modules/bluebird/js/browser/bluebird.core.js(2991,30): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.core.js(3165,31): error TS2339: Property 'standalone' does not exist on type 'Navigator'.
node_modules/bluebird/js/browser/bluebird.core.js(3165,52): error TS2339: Property 'cordova' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.core.js(3599,5): error TS7027: Unreachable code detected.
node_modules/bluebird/js/browser/bluebird.core.js(3761,25): error TS2304: Cannot find name 'chrome'.
node_modules/bluebird/js/browser/bluebird.core.js(3761,51): error TS2304: Cannot find name 'chrome'.
node_modules/bluebird/js/browser/bluebird.core.js(3762,25): error TS2304: Cannot find name 'chrome'.
node_modules/bluebird/js/browser/bluebird.core.js(3781,118): error TS2339: Property 'P' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.core.js(3781,129): error TS2339: Property 'Promise' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.core.js(3781,282): error TS2339: Property 'P' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.core.js(3781,291): error TS2339: Property 'Promise' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.js(29,116): error TS2304: Cannot find name 'define'.
node_modules/bluebird/js/browser/bluebird.js(29,124): error TS2304: Cannot find name 'define'.
node_modules/bluebird/js/browser/bluebird.js(29,135): error TS2304: Cannot find name 'define'.
node_modules/bluebird/js/browser/bluebird.js(29,266): error TS2532: Object is possibly 'undefined'.
node_modules/bluebird/js/browser/bluebird.js(29,268): error TS2339: Property 'Promise' does not exist on type 'Window | Global'.
Property 'Promise' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.js(29,394): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.js(29,415): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.js(29,521): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/bluebird/js/browser/bluebird.js(29,694): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.js(29,715): error TS2304: Cannot find name '_dereq_'.
node_modules/bluebird/js/browser/bluebird.js(144,21): error TS2300: Duplicate identifier 'invokeLater'.
node_modules/bluebird/js/browser/bluebird.js(145,21): error TS2300: Duplicate identifier 'invoke'.
node_modules/bluebird/js/browser/bluebird.js(146,21): error TS2300: Duplicate identifier 'settlePromises'.
node_modules/bluebird/js/browser/bluebird.js(148,21): error TS2300: Duplicate identifier 'invokeLater'.
node_modules/bluebird/js/browser/bluebird.js(160,21): error TS2300: Duplicate identifier 'invoke'.
node_modules/bluebird/js/browser/bluebird.js(170,21): error TS2300: Duplicate identifier 'settlePromises'.
node_modules/bluebird/js/browser/bluebird.js(828,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'event' must be of type 'CustomEvent<any>', but here has type 'Event'.
node_modules/bluebird/js/browser/bluebird.js(834,26): error TS2339: Property 'detail' does not exist on type 'Event'.
node_modules/bluebird/js/browser/bluebird.js(1215,46): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.js(1389,5): error TS2721: Cannot invoke an object which is possibly 'null'.
node_modules/bluebird/js/browser/bluebird.js(1407,30): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
node_modules/bluebird/js/browser/bluebird.js(1413,37): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
node_modules/bluebird/js/browser/bluebird.js(1452,38): error TS2339: Property 'stack' does not exist on type 'CapturedTrace'.
node_modules/bluebird/js/browser/bluebird.js(1461,25): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.js(1679,49): error TS2350: Only a void function can be called with the 'new' keyword.
node_modules/bluebird/js/browser/bluebird.js(2251,5): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.js(2456,10): error TS2551: Property '_init$' does not exist on type 'MappingPromiseArray'. Did you mean '_init'?
node_modules/bluebird/js/browser/bluebird.js(2462,23): error TS2339: Property '_values' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2463,23): error TS2339: Property 'length' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2473,22): error TS2339: Property '_isResolved' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2483,28): error TS2339: Property '_promise' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2496,18): error TS2339: Property '_reject' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2500,58): error TS2339: Property '_promise' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2513,22): error TS2339: Property '_reject' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2516,22): error TS2339: Property '_cancel' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2522,32): error TS2339: Property '_totalResolved' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2527,18): error TS2339: Property '_resolve' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2537,23): error TS2339: Property '_values' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2539,18): error TS2339: Property '_isResolved' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2553,10): error TS2339: Property '_resolve' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2582,66): error TS2339: Property 'promise' does not exist on type 'MappingPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(2738,19): error TS2339: Property 'cause' does not exist on type 'Error'.
node_modules/bluebird/js/browser/bluebird.js(2773,24): error TS2339: Property 'PromiseInspection' does not exist on type 'typeof Promise'.
node_modules/bluebird/js/browser/bluebird.js(2786,32): error TS2322: Type 'null' is not assignable to type 'Domain'.
node_modules/bluebird/js/browser/bluebird.js(2889,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(2914,14): error TS2551: Property 'isFulfilled' does not exist on type 'Promise'. Did you mean '_setFulfilled'?
node_modules/bluebird/js/browser/bluebird.js(2915,37): error TS2339: Property 'value' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(2917,21): error TS2551: Property 'isRejected' does not exist on type 'Promise'. Did you mean '_setRejected'?
node_modules/bluebird/js/browser/bluebird.js(2918,36): error TS2339: Property 'reason' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(2926,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(2943,9): error TS2339: Property '_captureStackTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(2973,9): error TS2339: Property '_captureStackTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3004,63): error TS2339: Property '_boundTo' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3007,14): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3019,20): error TS2339: Property '_unsetRejectionIsUnhandled' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3023,20): error TS2339: Property '_attachExtraTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3061,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3066,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3071,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3088,10): error TS2339: Property '_fireEvent' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3105,42): error TS2339: Property '_isBound' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3200,26): error TS2339: Property '_propagateFrom' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3237,14): error TS2339: Property '_warn' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3239,10): error TS2339: Property '_attachExtraTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3246,10): error TS2339: Property '_captureStackTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3247,10): error TS2339: Property '_pushContext' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3249,18): error TS2339: Property '_execute' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3255,10): error TS2339: Property '_popContext' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3396,14): error TS2339: Property '_attachExtraTrace' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3424,14): error TS2339: Property '_ensurePossibleRejectionHandled' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3464,10): error TS2339: Property '_clearCancellationData' does not exist on type 'Promise'.
node_modules/bluebird/js/browser/bluebird.js(3614,18): error TS2339: Property '_resolveEmptyArray' does not exist on type 'PromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(3652,30): error TS2554: Expected 0-1 arguments, but got 2.
node_modules/bluebird/js/browser/bluebird.js(3654,30): error TS2554: Expected 0 arguments, but got 1.
node_modules/bluebird/js/browser/bluebird.js(3799,22): error TS2554: Expected 0-1 arguments, but got 3.
node_modules/bluebird/js/browser/bluebird.js(3823,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'any'.
node_modules/bluebird/js/browser/bluebird.js(3979,17): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/bluebird/js/browser/bluebird.js(3982,24): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/bluebird/js/browser/bluebird.js(3994,12): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/bluebird/js/browser/bluebird.js(4111,10): error TS2339: Property '_values' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4112,32): error TS2339: Property '_totalResolved' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4113,31): error TS2339: Property '_length' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4116,37): error TS2339: Property '_values' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4119,34): error TS2339: Property 'length' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4120,40): error TS2339: Property 'length' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4121,26): error TS2339: Property '_values' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4121,57): error TS2339: Property '_values' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4124,14): error TS2339: Property '_resolve' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4148,53): error TS2339: Property 'promise' does not exist on type 'PropertiesPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4336,9): error TS2532: Object is possibly 'undefined'.
node_modules/bluebird/js/browser/bluebird.js(4353,10): error TS2339: Property '_promise' does not exist on type 'ReductionPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4358,52): error TS2339: Property '_cancel' does not exist on type 'ReductionPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4359,14): error TS2339: Property '_isResolved' does not exist on type 'ReductionPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4360,10): error TS2551: Property '_resultCancelled$' does not exist on type 'ReductionPromiseArray'. Did you mean '_resultCancelled'?
node_modules/bluebird/js/browser/bluebird.js(4425,18): error TS2339: Property 'promise' does not exist on type 'ReductionPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4489,31): error TS2339: Property 'standalone' does not exist on type 'Navigator'.
node_modules/bluebird/js/browser/bluebird.js(4489,52): error TS2339: Property 'cordova' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.js(4542,10): error TS2339: Property '_values' does not exist on type 'SettledPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4543,32): error TS2339: Property '_totalResolved' does not exist on type 'SettledPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4544,31): error TS2339: Property '_length' does not exist on type 'SettledPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4545,14): error TS2339: Property '_resolve' does not exist on type 'SettledPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4545,28): error TS2339: Property '_values' does not exist on type 'SettledPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4566,46): error TS2339: Property 'promise' does not exist on type 'SettledPromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4598,14): error TS2339: Property '_resolve' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4601,10): error TS2551: Property '_init$' does not exist on type 'SomePromiseArray'. Did you mean '_init'?
node_modules/bluebird/js/browser/bluebird.js(4602,40): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4603,15): error TS2339: Property '_isResolved' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4606,14): error TS2551: Property '_reject' does not exist on type 'SomePromiseArray'. Did you mean '_rejected'?
node_modules/bluebird/js/browser/bluebird.js(4606,47): error TS2339: Property 'length' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4630,14): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4632,18): error TS2339: Property '_resolve' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4632,32): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4634,18): error TS2339: Property '_resolve' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4634,32): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4647,14): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4647,49): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4648,21): error TS2339: Property '_cancel' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4657,27): error TS2339: Property 'length' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4657,46): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4658,22): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4659,29): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4663,18): error TS2551: Property '_reject' does not exist on type 'SomePromiseArray'. Did you mean '_rejected'?
node_modules/bluebird/js/browser/bluebird.js(4665,18): error TS2339: Property '_cancel' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4673,17): error TS2339: Property '_totalResolved' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4677,17): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4677,39): error TS2339: Property 'length' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4681,10): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4685,10): error TS2339: Property '_values' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4685,23): error TS2339: Property '_totalResolved' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4689,17): error TS2339: Property 'length' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(4699,10): error TS2551: Property '_reject' does not exist on type 'SomePromiseArray'. Did you mean '_rejected'?
node_modules/bluebird/js/browser/bluebird.js(4707,23): error TS2339: Property 'promise' does not exist on type 'SomePromiseArray'.
node_modules/bluebird/js/browser/bluebird.js(5090,20): error TS2339: Property 'doDispose' does not exist on type 'Disposer'.
node_modules/bluebird/js/browser/bluebird.js(5109,23): error TS2339: Property 'data' does not exist on type 'FunctionDisposer'.
node_modules/bluebird/js/browser/bluebird.js(5441,5): error TS7027: Unreachable code detected.
node_modules/bluebird/js/browser/bluebird.js(5603,25): error TS2304: Cannot find name 'chrome'.
node_modules/bluebird/js/browser/bluebird.js(5603,51): error TS2304: Cannot find name 'chrome'.
node_modules/bluebird/js/browser/bluebird.js(5604,25): error TS2304: Cannot find name 'chrome'.
node_modules/bluebird/js/browser/bluebird.js(5623,118): error TS2339: Property 'P' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.js(5623,129): error TS2339: Property 'Promise' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.js(5623,282): error TS2339: Property 'P' does not exist on type 'Window'.
node_modules/bluebird/js/browser/bluebird.js(5623,291): error TS2339: Property 'Promise' does not exist on type 'Window'.
node_modules/bluebird/js/release/assert.js(11,30): error TS2339: Property 'constructor$' does not exist on type 'Error'.
node_modules/bluebird/js/release/async.js(92,21): error TS2300: Duplicate identifier 'invokeLater'.
node_modules/bluebird/js/release/async.js(93,21): error TS2300: Duplicate identifier 'invoke'.

View File

@ -328,7 +328,6 @@ node_modules/lodash/fp/string.js(2,26): error TS2345: Argument of type '{ [x: st
node_modules/lodash/fp/util.js(2,26): error TS2345: Argument of type '{ [x: string]: any; 'attempt': Function; 'bindAll': Function; 'cond': (pairs: any[]) => Function;...' is not assignable to parameter of type 'string'.
node_modules/lodash/includes.js(24,10): error TS1003: Identifier expected.
node_modules/lodash/includes.js(24,10): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/index.js(1,26): error TS2306: File '/home/nathansa/ts/tests/cases/user/lodash/node_modules/lodash/lodash.js' is not a module.
node_modules/lodash/intersectionBy.js(41,32): error TS2554: Expected 0-1 arguments, but got 2.
node_modules/lodash/isBuffer.js(5,69): error TS2339: Property 'nodeType' does not exist on type 'typeof import("/home/nathansa/ts/tests/cases/user/lodash/node_modules/lodash/isBuffer")'.
node_modules/lodash/isBuffer.js(8,80): error TS2339: Property 'nodeType' does not exist on type 'NodeModule'.
@ -336,321 +335,6 @@ node_modules/lodash/isEqual.js(32,10): error TS2554: Expected 3-5 arguments, but
node_modules/lodash/isEqualWith.js(38,59): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'boolean'.
node_modules/lodash/iteratee.js(50,74): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/keys.js(34,32): error TS2554: Expected 2 arguments, but got 1.
node_modules/lodash/lodash.js(419,58): error TS2339: Property 'Object' does not exist on type 'Window'.
node_modules/lodash/lodash.js(428,82): error TS2339: Property 'nodeType' does not exist on type 'NodeModule'.
node_modules/lodash/lodash.js(434,49): error TS2339: Property 'process' does not exist on type 'false | Global'.
Property 'process' does not exist on type 'false'.
node_modules/lodash/lodash.js(488,19): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(508,20): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(512,5): error TS2322: Type 'any[] | undefined' is not assignable to type 'any[]'.
Type 'undefined' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(528,20): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(532,5): error TS2322: Type 'any[] | undefined' is not assignable to type 'any[]'.
Type 'undefined' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(550,22): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(573,19): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(587,17): error TS8024: JSDoc '@param' tag has name 'target', but there is no parameter with that name.
node_modules/lodash/lodash.js(592,36): error TS2345: Argument of type 'any[] | undefined' is not assignable to parameter of type 'any[]'.
Type 'undefined' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(600,17): error TS8024: JSDoc '@param' tag has name 'target', but there is no parameter with that name.
node_modules/lodash/lodash.js(609,29): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(631,32): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(672,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(675,43): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(695,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(698,43): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(718,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(749,22): error TS8024: JSDoc '@param' tag has name 'The', but there is no parameter with that name.
node_modules/lodash/lodash.js(924,16): error TS2345: Argument of type 'Function' is not assignable to parameter of type '((a: any, b: any) => number) | undefined'.
Type 'Function' is not assignable to type '(a: any, b: any) => number'.
node_modules/lodash/lodash.js(1374,22): error TS8024: JSDoc '@param' tag has name 'The', but there is no parameter with that name.
node_modules/lodash/lodash.js(1771,9): error TS2322: Type 'typeof lodash' is not assignable to type 'Function'.
Types of property 'bind' are incompatible.
Type 'Function' is not assignable to type '(this: Function, thisArg: any, ...argArray: any[]) => any'.
Type 'Function' provides no match for the signature '(this: Function, thisArg: any, ...argArray: any[]): any'.
node_modules/lodash/lodash.js(1916,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(1939,24): error TS8024: JSDoc '@param' tag has name 'hash', but there is no parameter with that name.
node_modules/lodash/lodash.js(2020,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(2137,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(2241,18): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(2288,24): error TS2339: Property 'size' does not exist on type 'ListCache'.
node_modules/lodash/lodash.js(2604,11): error TS2322: Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
node_modules/lodash/lodash.js(2604,30): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(2628,20): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
node_modules/lodash/lodash.js(2629,20): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
node_modules/lodash/lodash.js(2630,20): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
node_modules/lodash/lodash.js(2652,37): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean | undefined'.
node_modules/lodash/lodash.js(2665,47): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean | undefined'.
node_modules/lodash/lodash.js(2791,9): error TS2322: Type '(array?: any[] | undefined, value: any, comparator: Function) => boolean' is not assignable to type '(array?: any[] | undefined, value: any) => boolean'.
node_modules/lodash/lodash.js(2797,9): error TS2322: Type 'SetCache' is not assignable to type 'any[]'.
Property 'flatMap' is missing in type 'SetCache'.
node_modules/lodash/lodash.js(2814,19): error TS2554: Expected 2 arguments, but got 3.
node_modules/lodash/lodash.js(2905,35): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(2949,21): error TS2322: Type '(value: any) => boolean' is not assignable to type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(2954,26): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(2954,26): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/lodash/lodash.js(2954,26): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures.
node_modules/lodash/lodash.js(3176,44): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(3183,58): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(3286,44): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'.
node_modules/lodash/lodash.js(3403,51): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(3587,40): error TS2345: Argument of type 'string | symbol' is not assignable to parameter of type 'string'.
Type 'symbol' is not assignable to type 'string'.
node_modules/lodash/lodash.js(3593,45): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(3830,64): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(3860,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string | any[]'.
node_modules/lodash/lodash.js(4001,29): error TS2345: Argument of type 'string | symbol' is not assignable to parameter of type 'string'.
Type 'symbol' is not assignable to type 'string'.
node_modules/lodash/lodash.js(4061,11): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4062,18): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4062,49): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4064,13): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4065,11): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4066,9): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4068,16): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4068,24): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4068,36): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4068,42): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4069,7): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4073,39): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4271,9): error TS2322: Type '(array?: any[] | undefined, value: any, comparator: Function) => boolean' is not assignable to type '(array?: any[] | undefined, value: any) => boolean'.
node_modules/lodash/lodash.js(4274,37): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(4280,9): error TS2322: Type 'SetCache' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(4303,19): error TS2554: Expected 2 arguments, but got 3.
node_modules/lodash/lodash.js(4497,25): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4537,20): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(4757,9): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(4759,7): error TS2322: Type 'any[] | undefined' is not assignable to type 'any[]'.
Type 'undefined' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(4807,33): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(4819,33): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(4982,28): error TS2554: Expected 3 arguments, but got 1.
node_modules/lodash/lodash.js(5001,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5002,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5003,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5004,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5005,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5006,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5007,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5008,26): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(5047,50): error TS2339: Property 'placeholder' does not exist on type '(...args: any[]) => any'.
node_modules/lodash/lodash.js(5072,38): error TS2454: Variable 'iteratee' is used before being assigned.
node_modules/lodash/lodash.js(5097,26): error TS2454: Variable 'wrapper' is used before being assigned.
node_modules/lodash/lodash.js(5101,17): error TS2454: Variable 'wrapper' is used before being assigned.
node_modules/lodash/lodash.js(5106,46): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(5112,23): error TS2454: Variable 'wrapper' is used before being assigned.
node_modules/lodash/lodash.js(5112,59): error TS2454: Variable 'wrapper' is used before being assigned.
node_modules/lodash/lodash.js(5115,17): error TS2454: Variable 'wrapper' is used before being assigned.
node_modules/lodash/lodash.js(5116,17): error TS2454: Variable 'wrapper' is used before being assigned.
node_modules/lodash/lodash.js(5116,25): error TS2339: Property 'thru' does not exist on type 'LodashWrapper'.
node_modules/lodash/lodash.js(5124,28): error TS2339: Property 'plant' does not exist on type 'LodashWrapper'.
node_modules/lodash/lodash.js(5162,53): error TS2345: Argument of type 'string | Function' is not assignable to parameter of type 'Function'.
Type 'string' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(5177,46): error TS2345: Argument of type 'any[] | undefined' is not assignable to parameter of type 'any[]'.
Type 'undefined' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(5180,56): error TS2345: Argument of type 'any[] | undefined' is not assignable to parameter of type 'any[]'.
Type 'undefined' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(5182,19): error TS2454: Variable 'holdersCount' is used before being assigned.
node_modules/lodash/lodash.js(5183,35): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(5186,13): error TS2345: Argument of type 'string | Function' is not assignable to parameter of type 'Function'.
Type 'string' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(5186,50): error TS2339: Property 'placeholder' does not exist on type '(...args: any[]) => any'.
node_modules/lodash/lodash.js(5187,44): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(5191,42): error TS2538: Type 'Function' cannot be used as an index type.
node_modules/lodash/lodash.js(5199,22): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(5520,42): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(5543,33): error TS2345: Argument of type 'string | Function' is not assignable to parameter of type 'Function'.
Type 'string' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(5545,30): error TS2345: Argument of type 'string | Function' is not assignable to parameter of type 'Function'.
Type 'string' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(5546,104): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(5547,32): error TS2345: Argument of type 'string | Function' is not assignable to parameter of type 'Function'.
Type 'string' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(5552,55): error TS2345: Argument of type 'string | Function' is not assignable to parameter of type 'Function'.
Type 'string' is not assignable to type 'Function'.
node_modules/lodash/lodash.js(5605,24): error TS8024: JSDoc '@param' tag has name 'key', but there is no parameter with that name.
node_modules/lodash/lodash.js(5742,11): error TS2454: Variable 'convert' is used before being assigned.
node_modules/lodash/lodash.js(5826,22): error TS2322: Type 'boolean' is not assignable to type 'number'.
node_modules/lodash/lodash.js(5921,21): error TS2339: Property 'placeholder' does not exist on type 'Function | typeof lodash'.
Property 'placeholder' does not exist on type 'Function'.
node_modules/lodash/lodash.js(5932,25): error TS8029: JSDoc '@param' tag has name 'arity', but there is no parameter with that name. It would match 'arguments' if it had an array type.
node_modules/lodash/lodash.js(5938,33): error TS2554: Expected 0-1 arguments, but got 2.
node_modules/lodash/lodash.js(6006,11): error TS2454: Variable 'unmasked' is used before being assigned.
node_modules/lodash/lodash.js(6043,27): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(6149,54): error TS2454: Variable 'key' is used before being assigned.
node_modules/lodash/lodash.js(6162,20): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/lodash.js(6166,30): error TS2339: Property 'index' does not exist on type 'any[]'.
node_modules/lodash/lodash.js(6167,30): error TS2339: Property 'input' does not exist on type 'any[]'.
node_modules/lodash/lodash.js(6239,9): error TS1223: 'returns' tag already specified.
node_modules/lodash/lodash.js(6244,9): error TS2322: Type 'string' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(6249,7): error TS2322: Type 'string' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(6359,18): error TS2554: Expected 0 arguments, but got 1.
node_modules/lodash/lodash.js(6444,26): error TS2339: Property 'cache' does not exist on type 'Function'.
node_modules/lodash/lodash.js(6489,30): error TS2554: Expected 4 arguments, but got 3.
node_modules/lodash/lodash.js(6496,30): error TS2554: Expected 4 arguments, but got 3.
node_modules/lodash/lodash.js(6563,46): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6567,31): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6570,31): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6571,26): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6574,19): error TS2538: Type 'undefined' cannot be used as an index type.
node_modules/lodash/lodash.js(6709,24): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6716,7): error TS2322: Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
node_modules/lodash/lodash.js(6778,9): error TS1223: 'returns' tag already specified.
node_modules/lodash/lodash.js(6821,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(6821,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(6838,22): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6843,46): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6846,64): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(6941,56): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(6977,56): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(7010,56): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(7023,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(7023,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(7057,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(7057,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(7296,17): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(8145,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(8145,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(8178,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(8178,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(8303,46): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(8334,46): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(8361,46): error TS2345: Argument of type '(value: any) => boolean' is not assignable to parameter of type 'boolean | undefined'.
Type '(value: any) => boolean' is not assignable to type 'false'.
node_modules/lodash/lodash.js(8822,55): error TS2339: Property 'thru' does not exist on type 'LodashWrapper'.
node_modules/lodash/lodash.js(9093,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(9093,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(9407,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(9407,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(9432,12): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(9433,55): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
Type 'undefined' is not assignable to type 'number'.
node_modules/lodash/lodash.js(9563,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(9563,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(9587,9): error TS2322: Type 'string[][]' is not assignable to type 'string[] | undefined'.
Type 'string[][]' is not assignable to type 'string[]'.
Type 'string[]' is not assignable to type 'string'.
node_modules/lodash/lodash.js(9589,38): error TS2345: Argument of type 'any[] | string[] | Function[] | any[][] | undefined' is not assignable to parameter of type 'any[] | string[] | Function[]'.
Type 'undefined' is not assignable to type 'any[] | string[] | Function[]'.
node_modules/lodash/lodash.js(9673,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((array?: any[] | undefined, iteratee: Function, accumulator?: any, initAccum?: boolean | undefin...' has no compatible call signatures.
node_modules/lodash/lodash.js(9702,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((collection: any, iteratee: Function, accumulator: any, initAccum: boolean, eachFunc: Function) ...' has no compatible call signatures.
node_modules/lodash/lodash.js(9773,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(9773,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(9859,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(9859,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(10004,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(10004,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(10092,59): error TS2454: Variable 'holders' is used before being assigned.
node_modules/lodash/lodash.js(10146,57): error TS2454: Variable 'holders' is used before being assigned.
node_modules/lodash/lodash.js(10167,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(10167,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(10193,14): error TS2339: Property 'placeholder' does not exist on type 'Function'.
node_modules/lodash/lodash.js(10193,34): error TS2339: Property 'placeholder' does not exist on type '(func: Function, arity?: number | undefined, guard: any) => Function'.
node_modules/lodash/lodash.js(10212,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(10212,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(10238,14): error TS2339: Property 'placeholder' does not exist on type 'Function'.
node_modules/lodash/lodash.js(10238,39): error TS2339: Property 'placeholder' does not exist on type '(func: Function, arity?: number | undefined, guard: any) => Function'.
node_modules/lodash/lodash.js(10313,21): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10314,31): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10315,47): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10316,34): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10341,27): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10355,69): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10834,26): error TS2538: Type 'undefined' cannot be used as an index type.
node_modules/lodash/lodash.js(10896,32): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10897,34): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(10899,35): error TS2345: Argument of type '{ 'leading': boolean; 'maxWait': number | undefined; 'trailing': boolean; }' is not assignable to parameter of type '{ leading?: boolean; maxWait?: number; trailing?: boolean; } | undefined'.
Type '{ 'leading': boolean; 'maxWait': number | undefined; 'trailing': boolean; }' is not assignable to type '{ leading?: boolean; maxWait?: number; trailing?: boolean; }'.
Types of property 'maxWait' are incompatible.
Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
node_modules/lodash/lodash.js(10922,14): error TS2554: Expected 3 arguments, but got 2.
node_modules/lodash/lodash.js(10960,19): error TS8029: JSDoc '@param' tag has name 'value', but there is no parameter with that name. It would match 'arguments' if it had an array type.
node_modules/lodash/lodash.js(11021,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(11057,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(11079,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(11112,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(11523,14): error TS2554: Expected 3-5 arguments, but got 2.
node_modules/lodash/lodash.js(13298,36): error TS2554: Expected 2 arguments, but got 1.
node_modules/lodash/lodash.js(13354,33): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/lodash/lodash.js(13392,38): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/lodash/lodash.js(13500,36): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(13581,16): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/lodash/lodash.js(13796,7): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((array?: any[] | undefined, iteratee: Function) => any[]) | ((object: any, iteratee: Function) =...' has no compatible call signatures.
node_modules/lodash/lodash.js(13797,16): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/lodash/lodash.js(13974,9): error TS2322: Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'.
node_modules/lodash/lodash.js(14174,48): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'.
node_modules/lodash/lodash.js(14245,43): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'.
node_modules/lodash/lodash.js(14458,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(14458,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(14486,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(14486,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(14520,33): error TS8029: JSDoc '@param' tag has name 'replacement', but there is no parameter with that name. It would match 'arguments' if it had an array type.
node_modules/lodash/lodash.js(14582,56): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14692,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(14692,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(14773,38): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14780,25): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14785,10): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14788,10): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14793,25): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14802,19): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14827,22): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(14877,25): error TS8024: JSDoc '@param' tag has name 'string', but there is no parameter with that name.
node_modules/lodash/lodash.js(14902,25): error TS8024: JSDoc '@param' tag has name 'string', but there is no parameter with that name.
node_modules/lodash/lodash.js(14928,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(14928,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(14966,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(14966,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(14999,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(14999,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(15065,40): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(15066,30): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(15067,34): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(15083,20): error TS2454: Variable 'strSymbols' is used before being assigned.
node_modules/lodash/lodash.js(15090,11): error TS2454: Variable 'strSymbols' is used before being assigned.
node_modules/lodash/lodash.js(15138,41): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'.
node_modules/lodash/lodash.js(15194,14): error TS1003: Identifier expected.
node_modules/lodash/lodash.js(15194,14): error TS8024: JSDoc '@param' tag has name '', but there is no parameter with that name.
node_modules/lodash/lodash.js(15356,45): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(15518,78): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(15550,44): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(15580,34): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'string'.
Type 'any[]' is not assignable to type 'string'.
node_modules/lodash/lodash.js(15580,60): error TS2345: Argument of type 'number' is not assignable to parameter of type 'boolean'.
node_modules/lodash/lodash.js(15689,53): error TS2532: Object is possibly 'undefined'.
node_modules/lodash/lodash.js(15706,65): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'.
node_modules/lodash/lodash.js(15773,30): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
Type 'undefined' is not assignable to type 'number'.
node_modules/lodash/lodash.js(15872,41): error TS2345: Argument of type 'string | symbol' is not assignable to parameter of type 'string'.
Type 'symbol' is not assignable to type 'string'.
node_modules/lodash/lodash.js(16914,19): error TS2339: Property 'filter' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16918,19): error TS2339: Property 'filter' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16935,19): error TS2339: Property 'filter' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16946,25): error TS2339: Property 'takeRight' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16948,25): error TS2339: Property 'drop' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16952,35): error TS2339: Property 'dropRight' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16952,60): error TS2339: Property 'take' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16962,19): error TS2339: Property 'take' does not exist on type 'LazyWrapper'.
node_modules/lodash/lodash.js(16983,68): error TS2345: Argument of type 'IArguments | number[]' is not assignable to parameter of type 'any[]'.
Type 'IArguments' is not assignable to type 'any[]'.
node_modules/lodash/lodash.js(17073,14): error TS2304: Cannot find name 'define'.
node_modules/lodash/lodash.js(17073,45): error TS2304: Cannot find name 'define'.
node_modules/lodash/lodash.js(17073,71): error TS2304: Cannot find name 'define'.
node_modules/lodash/lodash.js(17082,5): error TS2304: Cannot find name 'define'.
node_modules/lodash/lodash.js(17089,30): error TS2339: Property '_' does not exist on type 'typeof lodash'.
node_modules/lodash/map.js(50,27): error TS2554: Expected 0-1 arguments, but got 2.
node_modules/lodash/mapKeys.js(28,14): error TS2554: Expected 0-1 arguments, but got 2.
node_modules/lodash/mapKeys.js(31,29): error TS2722: Cannot invoke an object which is possibly 'undefined'.

View File

@ -1,60 +1,5 @@
Exit Code: 1
Standard output:
node_modules/url-search-params/build/url-search-params.js(2,5): error TS2322: Type '{ new (init?: string | URLSearchParams | undefined): URLSearchParams; prototype: URLSearchParams; }' is not assignable to type '(query: any) => void'.
Type '{ new (init?: string | URLSearchParams | undefined): URLSearchParams; prototype: URLSearchParams; }' provides no match for the signature '(query: any): void'.
node_modules/url-search-params/build/url-search-params.js(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'URLSearchParams' must be of type '{ new (init?: string | URLSearchParams | undefined): URLSearchParams; prototype: URLSearchParams; }', but here has type '(query: any) => void'.
node_modules/url-search-params/build/url-search-params.js(2,3851): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,3851): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,3851): error TS2684: The 'this' context of type '(() => any) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.js(2,3918): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,3918): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,3918): error TS2684: The 'this' context of type '((v: any) => void) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.js(2,4005): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,4005): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,4005): error TS2684: The 'this' context of type '(() => any) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.js(2,4074): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,4074): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.js(2,4074): error TS2684: The 'this' context of type '((v: any) => void) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.js(2,4676): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,5038): error TS2339: Property 'keys' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,5077): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,5368): error TS2339: Property 'values' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,5411): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,5699): error TS2339: Property 'entries' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,5744): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,6099): error TS2339: Property 'entries' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,6165): error TS2339: Property 'sort' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.js(2,6203): error TS2339: Property 'entries' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(246,22): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(246,22): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(246,22): error TS2684: The 'this' context of type '(() => any) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.max.js(250,15): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(250,15): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(250,15): error TS2684: The 'this' context of type '((v: any) => void) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.max.js(256,22): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(256,22): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(256,22): error TS2684: The 'this' context of type '(() => any) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.max.js(260,15): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(260,15): error TS2532: Object is possibly 'undefined'.
node_modules/url-search-params/build/url-search-params.max.js(260,15): error TS2684: The 'this' context of type '((v: any) => void) | undefined' is not assignable to method's 'this' of type 'Function'.
Type 'undefined' is not assignable to type 'Function'.
node_modules/url-search-params/build/url-search-params.max.js(322,26): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(337,26): error TS2339: Property 'keys' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(339,12): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(358,26): error TS2339: Property 'values' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(360,12): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(379,26): error TS2339: Property 'entries' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(381,12): error TS2339: Property 'forEach' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(400,66): error TS2339: Property 'entries' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(404,26): error TS2339: Property 'sort' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.max.js(406,24): error TS2339: Property 'entries' does not exist on type 'URLSearchParams'.
node_modules/url-search-params/build/url-search-params.node.js(174,1): error TS2539: Cannot assign to 'URLSearchParams' because it is not a variable.
node_modules/url-search-params/build/url-search-params.node.js(174,44): error TS2339: Property 'URLSearchParams' does not exist on type 'Global'.

View File

@ -7,7 +7,6 @@
verify.codeFix({
description: "Implement interface 'A'",
// TODO: GH#18795
newFileContent:
`class A {
f() {}

View File

@ -12,7 +12,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`function foo<T>(a: T) {
a;

View File

@ -12,7 +12,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`function foo<T>(a: T) {
a;

View File

@ -20,7 +20,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`abstract class A {
abstract get a(): number | string;

View File

@ -12,7 +12,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`abstract class A {
abstract f(a: number, b: string): boolean;

View File

@ -8,7 +8,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`abstract class A {
abstract f(): this;

View File

@ -8,7 +8,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`abstract class A<T> {
abstract f(x: T): T;

View File

@ -8,7 +8,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`abstract class A<T> {
abstract f(x: T): T;

View File

@ -10,7 +10,6 @@
verify.codeFix({
description: "Implement inherited abstract class",
// TODO: GH#18795
newFileContent:
`abstract class A {
abstract x: number;

View File

@ -36,9 +36,9 @@ verify.codeFix({
/**close-brace prefix*/ }
/**close-brace prefix*/ }
class C implements N.I {
/** property prefix */ a /** colon prefix */: N.E.a;
/** property prefix */ b /** colon prefix */: N.E;
/**method signature prefix */ foo /**open angle prefix */<X>(a: X): string {
a: N.E.a;
b: N.E;
foo<X>(a: X): string {
throw new Error("Method not implemented.");
}
}`,

View File

@ -84,7 +84,6 @@ class C implements I {
20: any;
21: any;
22: any;
/** a nice safe prime */
23: any;
}`,
});

View File

@ -0,0 +1,16 @@
/// <reference path="fourslash.ts" />
// @moduleResolution: classic
// @Filename: /node_modules/@types/foo/index.d.ts
////export const xyz: number;
// @Filename: /a.ts
////[|xyz|]
goTo.file("/a.ts");
verify.importFixAtPosition([
`import { xyz } from "foo";
xyz`
]);

View File

@ -10,5 +10,9 @@
"types": ["node"],
"lib": ["esnext", "dom"],
},
"include": ["node_modules/bcryptjs"]
"include": [
"node_modules/bcryptjs/scripts",
"node_modules/bcryptjs/src",
"node_modules/bcryptjs/tests"
]
}

View File

@ -10,5 +10,5 @@
"types": ["node"],
"lib": ["esnext", "dom"],
},
"include": ["node_modules/bluebird"]
"include": ["node_modules/bluebird/js/release"]
}

View File

@ -10,5 +10,6 @@
"types": ["node"],
"lib": ["esnext", "dom"],
},
"include": ["node_modules/lodash"]
"include": ["node_modules/lodash"],
"exclude": ["node_modules/lodash/lodash.js"]
}

View File

@ -10,5 +10,5 @@
"types": ["node"],
"lib": ["esnext", "dom"],
},
"include": ["node_modules/url-search-params"]
"include": ["node_modules/url-search-params/build/url-search-params.node.js"]
}