Recently LSP has stopped working for me.

I'm getting this message for all files in my project.

LSP :: example_filename.c not in project or it is blacklisted.

How can I investigate this, if it's blacklisted, how can I reset the blacklist?

  • LSP is a protocol so it neither works nor can stop working. You're presumably talking about some implementation of this protocol, so please say which implementation you're using (probably lsp-mode or eglot on Emacs's side, and some LSP server on the other side but I can't begin to guess about that other side).
    – Stefan
    Dec 17 '19 at 15:32
  • The question is tagged lsp-mode, but I could have included that in the title (will edit).
    – ideasman42
    Dec 17 '19 at 23:37
  • 2
    I had to manually add the folder to the workspace by lsp-workspace-folders-add
    – capitrane
    Feb 3 at 9:08

I somehow managed to blacklist my own project, removing ~/.emacs.d/.lsp-session-v1 resolved the issue, although I might have been able to solve this using lsp-workspace-blacklist-remove


@capitrane comment had the answer for me: M-x lsp-workspace-folders-add from within the project, and it started to work.

  • Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. - From Review
    – erikstokes
    Jun 16 at 23:02
  • 1
    There was no such answer -- it was an old comment which deserves to be an answer. Jun 17 at 21:15
  • 1
    But you shouldn't just copy the comment: make it useful for naive users. E.g. I don't know much about lsp, so I have no idea whether what you quote is a function or a variable. I also have no idea how exactly to call the function/set the variable to add the folder. I can guess and I know how to get around the docs to figure out how to use it, but a noob might not. So by all means, credit @capitrane, make his/her comment an answer, but don't just copy the comment: you spent some time to make it work for you, so explain it in enough detail to enable a naive user to use it.
    – NickD
    Jun 25 at 14:16
  • Answer updated appropriately. Jul 6 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.