syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.58k stars 4.9k forks source link

Error running timer ‘lsp--on-idle’: (error "Undefined error level: lsp-flycheck-info-unnecessary") #16224

Closed tanj closed 5 months ago

tanj commented 6 months ago

Description :octocat:

When opening a file that uses an lsp mode no debug information is shown.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

LSP :: Connected to [ts-ls:48516 <project path>].
Error running timer ‘lsp--on-idle’: (error "Undefined error level: lsp-flycheck-info-unnecessary")

Expected behaviour: :heart: :smile:

no error message and any lsp errors or info shown

System Info :computer:

Backtrace :paw_prints:

Debugger entered--Lisp error: (error "Undefined error level: lsp-flycheck-info-unnecessa...")
  signal(error ("Undefined error level: lsp-flycheck-info-unnecessa..."))
  (condition-case err (let* ((checker (flycheck-get-checker-for-buffer))) (if checker (flycheck-start-current-syntax-check checker) (flycheck-clear) (flycheck-report-status 'no-checker))) (error (flycheck-report-failed-syntax-check) (signal (car err) (cdr err))))
  (if (flycheck-running-p) nil (run-hooks 'flycheck-before-syntax-check-hook) (flycheck-clear-errors) (flycheck-mark-all-overlays-for-deletion) (condition-case err (let* ((checker (flycheck-get-checker-for-buffer))) (if checker (flycheck-start-current-syntax-check checker) (flycheck-clear) (flycheck-report-status 'no-checker))) (error (flycheck-report-failed-syntax-check) (signal (car err) (cdr err)))))
  (if flycheck-mode (if (flycheck-running-p) nil (run-hooks 'flycheck-before-syntax-check-hook) (flycheck-clear-errors) (flycheck-mark-all-overlays-for-deletion
Debugger entered--Lisp error: (error "Undefined error level: lsp-flycheck-info-unnecessa...")
  signal(error ("Undefined error level: lsp-flycheck-info-unnecessa..."))
  (condition-case err (let* ((checker (flycheck-get-checker-for-buffer))) (if checker (flycheck-start-current-syntax-check checker) (flycheck-clear) (flycheck-report-status 'no-checker))) (error (flycheck-report-failed-syntax-check) (signal (car err) (cdr err))))
  (if (flycheck-running-p) nil (run-hooks 'flycheck-before-syntax-check-hook) (flycheck-clear-errors) (flycheck-mark-all-overlays-for-deletion) (condition-case err (let* ((checker (flycheck-get-checker-for-buffer))) (if checker (flycheck-start-current-syntax-check checker) (flycheck-clear) (flycheck-report-status 'no-checker))) (error (flycheck-report-failed-syntax-check) (signal (car err) (cdr err)))))
  (if flycheck-mode (if (flycheck-running-p) nil (run-hooks 'flycheck-before-syntax-check-hook) (flycheck-clear-errors) (flycheck-mark-all-overlays-for-deletion) (condition-case err (let* ((checker (flycheck-get-checker-for-buffer))) (if checker (flycheck-start-current-syntax-check checker) (flycheck-clear) (flycheck-report-status 'no-checker))) (error (flycheck-report-failed-syntax-check) (signal (car err) (cdr err))))) (user-error "Flycheck mode disabled"))
  flycheck-buffer()
  lsp-diagnostics--flycheck-buffer()
  run-hooks(lsp-on-idle-hook)
  lsp--on-idle(#<buffer lister.component.ts>)
  #f(compiled-function () #<bytecode 0x16d0b3b5906a936d>)()
  apply(#f(compiled-function () #<bytecode 0x16d0b3b5906a936d>) nil)
  timer-event-handler([t 0 0 0 nil #f(compiled-function () #<bytecode 0x16d0b3b5906a936d>) nil idle 0 nil])
smile13241324 commented 6 months ago

I cannot reproduce your issue, I have opened a simple test js file and the lsp layer was working fine. Please provide more infos for reproduction.

tanj commented 6 months ago

So, one thing I noticed over the last few days is that it isn't with every file. It was happening with with seemingly any lsp I use.

I'm trying to make a reproducible case, but it seems to be somewhat temperamental... Ok, this one seems to work for me consistently.

  1. git clone https://github.com/helix-editor/helix.git
  2. Open emacs (assuming rust layer enabled and rust-analyzer installed)
  3. open helix/helix-term/src/application.rs
  4. wait for lsp to load completely
  5. make a change to trigger lsp (I inserted a space at the beginning of a line and then deleted it)
  6. Error running timer message occurs
smile13241324 commented 6 months ago

I have followed your instructions but I seem to not get the same error, however I have seen a suspicious error for an invalid face for lsp-flycheck-info-unnecessary.

I have searched that string in our code and did not find it, I am afraid this error comes from lsp-mode or lsp-server itself. I have seen a similar issue with the java lsp at work but have hoped this would only be an issue of my outdated installation. Once I have updated my work environment I may be able to provide some more diagnostics for now I am clueless.

alexey0308 commented 5 months ago

Hi @tanj, please take a look at https://github.com/emacs-lsp/lsp-mode/issues/2255

it looks like an upstream issue and there is a comment with temporary solution ~linked PR to it~.

tanj commented 5 months ago

I have the temporary fix in my config already, but it doesn't fix the error. My issue is talking about an undefined error level, not an undefined face. It could be that this is adjacent to that issue and be fully upstream and not a spacemacs issue.

vjohansen commented 2 months ago

@tanj What was your temporary fix? I have the same issue (not spacemacs, regular Emacs 29)

tanj commented 2 months ago

@vjohansen

;; https://github.com/emacs-lsp/lsp-mode/issues/2255#issuecomment-1786355147
(defface lsp-flycheck-info-unnecessary
    '((t))
    "Face which apply to side line for symbols not used.
Possibly erroneously redundant of lsp-flycheck-info-unnecessary-face."
    :group 'lsp-ui-sideline)

This didn't fix this exact issue tho. It only fixed the undefined face issue.