aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/tohtml.lua
diff options
context:
space:
mode:
authoraltermo <107814000+altermo@users.noreply.github.com>2024-05-26 13:08:57 +0200
committeraltermo <107814000+altermo@users.noreply.github.com>2024-05-26 13:14:40 +0200
commit8cd9feb50166202bf55315934f14f74e63c8fcb4 (patch)
treeb8dc7b8b1bd5079c5f6c7de2d5929c95eb8b58a4 /runtime/lua/tohtml.lua
parent2ed6423c7e9d4911343d3e2049908f4b78ec7a55 (diff)
downloadrneovim-8cd9feb50166202bf55315934f14f74e63c8fcb4.tar.gz
rneovim-8cd9feb50166202bf55315934f14f74e63c8fcb4.tar.bz2
rneovim-8cd9feb50166202bf55315934f14f74e63c8fcb4.zip
fix(tohtml): ignore lsp inlay hints
Diffstat (limited to 'runtime/lua/tohtml.lua')
-rw-r--r--runtime/lua/tohtml.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/lua/tohtml.lua b/runtime/lua/tohtml.lua
index 5a6fc77e5c..f7d8538b8f 100644
--- a/runtime/lua/tohtml.lua
+++ b/runtime/lua/tohtml.lua
@@ -481,10 +481,17 @@ end
--- @param state vim.tohtml.state
--- @param extmark {[1]:integer,[2]:integer,[3]:integer,[4]:vim.api.keyset.set_extmark|any}
-local function _styletable_extmarks_virt_text(state, extmark)
+--- @param namespaces table<integer,string>
+local function _styletable_extmarks_virt_text(state, extmark, namespaces)
if not extmark[4].virt_text then
return
end
+ ---TODO(altermo) LSP semantic tokens (and some other extmarks) are only
+ ---generated in visible lines, and not in the whole buffer.
+ if (namespaces[extmark[4].ns_id] or ''):find('vim_lsp_inlayhint') then
+ vim.notify_once('Info(TOhtml): lsp inlay hints are not supported, HTML may be incorrect')
+ return
+ end
local styletable = state.style
--- @type integer,integer
local row, col = extmark[2], extmark[3]
@@ -586,7 +593,7 @@ local function styletable_extmarks(state)
_styletable_extmarks_conceal(state, v)
end
for _, v in ipairs(extmarks) do
- _styletable_extmarks_virt_text(state, v)
+ _styletable_extmarks_virt_text(state, v, namespaces)
end
for _, v in ipairs(extmarks) do
_styletable_extmarks_virt_lines(state, v)