emacs-lsp / lsp-ui

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

lsp ui sideline not working in tsx buffer even though errors are highlighted. #567

Closed vikigenius closed 3 years ago

vikigenius commented 3 years ago

Describe the bug

Reproducing the bug report from: https://github.com/hlissner/doom-emacs/issues/4598 since I think this is an lsp-mode issue.

lsp ui sideline not showing diagnostics in tsx buffer even though it is highlighted

The first line is supposed to show the following error in the sideline

1: typescript: 'React' is declared but its value is never read.

However it doesn't show. It is highlighted, and I can see it in the diagnostics buffer, but the sideline doesn't show up.

scrot_20210130_234804

However, if I disable lsp-ui-sideline-mode the error is shown right below below the cursor.

scrot_20210130_235235

To Reproduce

  1. Create a typescript react app with npx create-react-app client --template typescript
  2. Open the App.tsx file in src
  3. Move your cursor to the first line to display the error
  4. Disable lsp-ui-sideline-mode and try again.

Expected behavior lsp ui sideline should show diagnostics in tsx buffer when I have my cursor on that line

Which Language Server did you use ts-ls

OS Linux x86_64

vikigenius commented 3 years ago

I have an update, the error is not showing because it is in the first line. If i introduce a blank line at the top then the error shows properly. It also shows a code action. I think the fact that this is a two line message makes it impossible to show when it is on the first line. Is there a way to control this ?

scrot_20210131_234233

jcs090218 commented 3 years ago

@vikigenius I have applied the patch #568. Can you check the latest version of lsp-ui? Thanks!

vikigenius commented 3 years ago

Yes, this has been fixed, thanks. Closing.