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

Docstrings hovers are not formatted correctly in v2024.12.1 #6769

Closed
grintroy opened this issue Dec 13, 2024 · 6 comments
Closed

Docstrings hovers are not formatted correctly in v2024.12.1 #6769

grintroy opened this issue Dec 13, 2024 · 6 comments
Assignees
Labels
needs repro Issue has not been reproduced yet user responded Was "waiting for user response" and they responded

Comments

@grintroy
Copy link

Environment data

  • Pylance version: v2024.12.1
  • OS and version: macOS Sonoma 14.7.1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.1 (global)

Code Snippet

def func(param1: int, param2: int) -> int:
    """This is an example of a function.

    Args:
        param1 (int): The first parameter.
        param2 (int): The second parameter.

    Returns:
        int: `param1` multiplied by `param2`.

    """
    return param1 * param2

Repro Steps

  1. Create a function/class/module with a Google Style docstring.
  2. Hover the mouse over the name of the function/class/module.

Expected behavior

Properly formatted docstring, as per example below. This works in v2024.11.3 and below.

Image

Actual behavior

In v2024.12.1, the docstring is shown without proper formatting.

Image

Logs

2024-12-13 20:29:43.872 [info] [Info  - 20:29:43] (31781) Pylance language server 2024.12.1 (pyright version 1.1.389, commit ce1325fc) starting
2024-12-13 20:29:43.875 [info] [Info  - 20:29:43] (31781) Starting service instance "test"
2024-12-13 20:29:43.903 [info] (31781) No configuration file found.
2024-12-13 20:29:43.903 [info] (31781) No pyproject.toml file found.
2024-12-13 20:29:43.905 [info] [Info  - 20:29:43] (31781) Setting environmentName for service "test": "3.13.1 (global)"
2024-12-13 20:29:43.905 [info] [Info  - 20:29:43] (31781) Setting pythonPath for service "test": "/opt/homebrew/bin/python3"
2024-12-13 20:29:43.905 [info] [Info  - 20:29:43] (31781) No include entries specified; assuming /Users/user1/testproject
2024-12-13 20:29:43.906 [info] [Info  - 20:29:43] (31781) Auto-excluding **/node_modules
2024-12-13 20:29:43.906 [info] [Info  - 20:29:43] (31781) Auto-excluding **/__pycache__
2024-12-13 20:29:43.906 [info] [Info  - 20:29:43] (31781) Auto-excluding **/.*
2024-12-13 20:29:43.935 [info] [Info  - 20:29:43] (31781) Assuming Python version 3.13.1.final.0
2024-12-13 20:29:43.936 [info] (31781) Assuming Python platform Darwin
2024-12-13 20:29:44.000 [info] [Info  - 20:29:44] (31781) Execution environment: 3.13.1 (global)
2024-12-13 20:29:44.000 [info] [Info  - 20:29:44] (31781)   Extra paths:
2024-12-13 20:29:44.000 [info] [Info  - 20:29:44] (31781)     /opt/homebrew/Cellar/opencolorio/2.4.0_1/lib/python3.13/site-packages
2024-12-13 20:29:44.000 [info] [Info  - 20:29:44] (31781)   Python version: 3.13.1.final.0
2024-12-13 20:29:44.000 [info] [Info  - 20:29:44] (31781)   Python platform: Darwin
2024-12-13 20:29:44.000 [info] [Info  - 20:29:44] (31781)   Search paths:
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /Users/user1/testproject
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /opt/homebrew/Cellar/opencolorio/2.4.0_1/lib/python3.13/site-packages
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /Users/user1/testproject/typings
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stubs/...
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/bundled/stubs
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /opt/homebrew/Cellar/opencolorio/2.4.0_1/lib/python3.13/site-packages
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist
2024-12-13 20:29:44.001 [info] [Info  - 20:29:44] (31781)     /opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13
2024-12-13 20:29:44.002 [info] [Info  - 20:29:44] (31781)     /opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/lib-dynload
2024-12-13 20:29:44.002 [info] [Info  - 20:29:44] (31781)     /Users/user1/Library/Python/3.13/lib/python/site-packages
2024-12-13 20:29:44.002 [info] [Info  - 20:29:44] (31781)     /opt/homebrew/lib/python3.13/site-packages
2024-12-13 20:29:44.002 [info] [Info  - 20:29:44] (31781) Adding fs watcher for library directories:
 file:///opt/homebrew/Cellar/opencolorio/2.4.0_1/lib/python3.13/site-packages
