summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-17 04:50:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-17 04:50:21 +0800
commit66de37c58ee8cfb336b8f3d17f97d7f05f210f6d (patch)
tree5ef5e6615ba9623b260cdeea52413329af65859d /script
parenta988a48919dd752b04ec692d90e942ba21e9f62f (diff)
downloadlua-language-server-66de37c58ee8cfb336b8f3d17f97d7f05f210f6d.zip
cleanup
Diffstat (limited to 'script')
-rw-r--r--script/core/completion/completion.lua6
-rw-r--r--script/parser/guide.lua2
-rw-r--r--script/vm/local-manager.lua40
-rw-r--r--script/vm/manager.lua3
4 files changed, 0 insertions, 51 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index beff594c..70e093df 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -186,9 +186,6 @@ local function buildFunctionSnip(source, value, oop)
end
local function buildDetail(source)
- if source.type == 'dummy' then
- return
- end
local types = infer.getInfer(source):view()
local literals = infer.getInfer(source):viewLiterals()
if literals then
@@ -228,9 +225,6 @@ end
---@async
local function buildDesc(source)
- if source.type == 'dummy' then
- return
- end
local desc = markdown()
local hover = getHover.get(source)
desc:add('md', hover)
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 0ece65fc..906a9926 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -1027,8 +1027,6 @@ function m.getKeyType(obj)
return type(obj.field[1])
elseif tp == 'doc.type.field' then
return type(obj.name[1])
- elseif tp == 'dummy' then
- return 'string'
end
if tp == 'doc.field.name' then
return type(obj[1])
diff --git a/script/vm/local-manager.lua b/script/vm/local-manager.lua
deleted file mode 100644
index 51bafb24..00000000
--- a/script/vm/local-manager.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-local util = require 'utility'
-local guide = require 'parser.guide'
-
----@class vm.local-node
-local m = {}
----@type table<uri, parser.object[]>
-m.locals = util.multiTable(2)
----@type table<parser.object, table<parser.object, boolean>>
-m.localSubs = util.multiTable(2, function ()
- return setmetatable({}, util.MODE_K)
-end)
----@type table<parser.object, boolean>
-m.allLocals = {}
-
----@param source parser.object
-function m.declareLocal(source)
- if m.allLocals[source] then
- return
- end
- m.allLocals[source] = true
- local uri = guide.getUri(source)
- local locals = m.locals[uri]
- locals[#locals+1] = source
-end
-
----@param uri uri
-function m.dropUri(uri)
- local locals = m.locals[uri]
- m.locals[uri] = nil
- for _, loc in ipairs(locals) do
- m.allLocals[loc] = nil
- local localSubs = m.localSubs[loc]
- m.localSubs[loc] = nil
- for source in pairs(localSubs) do
- source._node = nil
- end
- end
-end
-
-return m
diff --git a/script/vm/manager.lua b/script/vm/manager.lua
index b5c37c35..c75b777f 100644
--- a/script/vm/manager.lua
+++ b/script/vm/manager.lua
@@ -1,7 +1,6 @@
local files = require 'files'
local globalManager = require 'vm.global-manager'
-local localManager = require 'vm.local-manager'
---@alias vm.object parser.object | vm.global | vm.generic
@@ -17,7 +16,6 @@ end
files.watch(function (ev, uri)
if ev == 'update' then
globalManager.dropUri(uri)
- localManager.dropUri(uri)
local state = files.getState(uri)
if state then
globalManager.compileAst(state.ast)
@@ -25,7 +23,6 @@ files.watch(function (ev, uri)
end
if ev == 'remove' then
globalManager.dropUri(uri)
- localManager.dropUri(uri)
end
end)