From 4aa6774eb322be64db441db1153326f180c8ff6a Mon Sep 17 00:00:00 2001 From: sumneko Date: Fri, 19 Apr 2019 11:44:20 +0800 Subject: =?UTF-8?q?class=E7=9A=84=E8=87=AA=E5=8A=A8=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/implementation.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'server/src/core/implementation.lua') 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 -- cgit v1.2.3