@@ -53,7 +53,17 @@ local function get_default_config()
5353 return result
5454end
5555
56- M .manager = nil
56+ -- https://github.com/ionide/Ionide-vim/issues/69
57+ local function inject_codelens_refresh (config )
58+ local new_config = tbl_extend (" keep" , config , {})
59+ new_config .on_attach = function (client , bufnr )
60+ if config .on_attach then
61+ config .on_attach (client , bufnr )
62+ end
63+ vim .lsp .codelens .refresh ()
64+ end
65+ return new_config
66+ end
5767
5868local function autostart_if_needed (m , config )
5969 local auto_setup = (vim .g [' fsharp#lsp_auto_setup' ] == 1 )
@@ -78,6 +88,8 @@ local function delegate_to_lspconfig(config)
7888 lspconfig .ionide .setup (config )
7989end
8090
91+ M .manager = nil
92+
8193-- partially adopted from neovim/nvim-lspconfig, see lspconfig.LICENSE.md
8294local function create_manager (config )
8395 validate {
@@ -222,10 +234,11 @@ function M._setup_buffer(client_id, bufnr)
222234end
223235
224236function M .setup (config )
237+ local new_config = inject_codelens_refresh (config )
225238 if lspconfig_is_present then
226- return delegate_to_lspconfig (config )
239+ return delegate_to_lspconfig (new_config )
227240 end
228- return create_manager (config )
241+ return create_manager (new_config )
229242end
230243
231244function M .status ()
0 commit comments