Reproduction is simple. Make two files in the same directory.
foo.py:
def bar():
"Docstring"
pass
__init__.py:
from .foo import bar
from . import foo
It is then easily verified, in editing a new line of __init__.py, that the language server will not provide documentation/signature help for bar, either on its own or foo.bar as a member of the relative imported module. Nor will any completion of bar (or any other member of foo) be provided when requested, with the cursor as |, in:
Both the imports are demonstrated in the example, but either can reproduce the relevant variant of the bug.
A completion of bar alone is available within the example __init__.py when from .foo import bar is present, but the completion erroneously describes it as a module rather than a function. Similarly, foo is completed as a module after from . import foo, but is treated as having no members.
If using e.g. linting with pylint, this still works and recognises bar correctly, for instance bar(1) is identified as having too many positional arguments, so this is completion specific, with completion configured to be provided through this language server by jedi in this case.
This is very strange, as the underlying jedi seems to work fine, through either jedi-vim or jedi-language-server, there is no such issue, so this is python-lsp-server-specific.
This is using python-lsp-server==1.14.0, jedi==0.19.2, on python 3.14.2. Can add more relevant details and configuration if needed.
Reproduction is simple. Make two files in the same directory.
foo.py:__init__.py:It is then easily verified, in editing a new line of
__init__.py, that the language server will not provide documentation/signature help forbar, either on its own orfoo.baras a member of the relative imported module. Nor will any completion ofbar(or any other member offoo) be provided when requested, with the cursor as|, in:from .foo import |foo.|Both the imports are demonstrated in the example, but either can reproduce the relevant variant of the bug.
A completion of
baralone is available within the example__init__.pywhenfrom .foo import baris present, but the completion erroneously describes it as a module rather than a function. Similarly,foois completed as a module afterfrom . import foo, but is treated as having no members.If using e.g. linting with pylint, this still works and recognises
barcorrectly, for instancebar(1)is identified as having too many positional arguments, so this is completion specific, with completion configured to be provided through this language server byjediin this case.This is very strange, as the underlying
jediseems to work fine, through eitherjedi-vimorjedi-language-server, there is no such issue, so this ispython-lsp-server-specific.This is using
python-lsp-server==1.14.0,jedi==0.19.2, on python 3.14.2. Can add more relevant details and configuration if needed.