From 7e4ca89198ff641a841c49b506243615dfcbcba9 Mon Sep 17 00:00:00 2001 From: Harrison Cramer Date: Fri, 11 Aug 2023 21:01:49 -0400 Subject: [PATCH] Expose state for debugging purposes This should hopefully make it easier to debug and for users to figure out what's going on by exposing the state of the plugin. It is a Lua table, and can be seen via `:lua print(require("gitlab").state)` The easiest way to print out a Lua table is with some sort of utility function like this: ``` function printTable(...) local objects = {} for i = 1, select("#", ...) do local v = select(i, ...) table.insert(objects, vim.inspect(v)) end print(table.concat(objects, "\n")) return ... end ``` --- lua/gitlab/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/gitlab/init.lua b/lua/gitlab/init.lua index 690319f..f99d6b0 100644 --- a/lua/gitlab/init.lua +++ b/lua/gitlab/init.lua @@ -17,6 +17,7 @@ M.list_discussions = discussions.list_discussions M.edit_comment = comment.edit_comment M.delete_comment = comment.delete_comment M.reply = discussions.reply +M.state = state -- Builds the binary (if not built); starts the Go server; calls the /info endpoint, -- which sets the Gitlab project's information in gitlab.nvim's INFO module