From 4c6c3041f00f867d3dd3fd10d7e79499df4cbc02 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 7 Jan 2022 06:52:15 -0800 Subject: [PATCH] use lsp for tags and formatting when available --- neovim/lua/plugins/lsp.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index 4c555ce..04e211b 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -55,6 +55,14 @@ local function default_attach(client, bufnr) buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") + if resolved_capabilities.goto_definition then + buf_set_option(bufnr, "tagfunc", "v:lua.vim.lsp.tagfunc") + end + + if resolved_capabilities.document_formatting then + buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr()") + end + -- Mappings -- TODO: Maybe prefix all of these for easier discovery local opts = { noremap = true, silent = true }