Is there a way in VS Code to see the source of an autocomplete snippet?

Viewed 230

As a followup to this question, in my VS Code I have a bunch of autocomplete snippets I haven't been able to ascertain the source of. All the snippets in the image below give me indentation problems when autocompleting.

enter image description here

autocompletes to

enter image description here

Notice the single space in the second line instead of a tab (or 4 spaces).

However, none of these (clearly python) snippets seem to come from the official Python VSC extension (see above question), or in fact any other extension in ~/.vscode/extensions/. They are also not my own snippets.

Is there some way in VS Code (perhaps by turning on some debugging functionality or checking certain logs) to find out where these snippets are defined so I can fix/override them?

1 Answers

They are generated by the extension ms-python.python-2020.2.64397.

If I disable the extension and restart VSC they are gone.

For me the indentation after expansion is correct. With the difference that def __init__ results in

  def __init__(self):
    super().__init__()

Try clearing your settings, User, Workspace, Folder, and see if that makes a difference.

Searching the extension I found a possible location

~/.vscode/extensions/ms-python.python-2020.2.64397/languageServer.0.5.31/scrape_module.py

In the class Signature (near line 162) there are a couple of class variables, KNOWN_RESTYPES and KNOWN_ARGSPECS that contain some kind of templates. Later on they are modified add_builtin_objects based on the number of arguments to the script.

Related