Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function information provided by Jedi lacks newlines #200

Closed
imphil opened this issue Mar 28, 2022 · 2 comments · Fixed by #204
Closed

Function information provided by Jedi lacks newlines #200

imphil opened this issue Mar 28, 2022 · 2 comments · Fixed by #204

Comments

@imphil
Copy link

imphil commented Mar 28, 2022

I'm using the Jedi language server in VS Code with the my-python extension and see missing newlines in the function outlines it shows when hovering over a function or in this case, a property.

I'm unsure if that's something that VS Code gets wrong, or the LSP extension sends wrong in the first place; opening the issue here as a starting point, please let me know if I should file it somewhere else.

Steps to reproduce

  • Add this code to a Python file in VS Code:
something = Path('hello.txt')
something.suffix 
  • Hover with your mouse over "suffix"

Actual
The implementation of PurePath.suffix is shown, without newlines.

grafik

Expected
Newlines are shown, as in (abbreviated)

def suffix(self):
    """The final component's last suffix, if any."""

When running the jedi LSP server with verbose output I see the following interaction.

INFO:pygls.protocol:Sending data: {"jsonrpc": "2.0", "id": 813, "result": {"contents": {"kind": "markdown", "value": "```python\ndef suffix(self): \"\"\"The final component's last suffix, if any.\"\"\" name = self.name i = name.rfind('.') if 0 < i < len(name) - 1: return name[i:] else: return ''\n```\n---\n```text\nThe final component's last suffix, if any.\n```\n**Full name:** `pathlib.PurePath.suffix`"}, "range": {"start": {"line": 133, "character": 41}, "end": {"line": 133, "character": 47}}}}

Newlines (\n) are there, but I'm unsure if that's the way things are expected to be according to the LSP?

Version: 1.65.0
Commit: 2e6cb65aa783ab7f17c9d3e709e65c65f8da3bb0
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Embedder: unknown

Extension version: 2022.2.1924087327


Note: I have initially reported this issue with the ms-python VS Code extension and was asked to move it here. With multiple moving parts involved I'm unsure which part "gets it wrong".

@pappasam
Copy link
Owner

@imphil please take a look at the linked PR / screenshot and let me know if that acceptably resolves your issue!

@imphil
Copy link
Author

imphil commented Apr 29, 2022

@pappasam The screenshot looks great, thanks! (I'll get back if the next VS code update arrives and I find remaining issues.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants