emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.77k stars 882 forks source link

LSP-Org not working with multiple source blocks #4008

Open Aquan1412 opened 1 year ago

Aquan1412 commented 1 year ago

Thank you for the bug report

Bug description

It is not possible to use multiple source blocks with LSP-org. The language server apparently doesn't connect multiple source blocks to the same session, although the connection the the language server itself (in my case Python wit pylsp) is established successfully for each block. Also, the LSP is working fine for definitions made within one source block.

Steps to reproduce

Create an Org-mode file with at least two separate source blocks. Define a function in the first block, then try to get information about it in the second source block. Alternatively, import a Python module (for example numpy) in the first block, and try to get completions etc in the second block. Any definition created outside of the current block will be unavailable, as if the server doesn't know about it.

Expected behavior

The LSP should know about all source blocks that belong to the same project, the same session or the same tangled file. If I define a function or import a module in a previous source block, I expect the LSP to make these functions and modules available in later source blocks.

Which Language Server did you use?

Python with pylsp.

OS

Linux

Error callstack

No response

Anything else?

The same behaviour (as well as some additional issues) are described in this issue: https://github.com/emacs-lsp/lsp-mode/issues/655#issuecomment-1384931134

amontene823 commented 4 weeks ago

I spent the whole day trying to get this functionality working (multi source block LSP) with no luck.

If anyone can figure this out, I would be willing to donate $.

Thanks