Open glyh opened 6 months ago
Hello, I would like to help with this.
I'm on crystal 1.14.0, LLVM: 18.1.8 with crystalline built from 4bac6805fd80a53887bd38628c8ec9b49a9b86bc
Here's what I have with LSPInfo:
As for LSP log it's empty.
The config is the default given by nvim-lspconfig:
Could you tell me how should I troubleshoot?
Also there's even more weird behavior as this LSP delete some of my code on save when save-on-format is enabled with some other plugins on neovim.
Here's a tmp fix so I can see linting, I'm still having issues with auto formatting/auto completion , though.
lspconfig.crystalline.setup {
cmd = { "crystalline", "--stdio" },
}
Hi I have the same problem with lsp based autoformat so I start using vim-crystal for auto format:
-- turn on auto format with vim-crystal:
vim.g.crystal_auto_format = 1
add vim-crystal in lazy:
{
'vim-crystal/vim-crystal',
},
and disable lsp_fallaback
for crystal files (code form modified kickstart.nvim):
{ -- Autoformat
'stevearc/conform.nvim',
lazy = false,
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true, crystal = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use a sub-list to tell conform to run *until* a formatter
-- is found.
-- javascript = { { "prettierd", "prettier" } },
},
},
},
Hello, thanks, that works now. Only thing that is broken is autocompletion now.
EDIT: it looks like we actually do have auto completion. It's just the quality of autocompletion is pretty bad.
Hello, thanks, that works now. Only thing that is broken is autocompletion now.
EDIT: it looks like we actually do have auto completion. It's just the quality of autocompletion is pretty bad.
It seems to work in the main source file but in others it works quite randomly
I've tried to use crystalline multiple times on neovim with nvim-lspconfig, and I get no autocomplete. Is there any information on troubleshooting crystalline?