mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	Merge pull request #14264 from mjlbach/feature/handle_reloading_buffer
lsp: add on_reload callback for buffer edits outside of neovim
This commit is contained in:
		| @@ -941,6 +941,15 @@ function lsp.buf_attach_client(bufnr, client_id) | |||||||
|     -- First time, so attach and set up stuff. |     -- First time, so attach and set up stuff. | ||||||
|     vim.api.nvim_buf_attach(bufnr, false, { |     vim.api.nvim_buf_attach(bufnr, false, { | ||||||
|       on_lines = text_document_did_change_handler; |       on_lines = text_document_did_change_handler; | ||||||
|  |       on_reload = function() | ||||||
|  |         local params = { textDocument = { uri = uri; } } | ||||||
|  |         for_each_buffer_client(bufnr, function(client, _) | ||||||
|  |           if client.resolved_capabilities.text_document_open_close then | ||||||
|  |             client.notify('textDocument/didClose', params) | ||||||
|  |           end | ||||||
|  |           text_document_did_open_handler(bufnr, client) | ||||||
|  |         end) | ||||||
|  |       end; | ||||||
|       on_detach = function() |       on_detach = function() | ||||||
|         local params = { textDocument = { uri = uri; } } |         local params = { textDocument = { uri = uri; } } | ||||||
|         for_each_buffer_client(bufnr, function(client, _) |         for_each_buffer_client(bufnr, function(client, _) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Lingelbach
					Michael Lingelbach