Cleaned up commnts and added notify events back

This commit is contained in:
Harrison Cramer
2023-04-25 20:41:04 -04:00
parent 1ce0c56121
commit 55d7bf2d21
2 changed files with 10 additions and 10 deletions

View File

@@ -111,7 +111,10 @@ func getMRVersions(projectId string, mergeId int) (e error, response *http.Respo
return nil, response
}
/* Creates a new merge request discussion https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-thread */
/*
Creates a new merge request discussion https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-thread
The go-gitlab client was not working for this API specifically 😢
*/
func (c *Client) CommentOnDeletion(lineNumber string, fileName string, comment string, diffVersionInfo MRVersion, i int) (*http.Response, error) {
deletionDiscussionUrl := fmt.Sprintf("https://gitlab.com/api/v4/projects/%s/merge_requests/%d/discussions", c.projectId, c.mergeId)
@@ -126,7 +129,6 @@ func (c *Client) CommentOnDeletion(lineNumber string, fileName string, comment s
/* We need to set these properties differently depending on whether we're commenting on a deleted line,
a modified line, an added line, or an unmodified line */
_ = writer.WriteField("position[old_path]", fileName)
_ = writer.WriteField("position[new_path]", fileName)
if i == 0 {

View File

@@ -153,17 +153,15 @@ local function darken_metadata(bufnr, regex)
end
local function print_success(_, line)
print(line)
-- if line ~= nil and line ~= "" then
-- notify(line, "info")
-- end
if line ~= nil and line ~= "" then
notify(line, "info")
end
end
local function print_error(_, line)
print(line)
-- if line ~= nil and line ~= "" then
-- notify(line, "error")
-- end
if line ~= nil and line ~= "" then
notify(line, "error")
end
end
local function exit(popup)