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.
2
Answers
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.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 likeeditor.tabCompletion
,editor.acceptSuggestionOnCommitCharacter
andeditor.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:
the
editor.suggest.preview
setting.__init__
method completion for a class, I would guess it could be controlled by the coreeditor.suggest.showMethods
suggestion content type setting.More info might be available at: Editing Python in Visual Studio Code > Autocomplete and IntelliSense