lsp-mode
lsp-mode copied to clipboard
LSP-Org not working with multiple source blocks
Thank you for the bug report
- [X] I am using the latest version of
lsp-mode
related packages. - [X] I checked FAQ and Troubleshooting sections
- [ ] You may also try reproduce the issue using clean environment using the following command:
M-x lsp-start-plain
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