aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/dev.lua
diff options
context:
space:
mode:
authorphanium <91544758+phanen@users.noreply.github.com>2026-04-30 17:56:16 +0800
committerGitHub <noreply@github.com>2026-04-30 05:56:16 -0400
commit1e7edb2c52e0485542a300a330b6a66a76fa1ddb (patch)
tree5fb1e4b864206c9700bc8264fe49a809d05ce55a /runtime/lua/vim/treesitter/dev.lua
parent1e06e9566262eab316a9d9b6a4a6f14f9f15fa01 (diff)
downloadrneovim-1e7edb2c52e0485542a300a330b6a66a76fa1ddb.tar.gz
rneovim-1e7edb2c52e0485542a300a330b6a66a76fa1ddb.tar.bz2
rneovim-1e7edb2c52e0485542a300a330b6a66a76fa1ddb.zip
fix(lsp): send didClose, didOpen when languageId changes #39499
Problem: If a buffer's filetype changes after the LSP client has already attached (e.g. from json to jsonc via a modeline), but the client supports both filetypes, it stays attached. It does not notify the server of the new languageId, causing the server to incorrectly process the file using the old languageId. Solution: Save the languageId used during textDocument/didOpen, and send textDocument/didClose + textDocument/didOpen when buffer's languageId changed. Lsp spec: https://github.com/microsoft/language-server-protocol/blob/0003fb53f18dc7a4ac7e51d0eb518deeea90fde5/_specifications/lsp/3.18/textDocument/didOpen.md#L5 > If the language id of a document changes, the client > needs to send a textDocument/didClose to the server followed by a > textDocument/didOpen with the new language id if the server handles > the new language id as well. AI-assisted: Gemini 3.1 Pro
Diffstat (limited to 'runtime/lua/vim/treesitter/dev.lua')
0 files changed, 0 insertions, 0 deletions