From 85a3fe068c572f6b3487c40cc3e962687c8998a7 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 27 Aug 2024 22:03:10 +0200 Subject: reorder early initialization code --- init.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'init.lua') 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 . -- -- 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 = {} -- cgit v1.2.3