]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Fix : no need to check kind for hover reply in preview
authorIndelog <maxime@indelog.fr>
Sun, 21 Nov 2021 10:20:44 +0000 (11:20 +0100)
committerIndelog <maxime@indelog.fr>
Sun, 21 Nov 2021 10:20:44 +0000 (11:20 +0100)
This is already done in the begin of `processHoverReply`.

autoload/handlers.vim

index bd4584baba0ae950d5b27b8f8b267f73c10c3a53..c624d83bd7c5ed77661cd7a2362f5653036ae40b 100644 (file)
@@ -335,16 +335,7 @@ def s:processHoverReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>):
     wincmd P
     setlocal buftype=nofile
     setlocal bufhidden=delete
-    # If lsp server provide kind of hover reply and this kind is in syntaxs
-    # syported by vim, use it for file type of preview window. Else use
-    # type text by default.
-    if reply.result.contents->has_key('kind')
-\        && !reply.result.contents.kind->empty()
-\        && getcompletion('', 'filetype')->index(reply.result.contents.kind) > -1
-      exe 'setlocal ft=' .. reply.result.contents.kind
-    else
-      set setlocal ft=text
-    endif
+    exe 'setlocal ft=' .. reply.result.contents.kind
     deletebufline(bufnr(), 1,  getbufinfo(bufnr())[0].linecount)
     append(0, hoverText)
     cursor(1, 1)