We weren't writing a 200 status code post-delete because Gitlab returns
a 204 (empty but successful) by default. I updated this logic to change
that and also to refresh the tree.
The collapsed state of the tree will be wiped out if you delete a
bottom-level discussion but that's okay for now, not a high priority
right now.
We want to pick the note ID more carefully for deletion.
If it's the root node (aka the first comment in a discussion thread) then
we want to choose the root_note_id since that is the ID of the first
comment in the discussion. Otherwise, we want to choose the note_node
ID.
* Changed to relative time
* Added days
* Updated display of discussion tree
* Updated a lot of functionality + behaviors for discussions + comments
* Modified state on deletion/creation
* Fixed relative times
This MR improves the configurability of the plugin by using Nui's split
system rather than managing the splits ourselves. This lets the user
configure both the positioning of the discussion tree and it's width,
and reduces overall maintenance of split management for the plugin.
This ensures that the state for the plugin has been initialized prior to
calling any of the other jobs. This ensures that they won't error if
called quickly after Neovim starts up
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 MR makes several major tweaks to the codebase. Primarily it adjusts
the setup steps for the application so that rather than providing just
the project ID in the `.gitlab.nvim` file, users can also provide a
vareity of other settings, such as auth_token, base_branch, and so
forth. This is to make the project more extensible in the future.
This MR also fixes a variety of issues with error handling in the code,
primarily in the request/response model between the Lua jobs and the
Golang server.
BREAKING CHANGE: Modifies `.gitlab.nvim` and setup steps
This commit changes the filter on the API response so that we are only
filtering out system level notes. This means we get notes that are not
linked to specific locations in the code.
Subsequent work will have to separate these types of notes from the
other code-linked notes and probably display them in some sort of
separate tree.