file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist
file:///opt/homebrew/Cellar/python%403.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13
file:///Users/user1/Library/Python/3.13/lib/python/site-packages
file:///opt/homebrew/lib/python3.13/site-packages
2024-12-13 20:29:44.002 [info] [Info  - 20:29:44] (31781) Adding fs watcher for directories:
 file:///Users/user1/testproject
2024-12-13 20:29:44.002 [info] (31781) Searching for source files
2024-12-13 20:29:44.004 [info] [Info  - 20:29:44] (31781) Found 1 source file
2024-12-13 20:29:44.004 [info] (31781) Adding fs watcher for files:
 file:///Users/user1/testproject/requirements.txt
file:///Users/user1/testproject/pyproject.toml
2024-12-13 20:29:44.010 [info] (31781) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-12-13 20:29:44.044 [info] (31781) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-12-13 20:29:44.103 [info] (31781) Attempting to resolve using local imports: __builtins__
2024-12-13 20:29:44.105 [info] (31781) [FG] parsing: file:///Users/user1/testproject/test.py (21ms)
2024-12-13 20:29:44.147 [info] (31781) [FG] parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 1ms] (42ms)
2024-12-13 20:29:44.173 [info] (31781) [FG] binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/builtins.pyi (26ms)
2024-12-13 20:29:44.174 [info] (31781) [FG] binding: file:///Users/user1/testproject/test.py (1ms)
2024-12-13 20:29:44.248 [info] [Info  - 20:29:44] (31781) Background analysis(1) root directory: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist
2024-12-13 20:29:44.249 [info] [Info  - 20:29:44] (31781) Background analysis(1) started
2024-12-13 20:29:44.317 [info] (31781) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-12-13 20:29:44.337 [info] (31781) Attempting to resolve using local imports: __builtins__
2024-12-13 20:29:44.338 [info] (31781) [BG(1)] InlayHints range 0:0 - 20:0 at file:///Users/user1/testproject/test.py ...
2024-12-13 20:29:44.338 [info] (31781) [BG(1)]   parsing: file:///Users/user1/testproject/test.py (20ms)
2024-12-13 20:29:44.341 [info] [Info  - 20:29:44] (31781) Indexer background runner(2) root directory: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist (index)
2024-12-13 20:29:44.341 [info] [Info  - 20:29:44] (31781) Indexing(2) started
2024-12-13 20:29:44.379 [info] (31781) [BG(1)]   parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 2ms] (41ms)
2024-12-13 20:29:44.398 [info] (31781) [BG(1)]   binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/builtins.pyi (18ms)
2024-12-13 20:29:44.399 [info] (31781) [BG(1)]   binding: file:///Users/user1/testproject/test.py (1ms)
2024-12-13 20:29:44.412 [info] (31781) [BG(1)]   parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/typing.pyi [fs read 1ms] (8ms)
2024-12-13 20:29:44.424 [info] (31781) [BG(1)]   binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/typing.pyi (12ms)
2024-12-13 20:29:44.430 [info] (31781) [IDX(2)] scan packages file:///Users/user1/testproject ...
2024-12-13 20:29:44.431 [info] (31781) [IDX(2)]   read stdlib indices (11ms)
2024-12-13 20:29:44.441 [info] (31781) [BG(1)]   parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/types.pyi [fs read 1ms] (6ms)
2024-12-13 20:29:44.444 [info] (31781) [BG(1)]   binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/types.pyi (3ms)
2024-12-13 20:29:44.450 [info] (31781) [BG(1)]   parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 1ms] (3ms)
2024-12-13 20:29:44.452 [info] (31781) [BG(1)]   binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (1ms)
2024-12-13 20:29:44.457 [info] (31781) [BG(1)]   parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/abc.pyi [fs read 0ms] (1ms)
2024-12-13 20:29:44.457 [info] (31781) [BG(1)]   binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/abc.pyi (0ms)
2024-12-13 20:29:44.465 [info] (31781) [BG(1)]   parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/typing_extensions.pyi [fs read 0ms] (2ms)
2024-12-13 20:29:44.465 [info] (31781) [BG(1)]   binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/typing_extensions.pyi (1ms)
2024-12-13 20:29:44.471 [info] (31781) [BG(1)] InlayHints range 0:0 - 20:0 at file:///Users/user1/testproject/test.py (153ms)
2024-12-13 20:29:44.472 [info] (31781) [BG(1)] indexing: file:///Users/user1/testproject/test.py [found 1] (1ms)
2024-12-13 20:29:44.472 [info] (31781) Workspace indexing done: file:///Users/user1/testproject/test.py
2024-12-13 20:29:44.490 [info] (31781) [BG(1)] analyzing: file:///Users/user1/testproject/test.py ...
2024-12-13 20:29:44.490 [info] (31781) [BG(1)]   checking: file:///Users/user1/testproject/test.py (17ms)
2024-12-13 20:29:44.490 [info] (31781) [BG(1)] analyzing: file:///Users/user1/testproject/test.py (18ms)
2024-12-13 20:29:44.492 [info] (31781) [BG(1)] SemanticTokens range 0:0 - 20:0 at file:///Users/user1/testproject/test.py (2ms)
2024-12-13 20:29:44.492 [info] (31781) [BG(1)] SemanticTokens full at file:///Users/user1/testproject/test.py (0ms)
2024-12-13 20:29:44.497 [info] (31781) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2024-12-13 20:29:44.630 [info] (31781) [IDX(2)] scan packages file:///Users/user1/testproject (213ms)
2024-12-13 20:29:44.630 [info] [Info  - 20:29:44] (31781) scanned(2) 17 files over 1 exec env
2024-12-13 20:29:44.714 [info] (31781) [IDX(2)] index packages file:///Users/user1/testproject ...
2024-12-13 20:29:44.715 [info] (31781) [IDX(2)]   index execution environment file:///Users/user1/testproject [found 743 in 17 files] (1ms)
2024-12-13 20:29:44.715 [info] (31781) [IDX(2)] index packages file:///Users/user1/testproject [found 743 in 1 exec envs] (11ms)
2024-12-13 20:29:44.715 [info] [Info  - 20:29:44] (31781) indexed(2) 17 files over 1 exec env
2024-12-13 20:29:44.720 [info] [Info  - 20:29:44] (31781) Indexing finished(2).
2024-12-13 20:29:44.801 [info] (31781) [BG(1)] SemanticTokens delta previousResultId:1734121784492 at file:///Users/user1/testproject/test.py (0ms)
2024-12-13 20:29:49.307 [info] (31781) [FG] parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/typing.pyi [fs read 1ms] (12ms)
2024-12-13 20:29:49.316 [info] (31781) [FG] binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/typing.pyi (9ms)
2024-12-13 20:29:49.332 [info] (31781) [FG] parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/types.pyi [fs read 0ms] (7ms)
2024-12-13 20:29:49.334 [info] (31781) [FG] binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/types.pyi (2ms)
2024-12-13 20:29:49.341 [info] (31781) [FG] parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 0ms] (2ms)
2024-12-13 20:29:49.342 [info] (31781) [FG] binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (1ms)
2024-12-13 20:29:49.347 [info] (31781) [FG] parsing: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/abc.pyi [fs read 0ms] (0ms)
2024-12-13 20:29:49.348 [info] (31781) [FG] binding: file:///Users/user1/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/typeshed-fallback/stdlib/abc.pyi (0ms)
2024-12-13 20:29:53.654 [info] (Client) The existing extension didn't exit within 10 seconds. New instance will start, but you might encounter issues.
2024-12-13 20:29:53.655 [info] (Client) Pylance async client (2024.12.1) started with python extension (2024.22.0)
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 13, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Dec 13, 2024

