Open MatejVitek opened 4 years ago
As this is a request to basically expand the functionality of snippets which are actually functionality controlled by VS Code, we have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.
Brett,
My question, rather than requesting further functionality, is related more to why these specific snippets (the __xxx__
ones) behave differently to the conventional snippets defined in .../snippets/python.json
. The snippets in python.json
contain tabular indentation (which I'm guessing gets changed by VS Code depending on your settings) and work correctly for me. The __xxx__
ones (ostensibly defined in scrape_module.py
) for me insert a single space, but get different results for other people (see the linked SO thread).
For instance, correctly autocompletes to
But autocompletes to the single-spaced
Additionally, I haven't been able to override the __xxx__
snippets using User snippets (since they don't seem to be defined in the conventional way).
These are the LS completions; it's likely we're not using the indention amount we're parsing out of the file (there's no other place for us to get the user's configured setting).
😂Why not support Jedi? At least now it works better than MPLS.
Jedi supported by the Python extension. It is not LS since it is only a completion engine. Completions is just one of the features of language servers.
Environment data
"python.jediEnabled"
set to; more info microsoft/vscode-python#3977): falsepython.languageServer
setting: /Expected behaviour
Autocomplete respects the indentation settings of the file/project/user settings.
Actual behaviour
Autocompletion of double double underscore methods inserts only a single space in the second line.
Steps to reproduce:
__ini
and press CTRL + Space if the autocomplete dropdown doesn't automatically appear.__init__
option.Other info
This is an issue I've been having for a long time. I've posted several questions about it on SO, and also received answers from at least one person actually working on this extension. However, the problem has not been resolved, so I recently decided to look into it further and it's starting to look more and more like a bug.
The gist of the problem is described in this question and the two linked questions. Basically the
__xxx__
autocomplete templates (snippets?) are ignoring the indentation of the file and inserting a single space indentation in their second line. The latest question highlights several things (in response to Brett Cannon's comments in the linked question):scrape_module.py
in thelanguageServer.x.x.x
directory, although after looking at it, it's unclear where the actual autocompletion body would be defined.Is there a way to make these autocomplete templates respect the indentation of the file or the user settings or override them?