add skeleton

This commit is contained in:
BigAru
2018-10-31 14:27:36 +01:00
parent dce6668070
commit 8cb019d793
3 changed files with 59 additions and 1 deletions
+17 -1
View File
@@ -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;
}
}
+1
View File
@@ -80,6 +80,7 @@
"refactors/generateGetAccessorAndSetAccessor.ts",
"refactors/moveToNewFile.ts",
"refactors/addOrRemoveBracesToArrowFunction.ts",
"refactors/convertArrowFunctionOrFunction.ts",
"services.ts",
"breakpoints.ts",
"transform.ts",