pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

`itertools.count` docstring is not shown correctly

Open JelleZijlstra opened this issue 3 years ago • 4 comments

Environment data

  • Language Server version: Pylance 2022.8.30
  • OS and version: macOS 11.6.8
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.10.2

Code Snippet

import itertools
itertools.count(1000)

Repro Steps

  1. Hover over itertools.count

Actual behavior

Screen Shot 2022-08-22 at 2 59 34 PM

Notice how several lines in the code sample are mushed together.

For reference the full docstring is:

Return a count object whose .__next__() method returns consecutive values.

Equivalent to:
    def count(firstval=0, step=1):
        x = firstval
        while 1:
            yield x
            x += step

I suppose this is because the docstring is interpreted as Markdown and therefore adjacent lines are merged.

JelleZijlstra avatar Aug 22 '22 22:08 JelleZijlstra

Although there is no marker for code, we could watch for indentation to determine if it is code.

judej avatar Aug 23 '22 17:08 judej

Can I change the font style for this information? I noticed it to use the same font as my editor when using jedi.

pylance, not monospace and too small, hard to read iShot_2022-09-02_10 00 52

jedi, the same font as editor, easy to read iShot_2022-09-02_10 01 38

Eureka-0 avatar Sep 02 '22 02:09 Eureka-0

@Eureka-0, please open a separate issue on this.

debonte avatar Sep 02 '22 15:09 debonte

@Eureka-0, please open a separate issue on this.

Ok I opened a new issue here #3278.

Eureka-0 avatar Sep 03 '22 02:09 Eureka-0

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 avatar Jun 14 '24 00:06 rchiodo

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 :)

rchiodo avatar Jun 14 '24 00:06 rchiodo