Skip to content

Commit d6926bd

Browse files
authored
Implement eslint/probeFailed in lsp-eslint (#2630)
* Implement eslint/probeFailed in lsp-eslint * Use lsp--error instead of user-error
1 parent d5db433 commit d6926bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clients/lsp-eslint.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ to allow or deny it.")
295295
(lsp--persist lsp-eslint-library-choices-file lsp-eslint--stored-libraries)))
296296
(funcall callback (car option)))))))
297297

298+
(defun lsp-eslint--probe-failed (_workspace _message)
299+
"Called when the server detects a misconfiguration in ESLint."
300+
(lsp--error "ESLint is not configured correctly. Please ensure your eslintrc is set up for the languages you are using."))
301+
298302
(lsp-register-client
299303
(make-lsp-client
300304
:new-connection
@@ -313,7 +317,8 @@ to allow or deny it.")
313317
:multi-root t
314318
:notification-handlers (ht ("eslint/status" #'lsp-eslint-status-handler))
315319
:request-handlers (ht ("workspace/configuration" #'lsp-eslint--configuration)
316-
("eslint/openDoc" #'lsp-eslint--open-doc))
320+
("eslint/openDoc" #'lsp-eslint--open-doc)
321+
("eslint/probeFailed" #'lsp-eslint--probe-failed))
317322
:async-request-handlers (ht ("eslint/confirmESLintExecution" #'lsp-eslint--confirm-local))
318323
:server-id 'eslint
319324
:initialized-fn (lambda (workspace)

0 commit comments

Comments
 (0)