Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit017c1e0

Browse files
authored
fix(55765): Implement Interface Code Action is not available under certain circumstances (microsoft#55767)
1 parent72c12c9 commit017c1e0

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

‎src/services/codefixes/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export function createSignatureDeclarationFromSignature(
397397

398398
lettypeParameters=isJs ?undefined :signatureDeclaration.typeParameters;
399399
letparameters=signatureDeclaration.parameters;
400-
lettype=isJs ?undefined :signatureDeclaration.type;
400+
lettype=isJs ?undefined :getSynthesizedDeepClone(signatureDeclaration.type);
401401
if(importAdder){
402402
if(typeParameters){
403403
constnewTypeParameters=sameMap(typeParameters,typeParameterDecl=>{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
4+
////
5+
////export type DeepPartial<T> = T extends Builtin ? T :
6+
//// T extends Array<infer U> ? Array<DeepPartial<U>> :
7+
//// T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> :
8+
//// T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> } : Partial<T>;
9+
////
10+
////export interface Nested {
11+
//// field: string;
12+
////}
13+
////
14+
////interface Foo {
15+
//// request(): DeepPartial<{ nested1: Nested; test2: Nested }>;
16+
////}
17+
////[|export class C implements Foo {}|]
18+
19+
verify.codeFix({
20+
description:"Implement interface 'Foo'",
21+
newRangeContent:
22+
`export class C implements Foo {
23+
request(): { nested1?: { field?: string; }; test2?: { field?: string; }; } {
24+
throw new Error("Method not implemented.");
25+
}
26+
}`,
27+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp