mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	feat(downstream): check client capability before formatting
This commit is contained in:
		
					parent
					
						
							
								23af12349a
							
						
					
				
			
			
				commit
				
					
						b63d17507e
					
				
			
		
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -204,8 +204,10 @@ in { | ||||||
|             buffer = bufnr, |             buffer = bufnr, | ||||||
|             callback = function() |             callback = function() | ||||||
|               if vim.g.formatsave then |               if vim.g.formatsave then | ||||||
|  |                 if client.supports_method("textDocument/formatting") then | ||||||
|                   local params = require'vim.lsp.util'.make_formatting_params({}) |                   local params = require'vim.lsp.util'.make_formatting_params({}) | ||||||
|                   client.request('textDocument/formatting', params, nil, bufnr) |                   client.request('textDocument/formatting', params, nil, bufnr) | ||||||
|  |                 end | ||||||
|               end |               end | ||||||
|             end |             end | ||||||
|           }) |           }) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 NotAShelf
				NotAShelf