summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-04 20:59:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-04 20:59:09 +0800
commit74c45cc113e0f6cc1bb0bbf4963c490312cbfbe2 (patch)
tree093cf553943d2bcd94afaf559b53bab381323a05 /script/core
parente1acf151c0da1aa01c39d10d0fab885f4c98f6cd (diff)
parentdb575065af7c0fab76f6d3d7964ae84244757c91 (diff)
downloadlua-language-server-74c45cc113e0f6cc1bb0bbf4963c490312cbfbe2.zip
Merge commit 'db575065af7c0fab76f6d3d7964ae84244757c91' into multi-workspace
Diffstat (limited to 'script/core')
-rw-r--r--script/core/highlight.lua2
-rw-r--r--script/core/rename.lua10
2 files changed, 2 insertions, 10 deletions
diff --git a/script/core/highlight.lua b/script/core/highlight.lua
index 02f3c07f..bbfd1504 100644
--- a/script/core/highlight.lua
+++ b/script/core/highlight.lua
@@ -348,7 +348,7 @@ return function (uri, offset)
results[#results+1] = {
start = start,
finish = finish,
- kind = define.DocumentHighlightKind.Write
+ kind = define.DocumentHighlightKind.Text
}
end)
diff --git a/script/core/rename.lua b/script/core/rename.lua
index 0c48dbc4..d90a49bb 100644
--- a/script/core/rename.lua
+++ b/script/core/rename.lua
@@ -183,14 +183,7 @@ end
local function ofField(source, newname, callback)
local key = guide.getKeyName(source)
- local node
- if source.type == 'tablefield'
- or source.type == 'tableindex' then
- node = source.parent
- else
- node = source.node
- end
- for _, src in ipairs(vm.getAllRefs(node, '*')) do
+ for _, src in ipairs(vm.getAllRefs(source)) do
ofFieldThen(key, src, newname, callback)
end
end
@@ -276,7 +269,6 @@ local function rename(source, newname, callback)
return ofField(parent, newname, callback)
end
end
- return
end
local function prepareRename(source)