mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:55:10 -05:00
convertFunctionToEs6Class: Bail if this is not a JavaScript file (#17149)
This commit is contained in:
@@ -12,7 +12,11 @@ namespace ts.refactor {
|
||||
|
||||
registerRefactor(convertFunctionToES6Class);
|
||||
|
||||
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] {
|
||||
function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined {
|
||||
if (!isInJavaScriptFile(context.file)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const start = context.startPosition;
|
||||
const node = getTokenAtPosition(context.file, start, /*includeJsDocComment*/ false);
|
||||
const checker = context.program.getTypeChecker();
|
||||
|
||||
Reference in New Issue
Block a user