Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslint doesn't work with [email protected]+ #1041

Open
kuba-orlik opened this issue Sep 19, 2024 · 3 comments
Open

Eslint doesn't work with [email protected]+ #1041

kuba-orlik opened this issue Sep 19, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@kuba-orlik
Copy link
Contributor

kuba-orlik commented Sep 19, 2024

When visiting a buffer in a typescript project, only Typescript errors are shown in the diagnostic list. Eslint errors are not shown. VSCode properly displays eslint issues in this project, so I know that eslint is properly configured.

I have both typescript-language-server and vscode-eslint-language-server installed. Here's how I'm setting up lsp-bridge:

(use-package lsp-bridge
  :straight '(lsp-bridge :type git :host github :repo "manateelazycat/lsp-bridge"
			 :files (:defaults "*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources")
			 :build (:not compile))
  :bind (("M-." . lsp-bridge-find-def)
	 ("M-," . lsp-bridge-find-def-return)
	 ("C-M-." . lsp-bridge-peek)
	 ("C-c c a" . lsp-bridge-code-action)
	 ("M-?" . lsp-bridge-find-references)
	 ("C-c ! n" . lsp-bridge-diagnostic-jump-next)
	 ("C-c ! p" . lsp-bridge-diagnostic-jump-prev)
	 )
  :init
  (global-lsp-bridge-mode))

With pgrep I can see that the eslint server is in fact running.

In the messages buffer, I can see that the eslint server is detected

[LSP-Bridge] found language server: /home/kuba/.nvm/versions/node/v20.11.1/bin/typescript-language-server
[LSP-Bridge] found language server: /home/kuba/.nvm/versions/node/v20.11.1/bin/vscode-eslint-language-server

However, in the *lsp-bridge* buffer, I see that messages are sent to eslint server, but it doesn't seem to reply. The only Recv lines from the eslint server are Recv window/logMessage notification from 'vscode-eslint-language-server' after opening a file.

--- [13:52:56.712765] Recv window/logMessage notification from 'vscode-eslint-language-server' for project my-project
{
   "jsonrpc": "2.0",
   "method": "$/typescriptVersion",
   "params": {
      "version": "4.9.4",
      "source": "workspace"
   }
}

But no more Recvs than that.

I'm using vscode-langservers-extracted v4.10.0

Downgrading to [email protected] (npm install -g [email protected]) and restarting emacs makes the eslint diagnostics work properly

@kuba-orlik kuba-orlik changed the title Eslint diagnostics not showing up Eslint doesn't work with [email protected]+ Sep 19, 2024
@manateelazycat manateelazycat added the help wanted Extra attention is needed label Sep 19, 2024
@braineo
Copy link
Contributor

braineo commented Oct 5, 2024

Hello @manateelazycat i encountered the same problem.

I attached the reproduction code

test.tar.gz

npm install
npm run lint

eslint outputs following but lsp bridge does not receive any diagnosis from lsp

./src/app/layout.tsx
15:13  Error: 'React' is not defined.  no-undef
30:7  Error: Expected a 'break' statement before 'case'.  no-fallthrough

@manateelazycat
Copy link
Owner

@braineo 可以考虑打开 VSCode 的 lsp trace log , 像这个issue #1039 (comment) 那样。

我们对比一下 lsp-bridge 和 VSCode 的消息交互, 应该就可以修复。

@braineo
Copy link
Contributor

braineo commented Oct 9, 2024

@braineo 可以考虑打开 VSCode 的 lsp trace log , 像这个issue #1039 (comment) 那样。

我们对比一下 lsp-bridge 和 VSCode 的消息交互, 应该就可以修复。

That's exactly what i did, but i ran out of idea how to fix it.

Log from lsp bridge

lsp-eslint.log

Log from vscode

vscode-eslint.log

What I've tried by mimicking vscode but did not work

  1. add workspace field in initialization call to server
  2. do not send didConfigurationChange actively to server
  3. let server know the the client support registration capability
  4. send textDocument/diagonstic to server (this seems to be the key difference in vscode side)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants