Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 57b50d1

Browse files
authored
fix(core): Address issues in transition from packer to lazy.nvim (#421)
Co-authored-by: Benjamin Valpey <bavalpey@users.noreply.github.com>
1 parent 5038823 commit 57b50d1

File tree

13 files changed

+72
-39
lines changed

13 files changed

+72
-39
lines changed

lua/doom/core/functions.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,28 +257,28 @@ end
257257
functions.nuke = function(target)
258258
if target == nil or #target == 0 then
259259
vim.notify(
260-
"Warning, this command deletes packer caches and causes a re-install of doom-nvim on next launch.\n\n :DoomNuke plugins|cache|mason|all. \n\t `cache` - Clear packer_compiled.lua\n\t `plugins` - Clear all installed plugins\n\t `mason` - Clear all Mason.nvim packages\n\t `all` - Delete all of the above."
260+
"Warning, this command deletes lazy caches and causes a re-install of doom-nvim on next launch.\n\n :DoomNuke plugins|cache|mason|all. \n\t `cache` - Clear lazy.lua\n\t `plugins` - Clear all installed plugins\n\t `mason` - Clear all Mason.nvim packages\n\t `all` - Delete all of the above."
261261
)
262262
return
263263
end
264264

265265
local log = require("doom.utils.logging")
266-
-- Delete packer compiled
266+
-- Delete lazy compiled
267267
if target == "all" or target == "cache" then
268268
os.remove(system.doom_compile_path)
269-
log.info("DoomNuke: Deleting packer compiled.")
269+
log.info("DoomNuke: Deleting lazy compiled.")
270270
end
271271

272272
if target == "all" or target == "plugins" then
273273
-- Delete all plugins
274-
local util = require("packer.util")
274+
local util = require("lazy.util")
275275
local plugin_dir = util.join_paths(vim.fn.stdpath("data"), "site", "pack")
276276
fs.rm_dir(plugin_dir)
277-
log.info("DoomNuke: Deleting packer plugins. Doom-nvim will re-install on next launch.")
277+
log.info("DoomNuke: Deleting lazy plugins. Doom-nvim will re-install on next launch.")
278278
end
279279

280280
if target == "all" or target == "mason" then
281-
local util = require("packer.util")
281+
local util = require("lazy.util")
282282
local mason_dir = util.join_paths(vim.fn.stdpath("data"), "mason")
283283
fs.rm_dir(mason_dir)
284284
log.info("DoomNuke: Deleting mason packages")

lua/doom/core/modules.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ modules.load_modules = function()
8989
end
9090

9191
-- Only pin dependencies if doom.freeze_dependencies is true
92-
spec.lock = spec.commit and doom.freeze_dependencies
92+
spec.pin = spec.commit and doom.freeze_dependencies
9393

9494
-- Save module spec to be initialised later
9595
table.insert(doom.packages, spec)

lua/doom/modules/core/doom/init.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,11 @@ required.binds = function()
142142
{ "r", "<cmd>DoomRollback<CR>", name = "Rollback" },
143143
{ "R", "<cmd>DoomReport<CR>", name = "Report issue" },
144144
{ "u", "<cmd>DoomUpdate<CR>", name = "Update" },
145-
{ "s", "<cmd>PackerSync<CR>", name = "Sync packages" },
146-
{ "I", "<cmd>PackerInstall<CR>", name = "Install packages" },
147-
{ "C", "<cmd>PackerClean<CR>", name = "Clean packages" },
148-
{ "b", "<cmd>PackerCompile<CR>", name = "Build packages" },
149-
{ "S", "<cmd>PackerStatus<CR>", name = "Inform packages" },
150-
{ "p", "<cmd>PackerProfile<CR>", name = "Profile" },
145+
{ "s", "<cmd>Lazy sync<CR>", name = "Sync packages" },
146+
{ "I", "<cmd>Lazy install<CR>", name = "Install packages" },
147+
{ "C", "<cmd>Lazy clean<CR>", name = "Clean packages" },
148+
-- { "b", "<cmd>Lazy build<CR>", name = "Build packages" },
149+
{ "p", "<cmd>Lazy profile<CR>", name = "Profile" },
151150
},
152151
},
153152
{

lua/doom/modules/core/reloader/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ reloader._reload_doom = function()
125125
if needs_install then
126126
if not _G._doom_reloader._has_shown_packer_compile_message then
127127
log.warn(
128-
"reloader: You will have to run `:PackerCompile` before changes to plugin configs take effect."
128+
"reloader: You will have to run `:Lazy build` before changes to plugin configs take effect."
129129
)
130130
_G._doom_reloader._has_shown_packer_compile_message = true
131131
end
132132
else
133-
log.warn("reloader: Run `:PackerSync` to install and configure new plugins.")
133+
log.warn("reloader: Run `:Lazy sync` to install and configure new plugins.")
134134
end
135135

136136
vim.cmd("doautocmd VimEnter")
@@ -156,7 +156,7 @@ reloader.reload = function()
156156
end
157157

158158
reloader.settings = {
159-
reload_on_save = true,
159+
reload_on_save = false,
160160
}
161161
reloader.packages = {}
162162
reloader.configs = {}

lua/doom/modules/core/treesitter/init.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,19 @@ treesitter.packages = {
5656
["nvim-ts-context-commentstring"] = {
5757
"JoosepAlviste/nvim-ts-context-commentstring",
5858
commit = "4a42b30376c1bd625ab5016c2079631d531d797a",
59-
after = "nvim-treesitter",
59+
-- after = "nvim-treesitter",
60+
dependencies = {
61+
"nvim-treesitter/nvim-treesitter"
62+
},
6063
event = "VeryLazy",
6164
},
6265
["nvim-ts-autotag"] = {
6366
"windwp/nvim-ts-autotag",
6467
commit = "fdefe46c6807441460f11f11a167a2baf8e4534b",
65-
after = "nvim-treesitter",
68+
-- after = "nvim-treesitter",
69+
dependencies = {
70+
"nvim-treesitter/nvim-treesitter"
71+
},
6672
event = "VeryLazy",
6773
},
6874
}

lua/doom/modules/features/annotations/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ annotations.packages = {
2222
commit = "0958aeffcddf46e57785c3026be934816b4f39d2",
2323
keys = { "<leader>cg" },
2424
cmd = "Neogen",
25-
after = "nvim-treesitter",
25+
dependencies={
26+
"nvim-treesitter/nvim-treesitter"
27+
}
2628
},
2729
}
2830

