I am using lsp under Python.lsp does not start when a Python file is opened, I have to do M-x lsp for each file I open. Also when I switch from find-file to another file I have to do M-x lsp all over again.
I have followed: https://emacs-lsp.github.io/lsp-mode/page/installation/
(require 'lsp-mode)
(add-hook 'python-mode-hook 'lsp)
(add-hook 'python-mode-hook #'lsp-deferred)
What may be the reason for this? Is there any way to force lsp to start on all Python file whenever I open them?
I observe that when I start running emacs in the ibuffer there is python files that are located under the parent folder where those won't run LSP when I open them. But when I open another file in sub-folder it loads LSP by defualt.
example
emacs -nw ~/home.pyand doM-x find-file~/repo/work.py=>lspthanM-x find-file~/repo/work1.py;lspis enabled automatically right away.But if I do
emacs -nw ~/repo/work.py; thanM-x find-file~/repo/work1.py;lspis not enabled by default for both.
I have following files all has import os in it. I am coming on top of os and do xref-find-definitions.
~/file1.py
.repo
├── file1.py
├── file2.py
└── file3.py
I do emacs -nw ~/file1.py and find-file repo/file1.py and LSP works. But afterwards when I do find-file to repo/file2.py now it does not :-(