emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.04k stars 139 forks source link

Syntax highlighting after lsp-ui-peek-find-definitions is not activated in whole buffer #482

Closed tmythicator closed 4 years ago

tmythicator commented 4 years ago

Bug description When navigating with lsp-ui-peek-find-definitions to react-component, it navigates correctly to the file. If file was not opened beforehand, the highlighting will appear only after the found definition, but not before.

To Reproduce

  1. Open file with a react-component.
  2. Make sure the referenced file with component definition is not already in buffer list.
  3. Perform lsp-ui-peek-find-definitions on component.
  4. You should correctly navigate to the other file with mode-specific highlighting activated only from the line till the end of the buffer.

Expected behavior Syntax highlighting should be enabled in the whole buffer.

Which Language Server did you use Typescript language server

OS Linux

References This may help solving the problem: Pull-Requests: https://github.com/emacs-lsp/lsp-ui/pull/473

tmythicator commented 4 years ago

UPD: I start using web-mode instead and the problem disappeared. So it looks like it is typescript-mode specific problem.

Before:

(use-package typescript-mode
  :ensure t
  :mode ("\\.tsx$" . typescript-mode))

Now:

(use-package web-mode
  :ensure t
  :mode ("\\.tsx$" . web-mode))