summaryrefslogtreecommitdiff
path: root/server-beta/src/brave/work.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-22 23:26:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-22 23:26:32 +0800
commitd0ff66c9abe9d6abbca12fd811e0c3cb69c1033a (patch)
treebb34518d70b85de7656dbdbe958dfa221a3ff3b3 /server-beta/src/brave/work.lua
parent0a2c2ad15e1ec359171fb0dd4c72e57c5b66e9ba (diff)
downloadlua-language-server-d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a.zip
整理一下目录结构
Diffstat (limited to 'server-beta/src/brave/work.lua')
-rw-r--r--server-beta/src/brave/work.lua55
1 files changed, 0 insertions, 55 deletions
diff --git a/server-beta/src/brave/work.lua b/server-beta/src/brave/work.lua
deleted file mode 100644
index dba27808..00000000
--- a/server-beta/src/brave/work.lua
+++ /dev/null
@@ -1,55 +0,0 @@
-local brave = require 'brave.brave'
-local jsonrpc = require 'jsonrpc'
-local parser = require 'parser'
-local fs = require 'bee.filesystem'
-local furi = require 'file-uri'
-local util = require 'utility'
-
-brave.on('loadProto', function ()
- while true do
- local proto = jsonrpc.decode(io.read, log.error)
- if proto then
- brave.push('proto', proto)
- end
- end
-end)
-
-brave.on('compile', function (text)
- local state, err = parser:compile(text, 'lua', 'Lua 5.4')
- if not state then
- log.error(err)
- return
- end
- local lines = parser:lines(text)
- return {
- root = state.root,
- value = state.value,
- errs = state.errs,
- lines = lines,
- }
-end)
-
-brave.on('listDirectory', function (uri)
- local path = fs.path(furi.decode(uri))
- local uris = {}
- for child in path:list_directory() do
- local childUri = furi.encode(child:string())
- uris[#uris+1] = childUri
- end
- return uris
-end)
-
-brave.on('isDirectory', function (uri)
- local path = fs.path(furi.decode(uri))
- return fs.is_directory(path)
-end)
-
-brave.on('loadFile', function (uri)
- local filename = furi.decode(uri)
- return util.loadFile(filename)
-end)
-
-brave.on('saveFile', function (params)
- local filename = furi.decode(params.uri)
- return util.saveFile(filename, params.text)
-end)