aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-08-27 22:03:10 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2024-08-27 22:16:14 +0200
commit85a3fe068c572f6b3487c40cc3e962687c8998a7 (patch)
treedefa3ef0ad0db92b6334a8a2cde857d13c5636e7
parentfdc6e201533c4d2e0409dbda4ebedbf625ac0c63 (diff)
downloadvis-lspc-85a3fe068c572f6b3487c40cc3e962687c8998a7.tar.gz
vis-lspc-85a3fe068c572f6b3487c40cc3e962687c8998a7.zip
reorder early initialization code
-rw-r--r--init.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 8a7790e..6d501d0 100644
--- a/init.lua
+++ b/init.lua
@@ -1,4 +1,4 @@
--- Copyright (c) 2021-2023 Florian Fischer. All rights reserved.
+-- Copyright (c) 2021-2024 Florian Fischer. All rights reserved.
--
-- This file is part of vis-lspc.
--
@@ -15,19 +15,20 @@
-- vis-lspc found in the LICENSE file. If not, see <https://www.gnu.org/licenses/>.
--
-- We require vis compiled with the communicate patch
-local source_str = debug.getinfo(1, 'S').source:sub(2)
-local source_path = source_str:match('(.*/)')
-
-local parser = dofile(source_path .. 'parser.lua')
-
if not vis.communicate then
vis:info('LSPC Error: language server support requires vis communicate patch')
return {}
end
+local source_str = debug.getinfo(1, 'S').source:sub(2)
+local source_path = source_str:match('(.*/)')
+
-- state of our language server client
local lspc = dofile(source_path .. 'lspc.lua')
+local parser = dofile(source_path .. 'parser.lua')
+
+-- load a suitable json module
lspc.json = dofile(source_path .. 'json.lua')
local jsonrpc = {}