From 4f98d5565b416f71d605cafcb22bd76cf697fd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 11 Apr 2022 17:16:57 +0800 Subject: fix #1035 --- script/core/code-action.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'script/core') diff --git a/script/core/code-action.lua b/script/core/code-action.lua index 4b1ebd57..6bba0a82 100644 --- a/script/core/code-action.lua +++ b/script/core/code-action.lua @@ -415,6 +415,12 @@ local function checkSwapParams(results, uri, start, finish) elseif source.type == 'funcargs' then local var = source.parent.parent if guide.isSet(var) then + if var.type == 'tablefield' then + var = var.field + end + if var.type == 'tableindex' then + var = var.index + end node = text:sub( guide.positionToOffset(state, var.start) + 1, guide.positionToOffset(state, var.finish) -- cgit v1.2.3