0

This is a followup to this question. The answer in there properly answers how to override snippets, but it doesn't address the actual location of the default ones.

Recall the problematic snippet I'm trying to override results in code like

def __init__(self, *args, **kwargs):
 return super().__init__(*args, **kwargs)

when writing def __ini and auto-completing — namely it's a snippet for overriden method autocompletion.

I'm trying to find where exactly this problematic snippet is located (so I have an idea of what and how to override in my own) but I can't seem to find it. I've tried grepping for super() in ~/.vscode/extensions, but unsuccessfully. I also couldn't find an overriding-specific snippet in ~/.vscode/extensions/ms-python.python-2019.11.49689/snippets/python.json. Where else could this particular snippet be located?

Mate de Vita
  • 1,102
  • 12
  • 32
  • Are you sure it's coming from the Python extension and not some other extension you have installed? – Brett Cannon Nov 21 '19 at 18:24
  • I'm not. However, the snippet definitely seems Python-specific, and I can't even find any Python snippets in the extension folders in `~/.vscode/extensions`, save for the ones in the Python extension. Additionally, I ran a `grep` search in `~/.vscode/extensions`, searching for `super()` and did not find anything that would resemble this snippet. I'm not sure how else to find the snippet that's causing this autocompletion. Is there a log file or something I can look at for autocompletion, to see where the snippet is coming from? – Mate de Vita Nov 22 '19 at 14:06
  • I have no idea but it isn't coming from the Python extension (as you can see by looking at the [source](https://github.com/microsoft/vscode-python/blob/master/snippets/python.json). Only other place I know is if you managed to accidentally install it into your personal snippets. – Brett Cannon Nov 22 '19 at 19:50

0 Answers0