mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
add support to convert lambda to function and vice-versa (#28250)
* add skeleton * add getAvailableActions * add working getEditsForAction * add multi vardecl * fix multi decl bug * change refactor name * add tests for ToAnon, ToArrow and available arrow * add tests for ToNamed and available anon * add tests for ReturnType and available Arrow as FnParam * fix bug modifiers by toNamed * add tests for modifiers * fix for tslint error * adapt one test case * refactor getInfo getAvailableActions * refactor small progress * extract creation of block * extract creation of funcDeclaration * make guideline compliant * apply feedback from pr * add testcase and apply feedback from pr * apply feedback from pr * add newline * rename testcases * Make conditions more expressive * fix for unnecessary duplication of comment * apply feedback from pr * update getAvailableActions * check if functionExpression name is used * add more testcases * do not provide refactoring when it contains this because this behaves differently in arrow than in function * exclude nested functions and classes at containingThis check * fix linting error * fix line endings Co-authored-by: BigAru <arooran@indikon.ch> Co-authored-by: bigaru <bigaru@users.noreply.github.com> Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com> Co-authored-by: Jesse Trinity <jetrinit@microsoft.com>
This commit is contained in:
co-authored by
BigAru
bigaru
Jesse Trinity
commit
1d1c1673bf
@@ -5717,6 +5717,22 @@
|
||||
"category": "Message",
|
||||
"code": 95121
|
||||
},
|
||||
"Convert arrow function or function expression": {
|
||||
"category": "Message",
|
||||
"code": 95122
|
||||
},
|
||||
"Convert to anonymous function": {
|
||||
"category": "Message",
|
||||
"code": 95123
|
||||
},
|
||||
"Convert to named function": {
|
||||
"category": "Message",
|
||||
"code": 95124
|
||||
},
|
||||
"Convert to arrow function": {
|
||||
"category": "Message",
|
||||
"code": 95125
|
||||
},
|
||||
|
||||
"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": {
|
||||
"category": "Error",
|
||||
|
||||
Reference in New Issue
Block a user