Code Outline: Loading document symbols #2468
Description
Issue Type: Bug
-
VS Code version:
1.26.1 (Commit: 493869ee8e8a846b0855873886fc79d480d342de) -
Extensions (1)
python | ms- | 2018.7.1 -- | -- | -- -
OS and version:
Ubuntu 18.04.1 LTS Kernel Linux 4.15.0-33-generic x86_64 -
Python version
Anaconda, Inc. Python 2.7.15 (base)
Actual behavior
I did not notice until later, that VS Code now has the code outline/code structure view. When I tried to expand it, it said "Loading document symbols for '<current_file_name>.py"
Screenshot :
Expected behavior
The code outline should parse the currently open code file and populate the symbols regardless if the user has just created code file or it already existed. The code might or might not compile but code outline should be able to enlist all the symbols in the order they appear in the code. The user should also be able to sort this list alphabetically.
Steps to reproduce:
-
I tried to open an existing file on a current project, created with VS Code to start with.
-
Next, I expanded the "Outline" window by clicking on it.
-
Not sure it matters, but I gave my consent when VS Code asked me to install/update pylint. It executed this command for me:
pip install -U "pylint<2.0.0"
Logs
There is nothing in the output or terminal window. Pylint did notice the following issues with my code. I do not think those are relevant to this issue, but I have included them here, anyway.
- W1401: Anomalous backslash in a string: '\D.' String constant might be missing an r prefix.
- W1401: Anomalous backslash in a string: '\P.' String constant might be missing an r prefix.
- W1401: Anomalous backslash in a string: '\s.' String constant might be missing an r prefix.
- W1401: Anomalous backslash in a string: '\S.' String constant might be missing an r prefix.
VS Code version: Code 1.26.1 (493869ee8e8a846b0855873886fc79d480d342de, 2018-08-16T18:34:20.517Z)
OS version: Linux x64 4.15.0-33-generic
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-2820QM CPU @ 2.30GHz (8 x 2849) |
| GPU Status | 2d_canvas: enabled checker_imaging: disabled_off flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software rasterization: disabled_software video_decode: unavailable_software video_encode: unavailable_software webgl: enabled webgl2: enabled |
| Load (avg) | 7, 3, 2 |
| Memory (System) | 15.58GB (8.53GB free) |
| Process Argv | /usr/share/code/code --unity-launch |
| Screen Reader | no |
| VM | 0% |
Extensions (1)
| Extension | Author (truncated) | Version |
|---|---|---|
| python | ms- | 2018.7.1 |

Activity
aarshtalati commentedon Aug 30, 2018
Alexandre Feblot (@afeblot) I did my research before reporting this bug. I did try to start typing (in fact, wrote a 15 line function) and still, the symbols did not appear. I am guessing that the Python language server might be unreachable? No idea.
brettcannon commentedon Aug 31, 2018
Unfortunately you didn't fill out our issue template, @ablaze8 , so we don't know if the language server printed anything to the "Output" panel that could be relevant. Could you also provide a code sample? And lastly, can you try a development build to see if the latest language server fixes the issue for you?
aarshtalati commentedon Sep 1, 2018
Brett Cannon (@brettcannon) :
Unfortunately, I used the VS code's Help --> Report Issue to submit this issue. I left both checkboxes checked (Include my system information and Include my enabled extensions). I was expecting it to collect all the info necessary, but evidently, it didn't. Which could be a whole different topic.
BETA/Development build is not an option, I must use the production/stable version.
I was able to reproduce the issue with a small code snippet. Here is my test code, FWIW.
As you asked - below is what I see in Python logs from the output window.
Starting Jedi Python language engine.
##########Linting Output - pylint##########
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Please let me know if there is something else you would need. I am happy to help.
brettcannon commentedon Sep 4, 2018
Unfortunately the "Report Issue" command is for VS Code itself and not us (I believe they are working to make it extensible for extension modules, but it's not there yet).
Anyway, I can confirm that this will be fixed in our next release!
aarshtalati commentedon Sep 4, 2018
Looking forward to next release!
aarshtalati commentedon Sep 12, 2018
I can confirm that on Ubuntu release package, for version 1.27.1 (Commit 5944e81f3c46a3938a82c701f96d7a59b074cfdc) has this fixed. I also was able to verify this to be working with Windows 10. Thank you!