summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-03-21 17:21:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-03-21 17:21:34 +0800
commiteef0f61c8ee023550d4de3bcad0c5e2b8a16be07 (patch)
tree0aca16a8190f5b4cd4bbde460110a551ab2d6082 /script/core
parent3b13f002fa99ebf1eb50734019c3efcb56bf31a2 (diff)
downloadlua-language-server-eef0f61c8ee023550d4de3bcad0c5e2b8a16be07.zip
当客户端为vscode时,使用本地文档
Diffstat (limited to 'script/core')
-rw-r--r--script/core/hover/lib_function.lua36
1 files changed, 26 insertions, 10 deletions
diff --git a/script/core/hover/lib_function.lua b/script/core/hover/lib_function.lua
index 06087312..92e6a34f 100644
--- a/script/core/hover/lib_function.lua
+++ b/script/core/hover/lib_function.lua
@@ -1,5 +1,7 @@
local lang = require 'language'
local config = require 'config'
+local client = require 'client'
+
local function buildLibArgs(lib, object, select)
if not lib.args then
return ''
@@ -188,16 +190,30 @@ local function buildDoc(lib)
return lang.script(lib.web, doc)
end
local version = config.config.runtime.version
- if version == 'Lua 5.1' then
- return lang.script('HOVER_DOCUMENT_LUA51', doc)
- elseif version == 'Lua 5.2' then
- return lang.script('HOVER_DOCUMENT_LUA52', doc)
- elseif version == 'Lua 5.3' then
- return lang.script('HOVER_DOCUMENT_LUA53', doc)
- elseif version == 'Lua 5.4' then
- return lang.script('HOVER_DOCUMENT_LUA54', doc)
- elseif version == 'LuaJIT' then
- return lang.script('HOVER_DOCUMENT_LUAJIT', doc)
+ if client.client() == 'vscode' then
+ if version == 'Lua 5.1' then
+ return lang.script('HOVER_NATIVE_DOCUMENT_LUA51', doc)
+ elseif version == 'Lua 5.2' then
+ return lang.script('HOVER_NATIVE_DOCUMENT_LUA52', doc)
+ elseif version == 'Lua 5.3' then
+ return lang.script('HOVER_NATIVE_DOCUMENT_LUA53', doc)
+ elseif version == 'Lua 5.4' then
+ return lang.script('HOVER_NATIVE_DOCUMENT_LUA54', doc)
+ elseif version == 'LuaJIT' then
+ return lang.script('HOVER_NATIVE_DOCUMENT_LUAJIT', doc)
+ end
+ else
+ if version == 'Lua 5.1' then
+ return lang.script('HOVER_DOCUMENT_LUA51', doc)
+ elseif version == 'Lua 5.2' then
+ return lang.script('HOVER_DOCUMENT_LUA52', doc)
+ elseif version == 'Lua 5.3' then
+ return lang.script('HOVER_DOCUMENT_LUA53', doc)
+ elseif version == 'Lua 5.4' then
+ return lang.script('HOVER_DOCUMENT_LUA54', doc)
+ elseif version == 'LuaJIT' then
+ return lang.script('HOVER_DOCUMENT_LUAJIT', doc)
+ end
end
end