Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion modules/nixvim/plugins/lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ in
installCargo = false;
installRustc = false;
};
sourcekit = {
enable = true;
package = null; # use Xcode's /usr/bin/sourcekit-lsp instead of nixpkgs'
# Defaults also claim c/cpp/objc/objcpp, which clangd already handles.
filetypes = [ "swift" ];
};
sqls.enable = true;
tailwindcss.enable = true;
ts_ls = {
Expand Down Expand Up @@ -120,7 +126,17 @@ in
local bufname = vim.api.nvim_buf_get_name(bufnr)
local is_file = bufname == "" or bufname:match("^/") or bufname:match("^file://")
if filetype ~= "vue" and is_file then
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
if client.name == "sourcekit" then
-- sourcekit-lsp times out (-32001) on the first inlayHint while SwiftPM
-- is still evaluating the package manifest. Enable once it is warm.
vim.defer_fn(function()
if vim.api.nvim_buf_is_valid(bufnr) then
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
end
end, 5000)
else
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
end
end
end

Expand Down
1 change: 1 addition & 0 deletions modules/nixvim/plugins/treesitter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
query
regex
rust
swift
tsx
typescript
vim
Expand Down
Loading