Skip to content

Docstring popup breaks indented code formatting w/o trailing whitespace #787

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

Closed
ray-grointel opened this issue Feb 15, 2018 · 4 comments
Closed
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@ray-grointel
Copy link

ray-grointel commented Feb 15, 2018

Environment data

VS Code version: 1.2.0
Python Extension version: 2018.1
Python Version: 3.6.3
OS and version: macOS 10.12

Actual behavior

If you hover over this function for its docstring popup, if the trailing whitespace represented by .... is missing, the formatting for the indented code breaks.

def fixtures_dir(request):
    """Return the test fixtures directory under `FIXTURES_DIR`.

    Example::

        from conftest import BASE_DIR
........
        def test_something(fixtures_dir):
            assert fixtures_dir.strpath == BASE_DIR + '/some/path'

    :rtype: py.path.LocalPath
    """

Expected behavior

The indented code formatting inside the docstring popup should not change with/without the trailing whitespace.

Steps to reproduce:

  • Write the function
  • Add/remove the trailing whitespace
  • Hover over the function

Logs

Output from Python output panel

N/A

Output from Console window (Help->Developer Tools menu)

N/A
@patrys
Copy link

patrys commented Feb 15, 2018

VSCode uses Markdown (as opposed to reStructuredText) so this plugin would need to detect RST comments and translate them. Unfortunately until PEP 287 becomes a standard such assumptions are likely to break comments using other formats.

@patrys
Copy link

patrys commented Feb 15, 2018

In case you want to give it a try, the code responsible for handling docstrings is here:

https://github.com/Microsoft/vscode-python/blob/master/src/client/common/markdown/restTextConverter.ts

@DonJayamanne
Copy link

@raymond-grointel
Please could you install the insiders build of the extension from here (Insiders Build) and confirm the problem still exists.
Please note, this isn't the insiders build of VS Code.

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. info-needed Issue requires more information from poster labels Feb 15, 2018
@MikhailArkhipov
Copy link

image

I believe #725 addressed this

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants