This MR is a #MAJOR breaking change to the plugin. While the plugin will continue to work for users with their existing settings, they will be informed of outdated configuration (diagnostics and signs have been simplified) the next time they open the reviewer. Fix: Trim trailing slash from custom URLs Update: .github/CONTRIBUTING.md, .github/ISSUE_TEMPLATE/bug_report.md Feat: Improve discussion tree toggling (#192) Fix: Toggle modified notes (#188) Fix: Toggle discussion nodes correctly Feat: Show Help keymap in discussion tree winbar Fix: Enable toggling nodes from the note body Fix: Enable toggling resolved status from child nodes Fix: Only try to show emoji popup on note nodes Feat: Add keymap for toggling tree type Fix: Disable tree type toggling in Notes Fix Multi Line Issues (Large Refactor) (#197) Fix: Multi-line discussions. The calculation of a range for a multiline comment has been consolidated and moved into the location.lua file. This does not attempt to fix diagnostics. Refactor: It refactors the discussions code to split hunk parsing and management into a separate module Fix: Don't allow comments on modified buffers #194 by preventing comments on the reviewer when using --imply-local and when the working tree is dirty entirely. Refactor: It introduces a new List class for data aggregation, filtering, etc. Fix: It removes redundant API calls and refreshes from the discussion pane Fix: Location provider (#198) Fix: add nil check for Diffview performance issue (#199) Fix: Switch Tabs During Comment Creation (#200) Fix: Check if file is modified (#201) Fix: Off-By-One Issue in Old SHA (#202) Fix: Rebuild Diagnostics + Signs (#203) Fix: Off-By-One Issue in New SHA (#205) Fix: Reviewer Jumps to wrong location (#206) BREAKING CHANGE: Changes configuration of diagnostics and signs in the setup call.
77 lines
3.6 KiB
Lua
77 lines
3.6 KiB
Lua
require("gitlab.utils.list")
|
|
local u = require("gitlab.utils")
|
|
local async = require("gitlab.async")
|
|
local server = require("gitlab.server")
|
|
local emoji = require("gitlab.emoji")
|
|
local state = require("gitlab.state")
|
|
local reviewer = require("gitlab.reviewer")
|
|
local discussions = require("gitlab.actions.discussions")
|
|
local merge = require("gitlab.actions.merge")
|
|
local summary = require("gitlab.actions.summary")
|
|
local assignees_and_reviewers = require("gitlab.actions.assignees_and_reviewers")
|
|
local comment = require("gitlab.actions.comment")
|
|
local pipeline = require("gitlab.actions.pipeline")
|
|
local create_mr = require("gitlab.actions.create_mr")
|
|
local approvals = require("gitlab.actions.approvals")
|
|
local labels = require("gitlab.actions.labels")
|
|
|
|
local user = state.dependencies.user
|
|
local info = state.dependencies.info
|
|
local labels_dep = state.dependencies.labels
|
|
local project_members = state.dependencies.project_members
|
|
local revisions = state.dependencies.revisions
|
|
|
|
return {
|
|
setup = function(args)
|
|
if args == nil then
|
|
args = {}
|
|
end
|
|
server.build() -- Builds the Go binary if it doesn't exist
|
|
state.merge_settings(args) -- Sets keymaps and other settings from setup function
|
|
require("gitlab.colors") -- Sets colors
|
|
reviewer.init()
|
|
discussions.initialize_discussions() -- place signs / diagnostics for discussions in reviewer
|
|
emoji.init() -- Read in emojis for lookup purposes
|
|
end,
|
|
-- Global Actions 🌎
|
|
summary = async.sequence({ u.merge(info, { refresh = true }), labels_dep }, summary.summary),
|
|
approve = async.sequence({ info }, approvals.approve),
|
|
revoke = async.sequence({ info }, approvals.revoke),
|
|
add_reviewer = async.sequence({ info, project_members }, assignees_and_reviewers.add_reviewer),
|
|
delete_reviewer = async.sequence({ info, project_members }, assignees_and_reviewers.delete_reviewer),
|
|
add_label = async.sequence({ info, labels_dep }, labels.add_label),
|
|
delete_label = async.sequence({ info, labels_dep }, labels.delete_label),
|
|
add_assignee = async.sequence({ info, project_members }, assignees_and_reviewers.add_assignee),
|
|
delete_assignee = async.sequence({ info, project_members }, assignees_and_reviewers.delete_assignee),
|
|
create_comment = async.sequence({ info, revisions }, comment.create_comment),
|
|
create_multiline_comment = async.sequence({ info, revisions }, comment.create_multiline_comment),
|
|
create_comment_suggestion = async.sequence({ info, revisions }, comment.create_comment_suggestion),
|
|
move_to_discussion_tree_from_diagnostic = async.sequence({}, discussions.move_to_discussion_tree),
|
|
create_note = async.sequence({ info }, comment.create_note),
|
|
create_mr = async.sequence({}, create_mr.start),
|
|
review = async.sequence({ u.merge(info, { refresh = true }), revisions, user }, function()
|
|
reviewer.open()
|
|
end),
|
|
close_review = function()
|
|
reviewer.close()
|
|
end,
|
|
pipeline = async.sequence({ info }, pipeline.open),
|
|
merge = async.sequence({ u.merge(info, { refresh = true }) }, merge.merge),
|
|
-- Discussion Tree Actions 🌴
|
|
toggle_discussions = async.sequence({ info, user }, discussions.toggle),
|
|
edit_comment = async.sequence({ info }, discussions.edit_comment),
|
|
delete_comment = async.sequence({ info }, discussions.delete_comment),
|
|
toggle_resolved = async.sequence({ info }, discussions.toggle_discussion_resolved),
|
|
reply = async.sequence({ info }, discussions.reply),
|
|
-- Other functions 🤷
|
|
state = state,
|
|
print_settings = state.print_settings,
|
|
open_in_browser = async.sequence({ info }, function()
|
|
if state.INFO.web_url == nil then
|
|
u.notify("Could not get Gitlab URL", vim.log.levels.ERROR)
|
|
return
|
|
end
|
|
u.open_in_browser(state.INFO.web_url)
|
|
end),
|
|
}
|