Skip to content

Commit

Permalink
fix(errors) new vim.lsp.inlay_hint api, new vim.lsp.get_clients api, …
Browse files Browse the repository at this point in the history
…fixed Autocommands
  • Loading branch information
WillEhrendreich committed May 2, 2024
1 parent 5b0d6a0 commit 10693af
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lua/ionide/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,14 @@ end
--- - Function which can be used to cancel all the requests. You could instead
--- iterate all clients and call their `cancel_request()` methods.
function M.CallFSharpWorkspacePeek(directoryPath, depth, excludedDirs, handler)
---@type LspClient
-- local i= vim.lsp.get_client_by_id(
local i = vim.lsp.get_client_by_id(0)
vim.notify("Lsp peek client" .. vim.inspect(i))
---@type vim.lsp.get_clients.Filter
local lspFilter = {
name = "ionide",
}

---@type vim.lsp.Client
local i = vim.lsp.get_clients(lspFilter)
vim.notify("Lsp peek client " .. vim.inspect(i))
-- i.

return M.Call("fsharp/workspacePeek", M.CreateFSharpWorkspacePeekRequest(directoryPath, depth, excludedDirs), handler)
Expand Down Expand Up @@ -1399,10 +1403,10 @@ function M.RegisterAutocmds()
if M.MergedConfig.settings.FSharp.inlayHints.enabled == true then
vim.defer_fn(function()
-- M.notify("enabling lsp inlayHint")
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint(args.buf, true)
elseif vim.lsp.buf.inlay_hint then
if vim.lsp.buf.inlay_hint then
vim.lsp.buf.inlay_hint(args.buf, true)
elseif vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(true)
else
end
end, 2000)
Expand Down Expand Up @@ -1431,7 +1435,7 @@ function M.RegisterAutocmds()
end,
})

autocmd({ "CursorHold,InsertLeave" }, {
autocmd({ "CursorHold", "CursorHoldI", "InsertLeave" }, {
desc = "Ionide Show Signature on cursor move or hold",
group = grp("FSharp_ShowSignatureOnCursorMoveOrHold", { clear = true }),
pattern = "*.fs,*.fsi,*.fsx",
Expand Down

0 comments on commit 10693af

Please sign in to comment.