question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Language server only displays the top level symbols

See original GitHub issue

Environment data

  • VS Code version: 1.24.1
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: Ubuntu 16.04 x64
  • Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.12
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A

Actual behavior

Language server

Only top-level items are listed.

Jedi

“Go to Symbol in File…” is most times very very slow on 1.24.1 on a largish Python file (~1500 lines) - most times I’m just looking at the animated thingie. In some cases (if I give it enough time to finish?) the second time I invoke it, it appears and lists symbols fast, but next time it’s slow again. Using it on this file: https://github.com/peterlevi/ojo/blob/master/ojo/ojo.py (vscode started directly in the root of that whole repo). In cases when it appears, it lists 646 symbols in the file.

vscode_slow_goto_symbol

Issue first reported as a comment here: https://github.com/Microsoft/vscode-cpptools/issues/1472#issuecomment-399264682

Expected behavior

“Go to Symbol in File…” to be usable

Steps to reproduce:

  1. git clone https://github.com/peterlevi/ojo.git
  2. cd ojo
  3. code .
  4. Open ojo.py
  5. Press shortcut for invoking “Go To Symbol in File…”

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting the classic analysis engine.
##########Linting Output - pylint##########
No config file found, using default configuration
/home/peter/.local/lib/python2.7/site-packages/astroid/brain/brain_gi.py:136: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '3.0') before import to ensure that the right version gets loaded.
  __import__(m)
************* Module ojo.ojo
1269,0,warning,W1401:Anomalous backslash in string: '\W'. String constant might be missing an r prefix.
349,8,warning,W0602:Using global for 'killed' but no assignment is done
1275,18,error,E1121:Too many positional arguments for method call
1282,34,warning,W0612:Unused variable 'e'
1345,19,error,E0712:Catching an exception which doesn't inherit from BaseException: GError
1337,12,warning,W0612:Unused variable 'format'
1345,35,warning,W0612:Unused variable 'e'
1243,34,error,E0203:Access to member 'wheel_timer' before its definition line 1247

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

 INFO no standard startup: not the explorer viewlet
TMSyntax.ts:44 Overwriting grammar scope name to file mapping for scope source.python.
Old grammar file: /usr/share/code/resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json.
New grammar file: /home/peter/.vscode/extensions/magicstack.magicpython-1.0.12/grammars/MagicPython.tmLanguage
e.register @ TMSyntax.ts:44

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
MikhailArkhipovcommented, Aug 7, 2018

No, it never drilled into nested scopes. It does now image

0reactions
MikhailArkhipovcommented, Aug 10, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Server Protocol Specification - 3.17
This document describes the 3.17.x version of the language server protocol. ... Major new feature are: type hierarchy, inline values, inlay hints, ...
Read more >
Language Server Protocol: Get Symbol Information of inner ...
What I've found. The command vscode.commands.executeCommand('vscode.executeDocumentSymbolProvider') will provide 1st-level symbol information for the whole ...
Read more >
Settings Reference for Python - Visual Studio Code
By default, it only shows when there are Python related files open in the editor. ... When set to true , by default...
Read more >
Language Server Protocol Overview - Visual Studio (Windows)
The data types are not at the level of a programming language domain model which would usually provide abstract syntax trees and compiler ......
Read more >
Language Server Protocol Tutorial: From VSCode to Vim
Notice that we have not called out specific text editors yet. Let's explain why with an example. Say you've developed a new programming...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found