Is this setting enabled?

Image

@rchiodo rchiodo added the waiting for user response Requires more information from user label Dec 13, 2024
@grintroy
Copy link
Author

grintroy commented Dec 13, 2024

@rchiodo this setting wasn't enabled, but now as I enabled it, docstrings look as expected on v2024.12.1
Thanks.

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Dec 13, 2024
@rchiodo rchiodo closed this as completed Dec 13, 2024
@grintroy
Copy link
Author

@rchiodo thanks for closing it, but I'm wondering if the python.analysis.autoImportCompletions setting should be true by default then? Because I wouldn't be able to solve it without creating an issue.

@rchiodo
Copy link
Contributor

rchiodo commented Dec 16, 2024

I assume you mean python.analysis.supportRestructuredText? Auto import is something different.

I think supportRestructuredText should default to true.

@grintroy
Copy link
Author

Apologies, I actually did mean python.analysis.supportRestructuredText. Must have been my mistake when copy-pasting.

Just to note, this setting has got a Preview tag in VS Code settings GUI, and was off by default.

Is it set to on in the development version?

@rchiodo
Copy link
Contributor

rchiodo commented Dec 17, 2024

Our latest prerelease switched this value to default to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet user responded Was "waiting for user response" and they responded
Projects
None yet
Development

No branches or pull requests

3 participants