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

Pylance renders inlay parameter hints with type hint color #5278

Closed
ian-h-chamberlain opened this issue Dec 18, 2023 · 7 comments
Closed

Pylance renders inlay parameter hints with type hint color #5278

ian-h-chamberlain opened this issue Dec 18, 2023 · 7 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet

Comments

@ian-h-chamberlain
Copy link

I wasn't able to find any other issues about this specifically — most seem to do with the actual contents of the inlay hint rather than how it's presented to the editor.

Environment data

  • Language Server version: 2023.12.100
  • OS and version: Darwin x64 22.6.0
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10 virtualenv from homebrew. I can provide more details if necessary

Code Snippet

"""
Showing inlay hint colors
"""

def foo(bar: str) -> str:
    return bar
    

z = foo("xyz")

Repro Steps

  1. Configure Pylance with "python.analysis.inlayHints.callArgumentNames": "all"
  2. Configure VSCode with different colors for inlay "type hints" vs "parameter hints", e.g.
    {
      "editorInlayHint.foreground": "#f8f8f2a0", // white/gray
      "editorInlayHint.parameterForeground": "#fd951fa0", // orangeish brown
      "editorInlayHint.typeForeground": "#a6e22ea0", // green
      "editorInlayHint.background": "#00000000",
    }

Expected behavior

Type hints are rendered with editorInlayHint.typeForeground (green, in my case) and parameter hints are rendered with editorInlayHint.parameterForeground (orange/brown). I'm not sure about the = sign for parameter hints, maybe just the default editorInlayHint.foreground?

Actual behavior

Both hint types (including the =) are rendered as editorInlayHint.typeForeground:

Screenshot 2023-12-18 at 15 08 26

Logs

Pasted trace logs
2023-12-18 15:04:09.935 [info] (Client) Pylance async client (2023.12.100) started with python extension (2023.22.1)
2023-12-18 15:04:11.097 [info] [Info  - 3:04:11 PM] (78565) Pylance language server 2023.12.100 (pyright c93d9ebf) starting
2023-12-18 15:04:11.097 [info] [Info  - 3:04:11 PM] (78565) Server root directory: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist
2023-12-18 15:04:11.143 [info] [Info  - 3:04:11 PM] (78565) Starting service instance "<default>"
2023-12-18 15:04:11.193 [info] [Info  - 3:04:11 PM] (78565) Setting pythonPath for service "<default>": "/Users/ichamberlain/.pyenv/versions/3.10.6/envs/thefuck/bin/python"
2023-12-18 15:04:11.194 [info] [Info  - 3:04:11 PM] (78565) Setting environmentName for service "<default>": "3.10.13 (thefuck venv)"
2023-12-18 15:04:11.315 [info] [Info  - 3:04:11 PM] (78565) Assuming Python version 3.10
2023-12-18 15:04:11.623 [info] [Info  - 3:04:11 PM] (78565) No source files found.
2023-12-18 15:04:11.706 [info] [Info  - 3:04:11 PM] (78565) Setting pythonPath for service "<default>": "/Users/ichamberlain/.pyenv/versions/3.10.6/envs/thefuck/bin/python"
2023-12-18 15:04:11.706 [info] [Info  - 3:04:11 PM] (78565) Setting environmentName for service "<default>": "3.10.13 (thefuck venv)"
2023-12-18 15:04:11.824 [info] [Info  - 3:04:11 PM] (78565) Assuming Python version 3.10
2023-12-18 15:04:12.022 [info] [Info  - 3:04:12 PM] (78565) No source files found.
2023-12-18 15:04:19.208 [info] (78565) No pyproject.toml file found.
2023-12-18 15:04:19.209 [info] [Info  - 3:04:19 PM] (78565) Setting pythonPath for service "<default>": "/Users/ichamberlain/.pyenv/versions/3.10.6/envs/thefuck/bin/python"
2023-12-18 15:04:19.214 [info] [Info  - 3:04:19 PM] (78565) Setting environmentName for service "<default>": "3.10.13 (thefuck venv)"
2023-12-18 15:04:19.486 [info] [Info  - 3:04:19 PM] (78565) Assuming Python version 3.10
2023-12-18 15:04:19.486 [info] (78565) Assuming Python platform Darwin
2023-12-18 15:04:19.966 [info] [Info  - 3:04:19 PM] (78565) Search paths for <default>
2023-12-18 15:04:19.966 [info] [Info  - 3:04:19 PM] (78565)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib
2023-12-18 15:04:19.967 [info] [Info  - 3:04:19 PM] (78565)   typings
2023-12-18 15:04:19.967 [info] [Info  - 3:04:19 PM] (78565)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stubs/...
2023-12-18 15:04:19.967 [info] [Info  - 3:04:19 PM] (78565)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/bundled/stubs
2023-12-18 15:04:19.967 [info] [Info  - 3:04:19 PM] (78565)   /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10
2023-12-18 15:04:19.967 [info] [Info  - 3:04:19 PM] (78565)   /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload
2023-12-18 15:04:19.968 [info] [Info  - 3:04:19 PM] (78565)   /usr/local/Cellar/thefuck/3.32/libexec/lib/python3.10/site-packages
2023-12-18 15:04:19.968 [info] [Info  - 3:04:19 PM] (78565)   /usr/local/lib/python3.10/site-packages
2023-12-18 15:04:19.968 [info] [Info  - 3:04:19 PM] (78565) Adding fs watcher for library directories:
 /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10
/usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload
/usr/local/Cellar/thefuck/3.32/libexec/lib/python3.10/site-packages
/usr/local/lib/python3.10/site-packages
2023-12-18 15:04:19.968 [info] (78565) Searching for source files
2023-12-18 15:04:19.969 [info] [Info  - 3:04:19 PM] (78565) No source files found.
2023-12-18 15:04:19.971 [info] (78565) [IDX(FG)] index libraries  (index) ...
2023-12-18 15:04:19.971 [info] (78565) [IDX(FG)]   read stdlib indices (0ms)
2023-12-18 15:04:19.975 [info] (78565) [IDX(FG)] index libraries  (index) [succeed] (4ms)
2023-12-18 15:04:19.976 [info] (78565) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:20.232 [info] (78565) [BG(1)] getSemanticTokens delta previousResultId:1702929853241 at untitled:Untitled-1 ...
2023-12-18 15:04:20.232 [info] (78565) [BG(1)]   parsing: untitled:Untitled-1 (225ms)
2023-12-18 15:04:20.409 [info] (78565) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 1ms] (177ms)
2023-12-18 15:04:20.440 [info] (78565) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi (30ms)
2023-12-18 15:04:20.440 [info] (78565) [BG(1)]   binding: untitled:Untitled-1 (1ms)
2023-12-18 15:04:20.523 [info] (78565) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing.pyi [fs read 12ms] (81ms)
2023-12-18 15:04:20.531 [info] (78565) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing.pyi (8ms)
2023-12-18 15:04:20.539 [info] (78565) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing_extensions.pyi [fs read 1ms] (8ms)
2023-12-18 15:04:20.542 [info] (78565) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing_extensions.pyi (2ms)
2023-12-18 15:04:20.627 [info] (78565) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 9ms] (80ms)
2023-12-18 15:04:20.630 [info] (78565) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (3ms)
2023-12-18 15:04:20.666 [info] (78565) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/types.pyi [fs read 3ms] (37ms)
2023-12-18 15:04:20.672 [info] (78565) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/types.pyi (6ms)
2023-12-18 15:04:20.681 [info] (78565) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/abc.pyi [fs read 0ms] (2ms)
2023-12-18 15:04:20.682 [info] (78565) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/abc.pyi (0ms)
2023-12-18 15:04:20.686 [info] (78565) [BG(1)] getSemanticTokens delta previousResultId:1702929853241 at untitled:Untitled-1 (680ms)
2023-12-18 15:04:20.689 [info] (78565) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (2ms)
2023-12-18 15:04:20.824 [info] (78565) [BG(1)] analyzing: untitled:Untitled-1 ...
2023-12-18 15:04:20.824 [info] (78565) [BG(1)]   checking: untitled:Untitled-1 (135ms)
2023-12-18 15:04:20.825 [info] (78565) [BG(1)] analyzing: untitled:Untitled-1 (135ms)
2023-12-18 15:04:20.938 [info] (78565) [FG] parsing: untitled:Untitled-1 (112ms)
2023-12-18 15:04:21.267 [info] (78565) [FG] parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 17ms] (329ms)
2023-12-18 15:04:21.699 [info] (78565) [FG] binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi (56ms)
2023-12-18 15:04:21.699 [info] (78565) [FG] binding: untitled:Untitled-1 (0ms)
2023-12-18 15:04:21.699 [info] (78565) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:22.530 [info] (78565) WorkspaceFactory 0 clear
2023-12-18 15:04:35.445 [info] (Client) Pylance async client (2023.12.100) started with python extension (2023.22.1)
2023-12-18 15:04:37.677 [info] [Info  - 3:04:37 PM] (78791) Pylance language server 2023.12.100 (pyright c93d9ebf) starting
2023-12-18 15:04:38.908 [info] [Info  - 3:04:38 PM] (78791) Server root directory: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist
2023-12-18 15:04:39.627 [info] [Info  - 3:04:39 PM] (78791) Starting service instance "<default>"
2023-12-18 15:04:40.533 [info] (78791) No pyproject.toml file found.
2023-12-18 15:04:40.551 [info] [Info  - 3:04:40 PM] (78791) Setting pythonPath for service "<default>": "/Users/ichamberlain/.pyenv/versions/3.10.6/envs/thefuck/bin/python"
2023-12-18 15:04:40.630 [info] [Info  - 3:04:40 PM] (78791) Setting environmentName for service "<default>": "3.10.13 (thefuck venv)"
2023-12-18 15:04:40.834 [info] [Info  - 3:04:40 PM] (78791) Assuming Python version 3.10
2023-12-18 15:04:40.845 [info] (78791) Assuming Python platform Darwin
2023-12-18 15:04:41.219 [info] [Info  - 3:04:41 PM] (78791) Search paths for <default>
2023-12-18 15:04:41.220 [info] [Info  - 3:04:41 PM] (78791)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib
2023-12-18 15:04:41.220 [info] [Info  - 3:04:41 PM] (78791)   typings
2023-12-18 15:04:41.220 [info] [Info  - 3:04:41 PM] (78791)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stubs/...
2023-12-18 15:04:41.220 [info] [Info  - 3:04:41 PM] (78791)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/bundled/stubs
2023-12-18 15:04:41.221 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10
2023-12-18 15:04:41.221 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload
2023-12-18 15:04:41.222 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/Cellar/thefuck/3.32/libexec/lib/python3.10/site-packages
2023-12-18 15:04:41.222 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/lib/python3.10/site-packages
2023-12-18 15:04:41.223 [info] [Info  - 3:04:41 PM] (78791) Adding fs watcher for library directories:
 /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10
/usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload
/usr/local/Cellar/thefuck/3.32/libexec/lib/python3.10/site-packages
/usr/local/lib/python3.10/site-packages
2023-12-18 15:04:41.223 [info] (78791) Searching for source files
2023-12-18 15:04:41.224 [info] [Info  - 3:04:41 PM] (78791) No source files found.
2023-12-18 15:04:41.225 [info] (78791) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:41.225 [info] (78791) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:41.308 [info] (78791) [IDX(FG)] index libraries  (index) ...
2023-12-18 15:04:41.308 [info] (78791) [IDX(FG)]   read stdlib indices (79ms)
2023-12-18 15:04:41.328 [info] (78791) [IDX(FG)] index libraries  (index) [succeed] (86ms)
2023-12-18 15:04:41.395 [info] (78791) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:41.396 [info] (78791) Server settings returned for workspace: : {
  "autoSearchPaths": true,
  "disableLanguageServices": false,
  "openFilesOnly": true,
  "useLibraryCodeForTypes": true,
  "watchForSourceChanges": true,
  "watchForLibraryChanges": true,
  "watchForConfigChanges": true,
  "typeCheckingMode": "basic",
  "diagnosticSeverityOverrides": {
    "reportShadowedImports": "warning"
  },
  "logLevel": "log",
  "autoImportCompletions": false,
  "includeUserSymbolsInAutoImport": true,
  "indexing": false,
  "completeFunctionParens": false,
  "enableExtractCodeAction": true,
  "indexOptions": {
    "packageDepths": [
      [
        "sklearn",
        2,
        false
      ],
      [
        "matplotlib",
        2,
        false
      ],
      [
        "scipy",
        2,
        false
      ],
      [
        "django",
        2,
        false
      ],
      [
        "flask",
        2,
        false
      ],
      [
        "fastapi",
        2,
        false
      ]
    ],
    "userFileIndexingLimit": 2000
  },
  "variableInlayTypeHints": true,
  "callArgumentNameInlayHints": "all",
  "functionReturnInlayTypeHints": true,
  "pytestParametersInlayTypeHints": true,
  "importFormat": "absolute",
  "includeFileSpecs": [],
  "excludeFileSpecs": [],
  "ignoreFileSpecs": [],
  "formatOnType": true,
  "taskListTokens": [],
  "addImportExactMatchOnly": false,
  "enablePytestSupport": true,
  "enablePytestExtra": false,
  "gotoDefinitionInStringLiteral": false,
  "remapDiagnostics": false,
  "intelliCodeEnabled": true,
  "pythonPath": "/Users/ichamberlain/.pyenv/versions/3.10.6/envs/thefuck/bin/python",
  "pythonEnvironmentName": "3.10.13 (thefuck venv)",
  "fixAll": [],
  "extraCommitChars": true,
  "notebookRunStartupCommands": "",
  "editorIndentConfig": {
    "defaultTabSequence": "    ",
    "tabSize": 4
  }
}
2023-12-18 15:04:41.409 [info] (78791) No pyproject.toml file found.
2023-12-18 15:04:41.409 [info] [Info  - 3:04:41 PM] (78791) Setting pythonPath for service "<default>": "/Users/ichamberlain/.pyenv/versions/3.10.6/envs/thefuck/bin/python"
2023-12-18 15:04:41.409 [info] [Info  - 3:04:41 PM] (78791) Setting environmentName for service "<default>": "3.10.13 (thefuck venv)"
2023-12-18 15:04:41.629 [info] [Info  - 3:04:41 PM] (78791) Assuming Python version 3.10
2023-12-18 15:04:41.632 [info] (78791) Assuming Python platform Darwin
2023-12-18 15:04:41.882 [info] [Info  - 3:04:41 PM] (78791) Search paths for <default>
2023-12-18 15:04:41.883 [info] [Info  - 3:04:41 PM] (78791)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib
2023-12-18 15:04:41.883 [info] [Info  - 3:04:41 PM] (78791)   typings
2023-12-18 15:04:41.884 [info] [Info  - 3:04:41 PM] (78791)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stubs/...
2023-12-18 15:04:41.884 [info] [Info  - 3:04:41 PM] (78791)   /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/bundled/stubs
2023-12-18 15:04:41.884 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10
2023-12-18 15:04:41.884 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload
2023-12-18 15:04:41.884 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/Cellar/thefuck/3.32/libexec/lib/python3.10/site-packages
2023-12-18 15:04:41.884 [info] [Info  - 3:04:41 PM] (78791)   /usr/local/lib/python3.10/site-packages
2023-12-18 15:04:41.885 [info] [Info  - 3:04:41 PM] (78791) Adding fs watcher for library directories:
 /usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10
