mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
add skeleton
This commit is contained in:
@@ -4720,5 +4720,21 @@
|
||||
"Generate types for all packages without types": {
|
||||
"category": "Message",
|
||||
"code": 95068
|
||||
},
|
||||
"Convert arrow function or anonymous function": {
|
||||
"category": "Message",
|
||||
"code": 95069
|
||||
},
|
||||
"Convert to anonymous function": {
|
||||
"category": "Message",
|
||||
"code": 95070
|
||||
},
|
||||
"Convert to named function": {
|
||||
"category": "Message",
|
||||
"code": 95071
|
||||
},
|
||||
"Convert to arrow function": {
|
||||
"category": "Message",
|
||||
"code": 95072
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/* @internal */
|
||||
namespace ts.refactor.convertArrowFunctionOrFunction {
|
||||
const refactorName = "Convert arrow function or anonymous function";
|
||||
const refactorDescription = Diagnostics.Convert_arrow_function_or_anonymous_function.message;
|
||||
|
||||
const toAnonymousFunctionActionName = "Convert to anonymous function";
|
||||
const toNamedFunctionActionName = "Convert to named function";
|
||||
const toArrowFunctionActionName = "Convert to arrow function";
|
||||
|
||||
const toAnonymousFunctionActionDescription = Diagnostics.Convert_to_anonymous_function.message;
|
||||
const toNamedFunctionActionDescription = Diagnostics.Convert_to_named_function.message;
|
||||
const toArrowFunctionActionDescription = Diagnostics.Convert_to_arrow_function.message;
|
||||
|
||||
registerRefactor(refactorName, { getEditsForAction, getAvailableActions });
|
||||
|
||||
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined {
|
||||
return [{
|
||||
name: refactorName,
|
||||
description: refactorDescription,
|
||||
actions: [
|
||||
{
|
||||
name: toAnonymousFunctionActionName,
|
||||
description: toAnonymousFunctionActionDescription
|
||||
},
|
||||
{
|
||||
name: toNamedFunctionActionName,
|
||||
description: toNamedFunctionActionDescription
|
||||
},
|
||||
{
|
||||
name: toArrowFunctionActionName,
|
||||
description: toArrowFunctionActionDescription
|
||||
}
|
||||
]
|
||||
}];
|
||||
}
|
||||
|
||||
function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,6 +80,7 @@
|
||||
"refactors/generateGetAccessorAndSetAccessor.ts",
|
||||
"refactors/moveToNewFile.ts",
|
||||
"refactors/addOrRemoveBracesToArrowFunction.ts",
|
||||
"refactors/convertArrowFunctionOrFunction.ts",
|
||||
"services.ts",
|
||||
"breakpoints.ts",
|
||||
"transform.ts",
|
||||
|
||||
Reference in New Issue
Block a user