emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.8k stars 892 forks source link

eslint-ls breaks lsp-format-buffer in angular html files #3128

Open JordanAnthonyKing opened 3 years ago

JordanAnthonyKing commented 3 years ago

Thank you for the bug report

Bug description

In angular projects, eslint-ls activates for both .ts and .html files. While in .ts files, lsp-format-buffer works as expected, in html files it gives No formatting changes provided. Uninstalling esling and running lsp-format-buffer works as expected in html files.

Could this be an issue with eslint not being configured for html files? Should the priority of language servers for formatting be different? Should they cascade if one does not provide suggestions?

Steps to reproduce

Expected behavior

The html file should be formatted.

Which Language Server did you use?

ts-ls, angular-ls, eslint-ls

OS

Linux

Error callstack

No response

Anything else?

No response

JordanAnthonyKing commented 3 years ago

I'm having some trouble using emacs -q -l lsp-start-plain.el as running lsp-install-server RET eslint just hangs.

yyoncho commented 3 years ago

Uninstalling esling and running lsp-format-buffer works as expected in html files.

Can you check if that is the case? AFAICS html-ls does not support formatting. At least the version lsp-mode ships with.

JordanAnthonyKing commented 3 years ago

Ah, I'm running Doom and the formatting for angular files is provided by: https://github.com/lassik/emacs-format-all-the-code

yyoncho commented 3 years ago

Hm, I am not sure in this case that there is an issue on lsp-mode side. With that config, lsp-mode does not have support for formatting no matter the servers enabled in the file. I believe that the issue is outside of lsp-mode in a package that prefers lsp-mode formatting even if lsp-mode cannot provide such.

JordanAnthonyKing commented 3 years ago

I'll give it some further investigation when I get chance.