backport: fix(lsp): util.lua attempt to concatenate userdata #39510

Problem:
Error when querying document symbols using python-lsp-server:

    lsp/util.lua:1955: attempt to concatenate field 'containerName' (a userdata value)

Solution:
Check for `vim.NIL`.

(cherry picked from commit 1799aaebda)
This commit is contained in:
Olivia Kinnear
2026-04-29 15:13:47 -05:00
committed by GitHub
parent 378f5f49b3
commit c9ca59ad28
4 changed files with 15 additions and 6 deletions

View File

@@ -36,6 +36,7 @@ local M = {}
local api = vim.api
local lsp = vim.lsp
local protocol = lsp.protocol
local isnil = require('vim._core.util').isnil
local rtt_ms = 50.0
local ns_to_ms = 0.000001
@@ -1009,7 +1010,7 @@ local function trigger(bufnr, clients, ctx)
client and client.name or 'UNKNOWN'
)
)
elseif result and result ~= vim.NIL and #(result.items or result) > 0 then
elseif not isnil(result) and #(result.items or result) > 0 then
Context.isIncomplete = Context.isIncomplete or result.isIncomplete
local encoding = client and client.offset_encoding or 'utf-16'
local client_matches, tmp_server_start_boundary