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
```
This commit is contained in:
Harrison Cramer
2023-08-11 21:01:49 -04:00
parent 3d3bb764ba
commit 7e4ca89198

View File

@@ -17,6 +17,7 @@ M.list_discussions = discussions.list_discussions
M.edit_comment = comment.edit_comment M.edit_comment = comment.edit_comment
M.delete_comment = comment.delete_comment M.delete_comment = comment.delete_comment
M.reply = discussions.reply M.reply = discussions.reply
M.state = state
-- Builds the binary (if not built); starts the Go server; calls the /info endpoint, -- 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 -- which sets the Gitlab project's information in gitlab.nvim's INFO module