forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(51245): Class with parameter decorator in arrow function causes "…
…convert to default export" refactoring failure (microsoft#51256) * fix(51245): don't rely on parent nodes in formatting rules * check existing parent node
- Loading branch information
1 parent
16faf45
commit d4f26c8
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
tests/cases/fourslash/refactorConvertExport_namedToDefault2.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @Filename: /a.ts | ||
/////*a*/export const f = () => { | ||
//// return class C { | ||
//// constructor(@Foo() param: any) { } | ||
//// } | ||
////}/*b*/ | ||
////function Foo(...args: any[]): any {} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert export", | ||
actionName: "Convert named export to default export", | ||
actionDescription: "Convert named export to default export", | ||
newContent: | ||
`export default () => { | ||
return class C { | ||
constructor(@Foo() param: any) { } | ||
} | ||
} | ||
function Foo(...args: any[]): any {}`, | ||
}); |