mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	fix(lsp): add foldingrange method support check #31463
Problem: The folding_range request method assumes that the client supports the method Solution: Add a capability guard to the call
This commit is contained in:
		@@ -271,7 +271,9 @@ local function setup(bufnr)
 | 
				
			|||||||
    buffer = bufnr,
 | 
					    buffer = bufnr,
 | 
				
			||||||
    callback = function(args)
 | 
					    callback = function(args)
 | 
				
			||||||
      local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
 | 
					      local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
 | 
				
			||||||
 | 
					      if client:supports_method(vim.lsp.protocol.Methods.textDocument_foldingRange, bufnr) then
 | 
				
			||||||
        request(bufnr, client)
 | 
					        request(bufnr, client)
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
    end,
 | 
					    end,
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  api.nvim_create_autocmd('LspNotify', {
 | 
					  api.nvim_create_autocmd('LspNotify', {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user