From 77e3efecee4e9948044ec02caeaf6fec496c6c02 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sun, 31 Aug 2025 14:09:12 -0700 Subject: feat(lsp): support `textDocument/onTypeFormatting` (#34637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements [on-type formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting) using a `vim.on_key()` approach to listen to typed keys. It will listen to keys on the *left hand side* of mappings. The `on_key` callback is cleared when detaching the last on-type formatting client. This feature is disabled by default. Co-authored-by: Maria José Solano --- runtime/lua/vim/lsp.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/lsp.lua') diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 8b6d912701..dc09cdde5c 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -19,6 +19,7 @@ local lsp = vim._defer_require('vim.lsp', { inline_completion = ..., --- @module 'vim.lsp.inline_completion' linked_editing_range = ..., --- @module 'vim.lsp.linked_editing_range' log = ..., --- @module 'vim.lsp.log' + on_type_formatting = ..., --- @module 'vim.lsp.on_type_formatting' protocol = ..., --- @module 'vim.lsp.protocol' rpc = ..., --- @module 'vim.lsp.rpc' semantic_tokens = ..., --- @module 'vim.lsp.semantic_tokens' -- cgit