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

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`.
This commit is contained in:
Olivia Kinnear
2026-04-28 18:17:44 -05:00
committed by GitHub
parent 55ceb314ca
commit 1799aaebda
4 changed files with 15 additions and 6 deletions

View File

@@ -629,7 +629,7 @@ describe('vim.lsp.util', function()
filename = '/test_b',
kind = 'Module',
lnum = 4,
text = '[Module] TestB in TestBContainer (deprecated)',
text = '[Module] TestB (deprecated)',
},
}
eq(
@@ -672,7 +672,7 @@ describe('vim.lsp.util', function()
},
uri = 'file:///test_b',
},
containerName = 'TestBContainer',
containerName = vim.NIL,
},
}
return vim.lsp.util.symbols_to_items(sym_info, nil, 'utf-16')