Lsp-mode: not getting any completions

Created on 12 Oct 2019  路  10Comments  路  Source: emacs-lsp/lsp-mode

I have installed the lsp-mode along lsp-ui and company-lsp using use-package but for everything that I've tried it seems that I can't get any completions what so ever.

I'm editing a single python file and before accessing the file I've activated my python environment using pyven in which previously I had installed via pip all language server tools.

Am I missing something here?

Most helpful comment

Use lsp-workspace-blacklist-remove to remove the blacklisted directory, then reopen the file and then select the proper option from the menu(either use the proposed root or choose the interactive root selection)

All 10 comments

Please mention what do you see in lsp logs after you do M-x lsp

@yyoncho
Here's what I see in the minibuffer when I execute M-x lsp

LSP :: testpyth.py not in project or it is blacklisted.

In the *lsp-log* buffer I see this

Command "pyls" is present on the path.
Found the following clients for /tmp/testpyth.py: (server-id pyls, priority -1)
The following clients were selected based on priority: (server-id pyls, priority -1)
Command "pyls" is present on the path.
Found the following clients for /tmp/testpyth.py: (server-id pyls, priority -1)
The following clients were selected based on priority: (server-id pyls, priority -1)

And in my config I also have (setq lsp-log-io t) but I don't see any other logs or buffers.

Use lsp-workspace-blacklist-remove to remove the blacklisted directory, then reopen the file and then select the proper option from the menu(either use the proposed root or choose the interactive root selection)

@yyoncho Thanks Ivan,
I'm trying to remove the blacklisted file using lsp-workspace-remove-blacklist as you suggested and it prompts me to specify the directory. My blacklisted file is in /tmp/testpyth.py, so after entering/tmp/ and hitting enter, in the minibuffer I get [no match] it doesn't accept what I'm entering. What's going on why I can't remove blacklist dir?

Can you try to delete the default message in the prompt and select from the list?

@yyoncho There's not list, I'm using emacs terminal not the gui one.

Ah, I see , is it possible that you have set lsp-auto-guess-root to t? If this is so, can you remove it and retry?

@yyoncho I had that previously but now in my config I only have the following

(use-package lsp-mode
  :ensure t
  :hook (prog-mode . lsp)
  :commands lsp
  :config (setq lsp-log-io t))

(use-package lsp-ui
  :ensure t
  :commands lsp-ui-mode)

(use-package company-lsp
  :ensure t
  :commands company-lsp)

I have removed elpa and any *.elc and every time that I activate the environment and create a new python file it automatically get's blacklisted immediately as soon as I create the file.

@kirk86 How about touching .projectile file in the folder?

@kirk86 How about touching .projectile file in the folder?

Can you explain why this works well? 锛坕 use centaur emacs and got this issue too)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dchneric picture dchneric  路  3Comments

MaskRay picture MaskRay  路  5Comments

axelson picture axelson  路  4Comments

dennismayr picture dennismayr  路  4Comments

bradprob picture bradprob  路  5Comments