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

missing new line from dict() help mouse hover #3118

Closed
Devid-Ba opened this issue Aug 1, 2022 · 5 comments
Closed

missing new line from dict() help mouse hover #3118

Devid-Ba opened this issue Aug 1, 2022 · 5 comments
Assignees
Labels
bug Something isn't working docstrings fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@Devid-Ba
Copy link

Devid-Ba commented Aug 1, 2022

Environment data

  • Language Server version: 2022.7.40
  • OS and version: linux x64
  • Python version (and distribution if applicable, e.g. Anaconda):
  • python.analysis.indexing: null
  • python.analysis.typeCheckingMode: basic

Code Snippet

XXX

Repro Steps

  1. hover over dict()

Expected behavior

newline after d = {}.

Actual behavior

Screenshot from 2022-07-31 17-32-36

screen shot from help(dict)
Screenshot from 2022-07-31 17-33-37

Logs

XXX
@heejaechang heejaechang added bug Something isn't working and removed triage-needed labels Aug 1, 2022
@heejaechang
Copy link
Contributor

doc string formatter issue.

@rchiodo rchiodo self-assigned this Dec 7, 2023
@rchiodo
Copy link
Contributor

rchiodo commented May 24, 2024

Looking at this in the context of supporting restructured text. Builtins are not in restructured text format.

The docstring for dict for example is this:

dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
    (key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
    d = {}
    for k, v in iterable:
        d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
    in the keyword argument list.  For example:  dict(one=1, two=2)

Parsing this into rest, it's just one big paragraph.

image

Paragraphs (when shown in Markdown) eliminate extra tabs on purpose. Otherwise something like this wouldn't wrap correctly:

this is a paragraph with extra
   lines that continue after a tab.

@rchiodo
Copy link
Contributor

rchiodo commented May 24, 2024

Builtins may then have to be formatted literally. Or at least special cased to add literal indents.

@rchiodo rchiodo added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Jun 12, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Jun 14, 2024

This issue has been fixed in prerelease version 2024.6.100, which we've just released. You can find the changelog here: CHANGELOG.md

@rchiodo rchiodo closed this as completed Jun 14, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Jun 14, 2024

The fix for this issue is behind an experimental feature flag:

"python.analysis.supportRestructuredText": true

If you want to try out our new restructuredText support, enable this flag. It's behind a flag at the moment until we can make sure it handles all the possible Sphinx/GoogleDoc/Epytext scenarios that customers need. Please log additional issues if this setting isn't working out for you.

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docstrings fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

4 participants