@@ -289,20 +289,24 @@ CONTENTS can be differents type of values:
289289MarkedString | MarkedString[] | MarkupContent (as defined in the LSP).
290290We don't extract the string that `lps-line' is already displaying."
291291 (cond
292- ((stringp contents) (lsp-ui-doc--extract-marked-string contents)) ; ; MarkedString
293292 ((vectorp contents) ; ; MarkedString[]
294293 (mapconcat 'lsp-ui-doc--extract-marked-string
295294 (lsp-ui-doc--filter-marked-string (seq-filter #'identity contents))
296295 " \n\n "
297296 ; ; (propertize "\n\n" 'face '(:height 0.4))
298297 ))
299298 ; ; when we get markdown contents, render using emacs gfm-view-mode / markdown-mode
300- ((string= (lsp-markup-content? contents) lsp/markup-kind-markdown) ; ; Markdown MarkupContent
301- (lsp-ui-doc--extract-marked-string (lsp:markup-content-value contents) lsp/markup-kind-markdown))
302- ((lsp-markup-content? contents) (lsp:markup-content-value contents)) ; ; Plaintext MarkupContent
303- ((lsp-marked-string? contents) ; ; MarkedString
299+ ((and (lsp-marked-string? contents)
300+ (lsp:marked-string-language contents))
304301 (lsp-ui-doc--extract-marked-string (lsp:marked-string-value contents)
305- (lsp:marked-string-language contents)))))
302+ (lsp:marked-string-language contents)))
303+ ((lsp-marked-string? contents) (lsp-ui-doc--extract-marked-string contents))
304+ ((and (lsp-markup-content? contents)
305+ (string= (lsp:markup-content-kind contents) lsp/markup-kind-markdown))
306+ (lsp-ui-doc--extract-marked-string (lsp:markup-content-value contents) lsp/markup-kind-markdown))
307+ ((and (lsp-markup-content? contents)
308+ (string= (lsp:markup-content-kind contents) lsp/markup-kind-plain-text))
309+ (lsp:markup-content-value contents))))
306310
307311(defun lsp-ui-doc--webkit-run-xwidget ()
308312 " Launch embedded WebKit instance."
0 commit comments