/usr/local/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload
/usr/local/Cellar/thefuck/3.32/libexec/lib/python3.10/site-packages
/usr/local/lib/python3.10/site-packages
2023-12-18 15:04:41.885 [info] (78791) Searching for source files
2023-12-18 15:04:41.885 [info] [Info  - 3:04:41 PM] (78791) No source files found.
2023-12-18 15:04:41.887 [info] (78791) [IDX(FG)] index libraries  (index) ...
2023-12-18 15:04:41.888 [info] (78791) [IDX(FG)]   read stdlib indices (0ms)
2023-12-18 15:04:41.893 [info] (78791) [IDX(FG)] index libraries  (index) [succeed] (6ms)
2023-12-18 15:04:41.973 [info] (78791) [FG] parsing: untitled:Untitled-1 (76ms)
2023-12-18 15:04:42.238 [info] (78791) [FG] parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 4ms] (261ms)
2023-12-18 15:04:42.315 [info] (78791) [FG] binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi (75ms)
2023-12-18 15:04:42.316 [info] (78791) [FG] binding: untitled:Untitled-1 (1ms)
2023-12-18 15:04:42.326 [info] (78791) [BG(1)] analyzing: untitled:Untitled-1 ...
2023-12-18 15:04:42.326 [info] (78791) [BG(1)]   parsing: untitled:Untitled-1 (211ms)
2023-12-18 15:04:42.326 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 17ms] (275ms)
2023-12-18 15:04:42.326 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi (74ms)
2023-12-18 15:04:42.326 [info] (78791) [BG(1)]   binding: untitled:Untitled-1 (1ms)
2023-12-18 15:04:42.326 [info] (78791) [BG(1)]   checking: untitled:Untitled-1 (40ms)
2023-12-18 15:04:42.327 [info] (78791) [BG(1)] analyzing: untitled:Untitled-1 (606ms)
2023-12-18 15:04:42.330 [info] (78791) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:42.373 [info] (78791) pytest configurations: {"message":"request cancelled","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:42.528 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 ...
2023-12-18 15:04:42.528 [info] (78791) [BG(1)]   parsing: untitled:Untitled-1 (153ms)
2023-12-18 15:04:42.723 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi [fs read 1ms] (195ms)
2023-12-18 15:04:42.752 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/builtins.pyi (30ms)
2023-12-18 15:04:42.753 [info] (78791) [BG(1)]   binding: untitled:Untitled-1 (0ms)
2023-12-18 15:04:42.832 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing.pyi [fs read 3ms] (73ms)
2023-12-18 15:04:42.857 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing.pyi (24ms)
2023-12-18 15:04:42.876 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing_extensions.pyi [fs read 2ms] (12ms)
2023-12-18 15:04:42.883 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/typing_extensions.pyi (6ms)
2023-12-18 15:04:42.933 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi [fs read 1ms] (24ms)
2023-12-18 15:04:42.936 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi (5ms)
2023-12-18 15:04:42.986 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/types.pyi [fs read 19ms] (47ms)
2023-12-18 15:04:42.997 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/types.pyi (14ms)
2023-12-18 15:04:43.150 [info] (78791) [BG(1)]   parsing: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/abc.pyi [fs read 1ms] (4ms)
2023-12-18 15:04:43.151 [info] (78791) [BG(1)]   binding: /Users/ichamberlain/.vscode/extensions/ms-python.vscode-pylance-2023.12.100/dist/typeshed-fallback/stdlib/abc.pyi (1ms)
2023-12-18 15:04:43.151 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (667ms)
2023-12-18 15:04:43.152 [info] (78791) [BG(1)] getSemanticTokens full at untitled:Untitled-1 (4ms)
2023-12-18 15:04:43.156 [info] (78791) [BG(1)] getSemanticTokens range 0:0 - 8:14 at untitled:Untitled-1 (1ms)
2023-12-18 15:04:43.157 [info] (78791) [BG(1)] analyzing: untitled:Untitled-1 ...
2023-12-18 15:04:43.158 [info] (78791) [BG(1)]   checking: untitled:Untitled-1 (32ms)
2023-12-18 15:04:43.158 [info] (78791) [BG(1)] analyzing: untitled:Untitled-1 (32ms)
2023-12-18 15:04:43.160 [info] (78791) pytest configurations: {"message":"script","classes":["Test"],"files":["test_*.py","*_test.py"],"functions":["test"]}
2023-12-18 15:04:57.956 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (1ms)
2023-12-18 15:04:58.346 [info] (78791) [BG(1)] getSemanticTokens delta previousResultId:1702929883043 at untitled:Untitled-1 (1ms)
2023-12-18 15:05:23.197 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (1ms)
2023-12-18 15:05:58.529 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (1ms)
2023-12-18 15:06:03.377 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (1ms)
2023-12-18 15:06:27.983 [info] (78791) [BG(1)] getInlayHints range 0:0 - 8:14 at untitled:Untitled-1 (1ms)

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Dec 18, 2023
@ian-h-chamberlain ian-h-chamberlain changed the title Pylance reports inlay parameter hints as type hints Pylance renders inlay parameter hints with type hint color Dec 18, 2023
@bschnurr
Copy link
Member

bschnurr commented Dec 18, 2023

thanks for logging an issue. I think we just need to set the InlayHintKind for the parameter case to not be type but parameter

@bschnurr bschnurr assigned bschnurr and unassigned rchiodo Dec 18, 2023
@bschnurr bschnurr added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Dec 18, 2023
@debonte debonte reopened this Dec 20, 2023
@debonte
Copy link
Contributor

debonte commented Dec 21, 2023

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

@debonte debonte closed this as completed Dec 21, 2023
@luan12adz3

This comment was marked as duplicate.

@ian-h-chamberlain
Copy link
Author

Hi, thanks for the quick turnaround! Unfortunately this change seems to have had the side effect of marking some types as though they were parameter hints. This example uses a fixture, I'm not sure if there are other cases where type hints are shown inline like that:

Screenshot 2023-12-21 at 15 41 46

vs the current stable release:

Screenshot 2023-12-21 at 15 42 57

@bschnurr
Copy link
Member

ya there is currently only two options for InlayHintKind... type or parameter.. i could change pytest ones back to type

@ian-h-chamberlain
Copy link
Author

ya there is currently only two options for InlayHintKind... type or parameter.. i could change pytest ones back to type

I think that makes sense, since those hints are showing the types of the variables rather than parameter names. For example, another LSP implementation that uses type for elided type annotations is rust-analyzer (in particular I think the closest parallel is s: String in this example):

Screenshot 2023-12-22 at 16 45 03

Should I open a new issue, or is reusing this one okay? Thanks again!

@bschnurr
Copy link
Member

bschnurr commented Jan 2, 2024

fixed pytest parameter back to type.. fixed next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

5 participants