ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.91k stars 458 forks source link

When using gD or ctrl+] jump to definition, lsp cannot discover the third-party module of python #1100

Closed Qejun closed 9 months ago

Qejun commented 9 months ago

Version confirmation

Following prerequisites

Not a user config issue

Neovim version

NVIM v0.9.4 Build type: RelWithDebInfo LuaJIT 2.1.1696883897

Operating system/version

Both win10 and debian12 have same problem

Terminal name/version

PowerShell 7.3.3

$TERM environment variable

No response

Branch info

main (Default/Latest)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

屏幕截图 2023-12-16 214106 This is a working program and all modules are installed correctly When using gD or ctrl+] jump to definition, lsp cannot discover the third-party module of python I imported the sys module, ui_main module and pyside6 module. The sys module and ui_main module can jump normally but the pyside6 module cannot be detected. sys module:Python's own module, this type of module can be jumped ui_main: Module in the current working directory, this type of module can be jumped pyside6:Modules installed through pip, this type of module cannot be discovered

Expected behavior

Can jump to definition

Actual behavior

Can't jump

Additional information

No response

ayamir commented 9 months ago

Have you activated the corresponding venv before you edited this file?

Qejun commented 9 months ago

Where can I check activated the corresponding venv? image image

ayamir commented 9 months ago

If these 3rd party packages were installed under system-wide, you should edit C:\Users\YOUR_USER_NAME\AppData\Local\nvim-data\mason\packages\python-lsp-server\venv\pyvenv.cfg and set include-system-site-packages = true instead of false.

Qejun commented 9 months ago

If these 3rd party packages were installed under system-wide, you should edit C:\Users\YOUR_USER_NAME\AppData\Local\nvim-data\mason\packages\python-lsp-server\venv\pyvenv.cfg and set include-system-site-packages = true instead of false.

very thankful.The problem is solved.It works fine now image