lua/doom/modules/features/dap/init.lua

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ dap.settings = {
1515
edit = "e",
1616
repl = "r",
1717
},
18-
sidebar = {
18+
layouts = {
19+
{
1920
elements = {
2021
"scopes",
2122
"breakpoints",
@@ -24,13 +25,15 @@ dap.settings = {
2425
},
2526
size = 40,
2627
position = "left",
27-
},
28-
tray = {
29-
elements = {
30-
"repl",
3128
},
29+
{
30+
elements = {
31+
"repl",
32+
"console",
33+
},
3234
size = 10,
3335
position = "bottom",
36+
}
3437
},
3538
},
3639
}
@@ -43,7 +46,10 @@ dap.packages = {
4346
["nvim-dap-ui"] = {
4447
"rcarriga/nvim-dap-ui",
4548
commit = "b80227ea56a48177786904f6322abc8b2dc0bc36",
46-
after = { "nvim-dap" },
49+
dependencies = {
50+
"mfussenegger/nvim-dap",
51+
}
52+
-- after = { "nvim-dap" },
4753
},
4854
}
4955

lua/doom/modules/features/linter/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ linter.packages = {
1414
["null-ls.nvim"] = {
1515
"jose-elias-alvarez/null-ls.nvim",
1616
commit = "915558963709ea17c5aa246ca1c9786bfee6ddb4",
17-
after = "nvim-lspconfig",
17+
dependencies={"neovim/nvim-lspconfig"},
18+
-- after = "nvim-lspconfig",
1819
},
1920
}
2021

lua/doom/modules/features/lsp/init.lua

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,32 +114,48 @@ lsp.packages = {
114114
["cmp-nvim-lua"] = {
115115
"hrsh7th/cmp-nvim-lua",
116116
commit = "f3491638d123cfd2c8048aefaf66d246ff250ca6",
117-
after = "nvim-cmp",
117+
-- after = "nvim-cmp",
118+
dependencies = {
119+
"hrsh7th/nvim-cmp",
120+
}
118121
},
119122
["cmp-nvim-lsp"] = {
120123
"hrsh7th/cmp-nvim-lsp",
121-
commit = "59224771f91b86d1de12570b4070fe4ad7cd1eeb",
122-
after = "nvim-cmp",
124+
-- after = "nvim-cmp",
125+
dependencies = {
126+
"hrsh7th/nvim-cmp",
127+
}
123128
},
124129
["cmp-path"] = {
125130
"hrsh7th/cmp-path",
126-
commit = "91ff86cd9c29299a64f968ebb45846c485725f23",
127-
after = "nvim-cmp",
131+
-- after = "nvim-cmp",
132+
dependencies = {
133+
"hrsh7th/nvim-cmp",
134+
}
128135
},
129136
["cmp-buffer"] = {
130137
"hrsh7th/cmp-buffer",
131138
commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa",
132-
after = "nvim-cmp",
139+
-- after = "nvim-cmp",
140+
dependencies = {
141+
"hrsh7th/nvim-cmp",
142+
}
133143
},
134144
["cmp_luasnip"] = {
135145
"saadparwaiz1/cmp_luasnip",
136146
commit = "18095520391186d634a0045dacaa346291096566",
137-
after = "nvim-cmp",
147+
-- after = "nvim-cmp",
148+
dependencies = {
149+
"hrsh7th/nvim-cmp",
150+
}
138151
},
139152
["lsp_signature.nvim"] = {
140153
"ray-x/lsp_signature.nvim",
141154
commit = "1979f1118e2b38084e7c148f279eed6e9300a342",
142-
after = "nvim-lspconfig",
155+
-- after = "nvim-lspconfig",
156+
dependencies = {
157+
"neovim/nvim-lspconfig",
158+
},
143159
event = "VeryLazy",
144160
},
145161
}

lua/doom/modules/features/lsp_progress/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ fidget.packages = {
66
["fidget.nvim"] = {
77
"j-hui/fidget.nvim",
88
commit = "44585a0c0085765195e6961c15529ba6c5a2a13b",
9-
after = "nvim-lspconfig",
9+
dependencies = {"neovim/nvim-lspconfig"},
10+
-- after = "nvim-lspconfig",
1011
event = "VeryLazy",
1112
},
1213
}

0 commit comments

Comments
 (0)