fix(55765): Implement Interface Code Action is not available under certain circumstances (#55767)
This commit is contained in:
Родитель
72c12c9920
Коммит
017c1e0e64
|
@ -397,7 +397,7 @@ export function createSignatureDeclarationFromSignature(
|
|||
|
||||
let typeParameters = isJs ? undefined : signatureDeclaration.typeParameters;
|
||||
let parameters = signatureDeclaration.parameters;
|
||||
let type = isJs ? undefined : signatureDeclaration.type;
|
||||
let type = isJs ? undefined : getSynthesizedDeepClone(signatureDeclaration.type);
|
||||
if (importAdder) {
|
||||
if (typeParameters) {
|
||||
const newTypeParameters = sameMap(typeParameters, typeParameterDecl => {
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
////
|
||||
////export type DeepPartial<T> = T extends Builtin ? T :
|
||||
//// T extends Array<infer U> ? Array<DeepPartial<U>> :
|
||||
//// T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> :
|
||||
//// T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> } : Partial<T>;
|
||||
////
|
||||
////export interface Nested {
|
||||
//// field: string;
|
||||
////}
|
||||
////
|
||||
////interface Foo {
|
||||
//// request(): DeepPartial<{ nested1: Nested; test2: Nested }>;
|
||||
////}
|
||||
////[|export class C implements Foo {}|]
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'Foo'",
|
||||
newRangeContent:
|
||||
`export class C implements Foo {
|
||||
request(): { nested1?: { field?: string; }; test2?: { field?: string; }; } {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}`,
|
||||
});
|
Загрузка…
Ссылка в новой задаче