Skip to content

Intellisense tooltip applies text formatting on source code #2225

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
Spanfile opened this issue Jul 22, 2018 · 6 comments
Closed

Intellisense tooltip applies text formatting on source code #2225

Spanfile opened this issue Jul 22, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@Spanfile
Copy link

Environment data

  • VS Code version: 1.25.1
  • Extension version (available under the Extensions sidebar): 2018.7.0
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: NA

Actual behavior

The tooltip applies text formatting to the displayed code, e.g. wrapping text in underscores italicizes it.
image

Expected behavior

The tooltip shows the code as it is written in the source.

Steps to reproduce:

  1. Use the mypy linter
  2. Define a variable in a class, using self, with underscores in its name
  3. Assign a type to the variable with a type hint
  4. Hover over it to see the Intellisense tooltip

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

None

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

None
@DonJayamanne
Copy link

Looks like the problem is, the text is tested as markdown text.
We might have to escape the text.

@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug needs verification labels Jul 23, 2018
@DonJayamanne
Copy link

@Spanfile Please could you provide some complete sample code.
I cannot replicate this at my end.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels Jul 30, 2018
@Spanfile
Copy link
Author

Spanfile commented Aug 1, 2018

@DonJayamanne A minimal sample:

class Test:
    def __init__(self):
        self._a_b: int = None

Python workspace settings:

{
    "python.pythonPath": "${workspaceFolder}\\venv\\Scripts\\python.exe",
    "python.linting.pylintEnabled": false,
    "python.linting.mypyEnabled": true,
    "python.jediEnabled": false
}

@DonJayamanne DonJayamanne added needs verification and removed info-needed Issue requires more information from poster labels Aug 1, 2018
@brettcannon
Copy link
Member

For Jedi there is no issue:

capture

For the new language server there is a problem:

capture

@brettcannon brettcannon added needs PR important Issue identified as high-priority and removed needs verification labels Aug 1, 2018
@MikhailArkhipov
Copy link

MikhailArkhipov commented Aug 6, 2018

Yeah, tooltip is markdown so _a_b becomes italic

@luabud
Copy link
Member

luabud commented Sep 11, 2019

Fixed upstream (microsoft/python-language-server#17)

@luabud luabud closed this as completed Sep 11, 2019
@ghost ghost removed the needs PR label Sep 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

5 participants