From 7a90b6d37c1bcf43cf0e532c098d0b38aa02cdc5 Mon Sep 17 00:00:00 2001 From: TheLeoP Date: Fri, 26 Jul 2024 15:37:20 -0500 Subject: [PATCH] fix(jsx/tsx): correctly inline function call --- lua/refactoring/refactor/106.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/refactoring/refactor/106.lua b/lua/refactoring/refactor/106.lua index 8d0b8a4a..87aef8a1 100644 --- a/lua/refactoring/refactor/106.lua +++ b/lua/refactoring/refactor/106.lua @@ -476,11 +476,15 @@ local function extract_setup(refactor) -- C# parser parses expresions without a surrounding scope as childs of the -- `global_statement` node, so it's imposibble to match them against -- non-global statements + -- + -- TSX/JSX parser parses isolated tags as having an expression parent local number_of_function_calls = 0 if not has_error and refactor.filetype ~= "php" and refactor.filetype ~= "cs" + and refactor.filetype ~= "typescriptreact" + and refactor.filetype ~= "javascriptreact" then --- @type string[] local body_sexprs = {}