GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Feature request: Inlay hint · Issue #397 · python-lsp/python-lsp-server

Feature request: Inlay hint #397

New issue
Copy link
New issue
Copy link
Open
Open
Feature request: Inlay hint#397
Copy link

Description

@fecet
fecet
opened on Jun 22, 2023
Issue body actions

python still don't have avaliable language server support inlay hint, hope pylsp can be the hero 😄

Reacted by Maikol Solís, 金雄镕, Xie Zejian, Nathan Ridge, Jongwook Choi, goingtosleep, Dikesh, Sébastien Iooss, Magnus Larsen, Ítalo Vieira and 21 more

Activity

  1. ccordoba12 commented on Jun 23, 2023

    @ccordoba12
    ccordoba12
    on Jun 23, 2023
    Member
    More actions

    Hey @fecet, thanks for reporting. What do you mean by this?

    Reacted by Shahriar Heidrich
  2. fecet commented on Jun 23, 2023

    @fecet
    fecet
    on Jun 23, 2023
    Author
    More actions

    The inlay hint feature is stabilized in latest LSP Spec 3.17, and implemented in VSCode and Neovim.

    Currently pylsp doesn't support that

  3. Amar1729 commented on Oct 19, 2023

    @Amar1729
    Amar1729
    on Oct 19, 2023
    More actions

    Just as a note - inlay hints are supported by coc-pyright and VSCode's pylance, but notably not pyright (although I don't use either pylance, which requires VSCode, or coc-pyright).

  4. markis commented on Jun 3, 2024

    @markis
    markis
    on Jun 3, 2024
    More actions

    based-pyright supports inlay hints

    Reacted by Amar Paul, Jongwook Choi and Shahriar Heidrich
    Reacted by Shahriar Heidrich
  5. baco commented on Jun 3, 2024

    @baco
    baco
    on Jun 3, 2024
    Contributor
    More actions

    Just as a note - inlay hints are supported by coc-pyright and VSCode's pylance, but notably not pyright.

    I don't know coc-pyright approach, but:

    • VSCode's Pylance is not possible to make it work. It has proprietary licensing and does some checks against Microsoft's marketplace, that even VSCodium staff are having issues in giving the support for running outside VSCode.
    • VSCode's Pyright won't have the feature. Microsoft has chopped that functionality out, in favor of adding that to Pylance. Pylance and Pyright are, some how complimentary. Pyright does only type validation.

    As @markis said, BasedPyright project supports that. And it's even more accessible for Python developers, since doesn't force users to install NodeJS (like coc-pyright o pyright require). It does install NodeJS behind the curtains though, but it's all encapsulated in a virtual environment, transparent to the Python developer.

    Reacted by Amar Paul
  6. Amar1729 commented on Jun 4, 2024

    @Amar1729
    Amar1729
    on Jun 4, 2024
    More actions

    Yeah, at this point i would definitely recommend basedpyright. It didn't exist at the time I made my comment lol

    Reacted by Dionisio E Alonso and Markis Taylor
  7. claytharrison commented on Dec 22, 2024

    @claytharrison
    claytharrison
    on Dec 22, 2024
    More actions

    So there's a plugin that provides this (https://github.com/BoringStuffInc/pylsp-inlay-hints), but as an experimental capability. At least in my case, eglot for Emacs looks for inlayHintProvider as a regular capability, so it doesn't work.

    I would like to adapt the plugin to do that, but I can't tell if there's any way for plugins to provide a new proper capability to pylsp. I only see a hookspec for experimental ones. I'll keep digging, but does anyone have any hints on this?

    EDIT:

    All I have to do to get pylsp-inlay-hints working with eglot is to add inlayHintProvider to pylsp's capabilities in python_lsp.py, i.e.

        def capabilities(self):
            server_capabilities = {
                ...
                "inlayHintProvider": {
                    "resolveProvider": False,
                    "workDoneProgress": True,
                },
                ...
            }
    Reacted by Shahriar Heidrich and Bruno Eduardo
    Reacted by Sam Martin-Brown, Shahriar Heidrich and Bruno Eduardo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.