Skip to content

Commit 0fda1e2

Browse files
authored
xref: keep syntax highlighting (#2271)
When using xref to show all references/definitions/... of some symbol, all entries were gray, even though they had syntax highlighting in the buffer where they were defined. This was because `lsp--extract-line-from-buffer', used by lsp's xref routines, used `buffer-substring-no-properties' to extract lines. Use `buffer-substring' instead.
1 parent 0203136 commit 0fda1e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lsp-mode.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4481,8 +4481,7 @@ and the position respectively."
44814481
(inhibit-field-text-motion t))
44824482
(save-excursion
44834483
(goto-char point)
4484-
(buffer-substring-no-properties (line-beginning-position)
4485-
(line-end-position)))))
4484+
(buffer-substring (line-beginning-position) (line-end-position)))))
44864485

44874486
(lsp-defun lsp--xref-make-item (filename (&Range :start (start &as &Position :character start-char :line start-line)
44884487
:end (end &as &Position :character end-char)))

0 commit comments

Comments
 (0)