python-language-server
python-language-server copied to clipboard
"python.autoComplete.addBrackets": true adds brackets to imported functions
@astier commented on Wed Jan 30 2019
Environment data
- VS Code version: 1.30.2
- Extension version (available under the Extensions sidebar): 2019.1.0
- OS and version: Arch
- Python version (& distribution if applicable, e.g. Anaconda): 3.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Expected behaviour
Brackets should not be added to imported functions.
Actual behaviour
Brackets are added to imported functions.
Steps to reproduce:
- Create a python file
- Type
from time import tim - Press tab or enter to autocomplete the function time
- See how brackets are added at the end of the time-function
from time import time()
@d3r3kk commented on Thu Jan 31 2019
Verified, thanks for the report @astier!
I can replicate this at my end using latest LS.
Is this a language server issue? It happens for both Language Server as well as for Jedi...
New LS doesn't do that.


This is back after #1241, with the above test case no longer working.
https://github.com/microsoft/python-language-server/blob/master/src/LanguageServer/Impl/Completion/CompletionItemSource.cs#L46-46 - should not be adding () if this is completion in import statement (i.e. coming from GetResultFromImportSearch)
Having this issue right now.