Repository navigation
Symbols stop being returned if filename collides with function name #481
Description
anil (@aniljava) commented on Thu Sep 06 2018
Environment data
- VS Code version: 1.27.1-insider (commit: ....74cfdc)
- Extension version (available under the Extensions sidebar): XXX
- OS and version: 4.15.0-33-generic Bug and test fixes #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.5
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: XXX
Actual behavior
If one of the method name in python file collides with python script file name, the intellisense stops working. Jedi works.
Expected behavior
XXX
Steps to reproduce:
- On a new install, try edit ANYNAME or ANYNAME.py file and create method ANYNAME
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
[Error - 6:25:59 PM] One or more errors occurred. (failed to parse file file:///xxxxxxx/test)
Derek Keeler (@d3r3kk) commented on Tue Sep 11 2018
I cannot reproduce this issue on Ubuntu 18.04 on the latest extension/VSCode-Insiders/Language Server.
anil (@aniljava) could you please remove your language server and try again? Perhaps we've fixed it in a newer version.
- Close all instances of VSCode-Insider.
- Remove the Python Language Server by removing the
languageServerfolder from under the extensions directory.- This is located under your user home folder, here:
~/.vscode-insider/extensions/ms-python-[version]/languageServer
- This is located under your user home folder, here:
- Restart VSCode-Insiders and wait until the Python Language Server re-downloads.
- Retry your scenario.
If it still fails for you
Please send us a gif of what you are seeing, with the Terminal output window open so we can perhaps make more sense out of what is happening.
anil (@aniljava) commented on Mon Sep 17 2018
Followed the steps.
ENVIRNOMENT:

jedi enabled in user settings ("python.jediEnabled": true).

anil (@aniljava) commented on Mon Sep 17 2018
I realized the title is misleading, i assumed jedi turned off is intellisense in general.
Only the Code Outline feature fails only when jedi is turned off and the source file has an element (function name, top level variable name, class definition) with a name matching the file name.
Derek Keeler (@d3r3kk) commented on Thu Sep 20 2018
Verified on Windows 10 using VSCode 1.27.2 with python extension 2018.8.0 and the latest Python Language Server installed.
Create a new workspace, add a folder 'follow' to the workspace, and a file to the 'follow' folder called anyname.py.
Content of anyname.py:
def anyname(name):
print(f'Anyname = ''{name}''')
def some_other_name(other_name):
print(other_name)
anyname('Inaura')
some_other_name('Ayode')From Output -> Python window:
Starting Microsoft Python language server.
Initializing for C:\Program Files (x86)\Python36-32\python.exe
##########Linting Output - pylint##########
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
[Error - 9:21:56 AM] One or more errors occurred. (failed to parse file file:///e:/dev/github/d3r3kk/test/2516_collisions_filename_fnname/anyname.py)
From developer console:
/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1411 INFO no standard startup: not a new window
3/C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1411 ERR Cannot read property 'map' of null: TypeError: Cannot read property 'map' of null
at asCompletionResult (C:\Users\derek\.vscode\extensions\ms-python.python-2018.8.0\node_modules\vscode-languageclient\lib\protocolConverter.js:145:51)
at <anonymous>
No symbols listed at all in the Outline view, and no symbols listed in the breadcrumb view either.
Brett Cannon (@brettcannon) commented on Thu Sep 20 2018
Don Jayamanne (@DonJayamanne) is this our bug or something in the language server?
Brent (@BrentDickinson) commented on Mon Dec 10 2018
Any update on this? It also breaks Find symbol in file. Find symbol in project does seem to work though.


Activity
[-]Intellisense from langauge server fails if filename collides with function name[/-][+]Symbols stop being returned if filename collides with function name[/+]MikhailArkhipov commentedon Feb 15, 2019
Works in new LS. Will be released in beta in upcoming weeks.