codemp-nvim/lua/codemp/client.lua

18 lines
644 B
Lua
Raw Normal View History

2024-08-24 01:57:00 +02:00
local native = require("codemp.loader").load()
local window = require("codemp.window")
local session = require("codemp.session")
local workspace = require("codemp.workspace")
local function connect(host, username, password)
if host == nil then host = 'http://codemp.dev:50053' end
if username == nil then username = vim.g.codemp_username or vim.fn.input("username > ", "") end
if password == nil then password = vim.g.codemp_password or vim.fn.input("password > ", "") end
2024-09-01 03:06:27 +02:00
session.client = native.connect(host, username, password):await()
window.update()
vim.schedule(function () workspace.list() end)
2024-08-24 01:57:00 +02:00
end
return {
connect = connect
}