summaryrefslogtreecommitdiff
path: root/server-beta/src/core/hover/name.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-21 20:06:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-21 20:06:20 +0800
commitbafe0e44914ad3b669388b94b91d9992edeb8e07 (patch)
tree26f78a3934dc38d31f82bbf9b33975dfecb3a0d8 /server-beta/src/core/hover/name.lua
parentc354b5e8bd05ba117857ac93e8d647980875d98d (diff)
downloadlua-language-server-bafe0e44914ad3b669388b94b91d9992edeb8e07.zip
hover的第一步
Diffstat (limited to 'server-beta/src/core/hover/name.lua')
-rw-r--r--server-beta/src/core/hover/name.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/server-beta/src/core/hover/name.lua b/server-beta/src/core/hover/name.lua
new file mode 100644
index 00000000..d0caf885
--- /dev/null
+++ b/server-beta/src/core/hover/name.lua
@@ -0,0 +1,16 @@
+local function asLocal(source)
+ return source[1]
+end
+
+return function (source)
+ local parent = source.parent
+ if not parent then
+ return ''
+ end
+ if parent.type == 'local'
+ or parent.type == 'getlocal'
+ or parent.type == 'setlocal' then
+ return asLocal(parent)
+ end
+ return ''
+end