Skip to content

Turn off snippets for jedi LSP #15858

Closed

Description

@PeterJCLaw

Environment data

  • VS Code version: 1.55.0
  • Extension version (available under the Extensions sidebar): 2021.3.680753044
  • OS and version: Ubuntu 20.04 LTS
  • Python version: 3.7, deadsnakes
  • Type of virtual environment used: virtualenv
  • Value of the python.languageServer setting: JediLSP

Expected behaviour

class Thing: pass

Th<tab> # should complete to:
Thing|     # cursor after completed word

Actual behaviour

class Thing: pass

Th<tab> # should complete to:
Thing(|)  # cursor between completed parens

As far as I can tell this is specific to the JediLSP integration -- changing my language server to Jedi results in the expected completion.

I can maybe see why this is maybe useful if you're planning to construct an instance or calling a function, though there are many other places where callable symbols are used in which you don't want this to happen -- passing them as callbacks and type annotations for example.

Activity

  1. added
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on Apr 5, 2021
  2. karthiknadig commented on Apr 6, 2021

    @karthiknadig
    Member

    Peter Law (@PeterJCLaw) This should be filed on https://github.com/pappasam/jedi-language-server. We don't control this behavior in the extension.

  3. PeterJCLaw commented on Apr 6, 2021

    @PeterJCLaw
    Author

    Ah, thanks, I'd assumed that the insertion text and cursor position was controlled by the extension.

  4. karthiknadig commented on Apr 6, 2021

    @karthiknadig
    Member

    Luciana Abud (@luabud) we have snippets on be default in jediLSP. This seems to be caused by that. Should we turn it off. It is off for the other language server. But we don't have a setting to control this behavior. Need your opinion on should we turn this off by default or provide a setting.

  5. added
    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.
    and removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 6, 2021
  6. changed the title [-]JediLSP completions unexpectedly add parentheses[/-] [+]Provide a way to turn off snippets from jediLSP[/+] on Apr 6, 2021
  7. added
    feature-requestRequest for new features or functionality
    and removed
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on Apr 6, 2021
  8. 23 remaining items

  9. jpkemp commented on Apr 21, 2023

    @jpkemp

    GalaxySnail (@GalaxySnail) patch works perfectly, thank you

  10. PeterJCLaw commented on Apr 21, 2023

    @PeterJCLaw
    Author

    Karthik Nadig (@karthiknadig) would you be open to a PR which flipped the default?

  11. feffy380 commented on Apr 22, 2023

    @feffy380

    GalaxySnail (@GalaxySnail) perhaps a simpler workaround:

    sed -i 's/disableSnippets:!1/disableSnippets:!0/g' ~/.vscode/extensions/ms-python.python-*/out/client/extension.js
    

    This flips the setting that karthiknadig mentioned.

  12. brettcannon commented on May 1, 2023

    @brettcannon
    Member

    Peter Law (@PeterJCLaw) yep, we would be up for a PR to turn off snippets.

  13. br3ndonland commented on May 10, 2023

    @br3ndonland

    Thanks Peter Law (@PeterJCLaw) for both reporting and fixing this issue! 👏

  14. locked as resolved and limited conversation to collaborators on Jun 10, 2023
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

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.community askFeature request that the community expressed interest infeature-requestRequest for new features or functionalityneeds proposalNeed to make some design decisions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions