diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-19 11:44:20 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-19 11:44:20 +0800 |
commit | 4aa6774eb322be64db441db1153326f180c8ff6a (patch) | |
tree | b091ef53fbd69f6d4557094d99ee2618601df451 /server/src/core/implementation.lua | |
parent | 1a889f53a34fdb2ae77bfe7189a5e00a2e723187 (diff) | |
download | lua-language-server-4aa6774eb322be64db441db1153326f180c8ff6a.zip |
class的自动完成
Diffstat (limited to 'server/src/core/implementation.lua')
-rw-r--r-- | server/src/core/implementation.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/src/core/implementation.lua b/server/src/core/implementation.lua index 1b8006b1..450b9a0c 100644 --- a/server/src/core/implementation.lua +++ b/server/src/core/implementation.lua @@ -166,6 +166,20 @@ local function jumpUri(vm, source, lsp) return positions end +local function parseClass(vm, source) + local className = source:get 'target class' + local positions = {} + vm.emmyMgr:eachClass(className, function (class) + local src = class:getSource() + positions[#positions+1] = { + src.start, + src.finish, + src.uri, + } + end) + return positions +end + return function (vm, source, lsp) if not source then return nil @@ -180,4 +194,11 @@ return function (vm, source, lsp) if source:get 'target uri' then return jumpUri(vm, source, lsp) end + if source:get 'in index' then + return parseValue(vm, source, lsp) + or parseValueSimily(vm, source, lsp) + end + if source:get 'target class' then + return parseClass(vm, source) + end end |