Skip to content

Commit

Permalink
refactor: move terminator to mason-core
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman committed Dec 5, 2022
1 parent 44c7daa commit 2399d3d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lua/mason-core/package/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ function Package:new_handle()
local handle = InstallationHandle.new(self)
self.handle = handle

require("mason.terminator").register(handle)
-- Ideally we'd decouple this and leverage Mason's event system, but to allow loading as little as possible during
-- setup (i.e. not load modules related to Mason's event system) of the mason.nvim plugin we explicitly call into
-- terminator here.
require("mason-core.terminator").register(handle)

self:emit("handle", handle)
registry:emit("package:handle", self, handle)

Expand Down
1 change: 0 additions & 1 deletion lua/mason/terminator.lua → lua/mason-core/terminator.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local registry = require "mason-registry"
local a = require "mason-core.async"

-- Hasta la vista, baby.
Expand Down
2 changes: 1 addition & 1 deletion lua/mason/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local M = {}
local function setup_autocmds()
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function()
require("mason.terminator").terminate(5000)
require("mason-core.terminator").terminate(5000)
end,
once = true,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local match = require "luassert.match"
local spy = require "luassert.spy"
local a = require "mason-core.async"
local registry = require "mason-registry"
local terminator = require "mason.terminator"
local terminator = require "mason-core.terminator"
local _ = require "mason-core.functional"
local InstallHandle = require "mason-core.installer.handle"

Expand Down

0 comments on commit 2399d3d

Please sign in to comment.