Skip to content

Commit 0f110e1

Browse files
committed
fix: roqc
1 parent 4553214 commit 0f110e1

File tree

5 files changed

+68
-15
lines changed

5 files changed

+68
-15
lines changed

flake.lock

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
# };
239239

240240
coq-lsp-nvim-src = {
241-
url = "github:DieracDelta/coq-lsp.nvim";
241+
url = "path:/home/jrestivo/dev/coq-lsp.nvim";
242242
flake = false;
243243
};
244244

lazy_lua_modules/coq.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ require("lze").load({
22
"coq-lsp-nvim",
33
ft = { "coq" },
44
after = function()
5-
vim.g.loaded_coqtail = 1
6-
vim.g["coqtail#supported"] = 0
5+
-- Load coqtail for syntax highlighting (it's in opt plugins)
6+
vim.g["coqtail#supported"] = 0 -- Disable interactive features
7+
vim.cmd("packadd coqtail")
8+
-- Re-trigger syntax loading for the current buffer
9+
vim.cmd("doautocmd Syntax")
10+
711
require("coq-lsp").setup()
812

913
-- telescope picker for coq panels (moved from telescope.lua as it seems coq specific)

lazy_lua_modules/lean.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ require("lze").load({
66
mappings = true,
77
})
88
vim.lsp.enable("leanls")
9-
vim.api.nvim_set_keymap("n", "<leader>lr", "<cmd>lua vim.lsp.buf.restart()<cr>", { noremap = true, silent = true, desc = "Lean Reload File" })
9+
vim.api.nvim_set_keymap(
10+
"n",
11+
"<leader>lr",
12+
"<cmd>lua vim.lsp.buf.restart()<cr>",
13+
{ noremap = true, silent = true, desc = "Lean Reload File" }
14+
)
1015
end,
11-
})
16+
})

required_lua_modules/lsp.lua

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,51 @@ vim.opt.shortmess:append("sIWFcC")
6262

6363
vim.keymap.set("n", "<leader>m", "<Cmd>messages<CR>", {
6464
desc = "Show message history (:messages pager)",
65-
})
65+
})
66+
67+
-- Custom LSP Helpers
68+
local function lsp_info()
69+
local clients = vim.lsp.get_clients({ bufnr = 0 })
70+
if #clients == 0 then
71+
print("No LSP clients attached to this buffer.")
72+
return
73+
end
74+
local info = { "Active LSP Clients:" }
75+
for _, client in ipairs(clients) do
76+
table.insert(info, string.format("- [%d] %s (root: %s)", client.id, client.name, client.config.root_dir))
77+
end
78+
vim.notify(table.concat(info, "\n"), vim.log.levels.INFO)
79+
end
80+
81+
local function lsp_restart()
82+
local clients = vim.lsp.get_clients({ bufnr = 0 })
83+
if #clients == 0 then
84+
print("No active clients to restart. Attempting to reload buffer to trigger autostart...")
85+
vim.cmd("edit")
86+
return
87+
end
88+
89+
-- Stop all clients attached to current buffer
90+
local client_names = {}
91+
for _, client in ipairs(clients) do
92+
table.insert(client_names, client.name)
93+
client.stop()
94+
end
95+
96+
vim.notify("Stopping clients: " .. table.concat(client_names, ", "), vim.log.levels.INFO)
97+
98+
-- Wait a bit then reload buffer to re-trigger attach
99+
vim.defer_fn(function()
100+
vim.cmd("edit")
101+
vim.notify("LSP Restarted (buffer reloaded)", vim.log.levels.INFO)
102+
end, 500)
103+
end
104+
105+
local function lsp_log()
106+
local path = vim.lsp.get_log_path()
107+
vim.cmd("tabnew " .. path)
108+
end
109+
110+
vim.keymap.set("n", "<leader>Li", lsp_info, { desc = "LSP Info" })
111+
vim.keymap.set("n", "<leader>Lr", lsp_restart, { desc = "LSP Restart" })
112+
vim.keymap.set("n", "<leader>Ll", lsp_log, { desc = "LSP Log" })

0 commit comments

Comments
 (0)