jahan01 commented on Tue Dec 25 2018
When using list comprehension in a method, variables assigned inside the comprehension is listed twice in the symbol list / outline view.
Same happens when isinstance method is used inside a method. Not sure if it is related to same issue as above because it causes all the symbols inside a function scope to be duplicated.
Sample Code:
class Test:
def method(self, arg1, arg2):
var1 = {}
var2 = [_value for _key, _value in arg1.items()]
def method2(self, param1, param2):
test1 = {}
test2 = []
if isinstance(test, dict):
test3 = 1
Note: I have disables jedi, and this happens in microsoft language server. Cannot use jedi right now because, jedi doesnt detect functions with return type annotation specified.
Environment data
- VS Code version: 1.30
- Extension version (available under the Extensions sidebar): 2018.12.1
- OS and version: OSX 10.14.1
- Python version (& distribution if applicable, e.g. Anaconda): 3.6 (Conda)
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Conda
Expected behaviour
No duplicate symbols

Actual behaviour

Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
tarting Microsoft Python language server.
##########Linting Output - mypy##########
##########Linting Output - pylint##########
************* Module test_symbols
Microsoft Python Language Server version 0.1.72.0
Initializing for /Users/me/anaconda3/envs/venv/bin/python
Derek Keeler (@d3r3kk) commented on Thu Jan 17 2019
Thanks for the report jahan01, I can reproduce this issue on the latest version of our extension + language server given the information you have provided.
Reproduced in latest insiders against extension version 2018.12.1:

Sample workspace:
Run conda create -n 3804_dup_sym to get a conda environment setup beforehand.
3804_duplicate_symbols.zip
jahan01 commented on Tue Dec 25 2018
When using list comprehension in a method, variables assigned inside the comprehension is listed twice in the symbol list / outline view.
Same happens when
isinstancemethod is used inside a method. Not sure if it is related to same issue as above because it causes all the symbols inside a function scope to be duplicated.Sample Code:
Note: I have disables jedi, and this happens in microsoft language server. Cannot use jedi right now because, jedi doesnt detect functions with return type annotation specified.
Environment data
Expected behaviour
No duplicate symbols
Actual behaviour
Logs
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Derek Keeler (@d3r3kk) commented on Thu Jan 17 2019
Thanks for the report jahan01, I can reproduce this issue on the latest version of our extension + language server given the information you have provided.
Reproduced in latest insiders against extension version 2018.12.1:
Sample workspace:
Run
conda create -n 3804_dup_symto get a conda environment setup beforehand.3804_duplicate_symbols.zip