diff options
| -rw-r--r-- | init.lua | 53 | ||||
| -rw-r--r-- | lazy-lock.json | 8 |
2 files changed, 46 insertions, 15 deletions
| @@ -241,28 +241,59 @@ require("lazy").setup( | |||
| 241 | local lsp_servers = { | 241 | local lsp_servers = { |
| 242 | clangd = {filetypes = {"c", "h"}}, | 242 | clangd = {filetypes = {"c", "h"}}, |
| 243 | svelte = {filetypes = {"svelte"}}, | 243 | svelte = {filetypes = {"svelte"}}, |
| 244 | ts_ls = {filetypes = {"typescript", "typescriptreact", "javascript", "javascriptreact"}}, | 244 | ts_ls = {filetypes = { |
| 245 | rust_analyzer = {filetypes = {"rust"}} | 245 | "typescript", |
| 246 | "typescriptreact", | ||
| 247 | "javascript", | ||
| 248 | "javascriptreact"} | ||
| 249 | }, | ||
| 250 | rust_analyzer = { | ||
| 251 | filetypes = {"rust"}, | ||
| 252 | imports = { | ||
| 253 | granularity = { | ||
| 254 | group = "module", | ||
| 255 | }, | ||
| 256 | prefix = "self", | ||
| 257 | }, | ||
| 258 | cargo = { | ||
| 259 | buildScripts = { | ||
| 260 | enable = true, | ||
| 261 | }, | ||
| 262 | }, | ||
| 263 | procMacro = { | ||
| 264 | enable = true | ||
| 265 | }, | ||
| 266 | } | ||
| 246 | } | 267 | } |
| 247 | 268 | ||
| 248 | local function server_maps(opts) | 269 | local function server_maps(opts) |
| 249 | local buf = opts.buffer | 270 | local buf = opts.buffer |
| 250 | end | 271 | end |
| 251 | 272 | ||
| 273 | |||
| 274 | |||
| 275 | local capabilities = vim.lsp.protocol.make_client_capabilities() | ||
| 276 | capabilities = require("coq").lsp_ensure_capabilities(capabilities) | ||
| 277 | |||
| 252 | for server_name, config in pairs(lsp_servers) do | 278 | for server_name, config in pairs(lsp_servers) do |
| 253 | require("lspconfig")[server_name].setup( | 279 | vim.api.nvim_create_autocmd("FileType", { |
| 254 | coq.lsp_ensure_capabilities( | 280 | pattern = config.filetypes, |
| 255 | { | 281 | callback = function() |
| 282 | vim.lsp.start({ | ||
| 283 | name = server_name, | ||
| 284 | cmd = vim.lsp.get_server_capabilities(server_name).cmd or { server_name }, | ||
| 285 | root_dir = vim.fs.dirname(vim.api.nvim_buf_get_name(0)), | ||
| 286 | capabilities = capabilities, | ||
| 287 | settings = config.settings, | ||
| 256 | on_attach = function(client, bufnr) | 288 | on_attach = function(client, bufnr) |
| 257 | server_maps({buffer = bufnr}) | 289 | server_maps({buffer = bufnr}) |
| 258 | end, | 290 | end |
| 259 | filetypes = config.filetypes, | 291 | }) |
| 260 | settings = config.settings or {} | 292 | end |
| 261 | } | 293 | }) |
| 262 | ) | ||
| 263 | ) | ||
| 264 | end | 294 | end |
| 265 | 295 | ||
| 296 | |||
| 266 | set_highlights() | 297 | set_highlights() |
| 267 | 298 | ||
| 268 | vim.g.mapleader = " " | 299 | vim.g.mapleader = " " |
diff --git a/lazy-lock.json b/lazy-lock.json index 1c6069e..36b9fc6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | { | 1 | { |
| 2 | "coq.artifacts": { "branch": "artifacts", "commit": "ef5f21d638ccc456cfa5b8d0ab37093cefe48c8b" }, | 2 | "coq.artifacts": { "branch": "artifacts", "commit": "ef5f21d638ccc456cfa5b8d0ab37093cefe48c8b" }, |
| 3 | "coq_nvim": { "branch": "coq", "commit": "2732cfa52fffd32d535c782f418da6fb8bf331ea" }, | 3 | "coq_nvim": { "branch": "coq", "commit": "a63d28a9aa59c20a503ce38608fb6bc7cb3842f4" }, |
| 4 | "fzf-lua": { "branch": "main", "commit": "ce5a5fa2902933e7b4563ca78210254169463cb6" }, | 4 | "fzf-lua": { "branch": "main", "commit": "db3ccffe79480543d8e0f7b0cac0d9b220f9486e" }, |
| 5 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, | 5 | "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, |
| 6 | "nvim-lspconfig": { "branch": "master", "commit": "c8b90ae5cbe21d547b342b05c9266dcb8ca0de8f" }, | 6 | "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, |
| 7 | "vim-gitgutter": { "branch": "main", "commit": "488c0555e47e2aabe273c635f7dd233e985311a6" } | 7 | "vim-gitgutter": { "branch": "main", "commit": "488c0555e47e2aabe273c635f7dd233e985311a6" } |
| 8 | } | 8 | } |
