skip to Main Content

Vscode autocompletes my python code: for instance, the super.__init__() call (see image below).
However I was not able to find which extension or setting handles this.
My first guess was that pylance is the extension that does this, however i could not find it in its settings.

My colleagues would like to have the same functionality.

d

2

Answers


  1. I think it’s Pylance. The exact setting might be python.analysis.inlayHints.functionReturnTypes

    The default value for this setting is false so try changing that.

    Login or Signup to reply.
  2. The core VSCode settings for suggestions are found under Text Editor > Suggestions in the settings UI. The core inline suggestions setting is editor.inlineSuggest.enabled then there are various core editor settings around completions / accepting suggestions like editor.tabCompletion, editor.acceptSuggestionOnCommitCharacter and editor.acceptSuggestionOnEnter along with a lot of other detailed settings like general types of content that should be included in suggestions, trigger keys for suggestions, etc.

    Beyond that, it’s highly dependent on what extensions you currently have installed and enabled. You can look for settings specific to the python language with the @lang:python search in the settings UI.

    Specific to the content of your example screenshot:

    • Since you said you "only have autopep8, pylance and the ‘python’ extensions installed". I would suggest the actual content is coming from the pylance language server extension, in which case it would be mostly controlled by the core suggestions settings.
    • Since your screenshot show it as an inline preview, you could check
      the editor.suggest.preview setting.
    • Since you screenshot shows what looks like a suggested __init__ method completion for a class, I would guess it could be controlled by the core editor.suggest.showMethods suggestion content type setting.

    More info might be available at: Editing Python in Visual Studio Code > Autocomplete and IntelliSense

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search