Skip to content

Outline says No Symbols Found for the current doc. start type and symbols appear #1852

Closed

Description

@atomlin

Originally opened as microsoft/vscode-python#2434 , which was closed as duplicate of microsoft/vscode-python#2334

I updated to 1.27.1 this am to get the fix for microsoft/vscode-python#2334

I opened existing file that had problem before. Same problem as 2334. Hit space and symbols appear.

Cut and paste all code from that file to new file, saved and closed new file. On open of new file, symbols appear. On Open of old file with identical code no symbols until hit space.

Environment data

VS Code version: 1.27.1
Extension version (available under the Extensions sidebar): 2018.8.0
OS and version: Ubuntu 16.04.3
Python version (& distribution if applicable, e.g. Anaconda): 3.5.2
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Relevant/affected Python packages and their versions: N/A

Actual behavior

Outline view does not display any symbols after file open. Outline view shows 'No symbols found in document xxx'. On editing the file symbols appear in couple of seconds

Expected behavior

Symbols appear in outline window after opening file

Steps to reproduce:

Open file

Logs

None

Original file
image

New file with same code
image

Activity

  1. changed the title [-]Language Server: Variant of 2334: Outline says No Symbols Found for the current doc. start type and symbols appear[/-] [+]Outline says No Symbols Found for the current doc. start type and symbols appear[/+] on Sep 10, 2018
  2. brettcannon commented on Sep 10, 2018

    @brettcannon
    Member

    What does the Output panel say for the language server? I want to make sure that it has completed starting as you left out what the panel says.

  3. atomlin commented on Sep 10, 2018

    @atomlin
    Author

    I'm not clear what info you are looking for. There are multiple options in the output panel. The python option shows, however I dont think this is what you are after:
    ##########Linting Output - pylint##########
    ************* Module inline_shared
    24,4,warning,W0602:Using global for 'registers_file' but no assignment is done
    25,4,warning,W0602:Using global for 'interfaces_file' but no assignment is done
    26,4,warning,W0602:Using global for 'memories_file' but no assignment is done
    27,4,warning,W0602:Using global for 'top' but no assignment is done
    28,4,warning,W0602:Using global for 'ymldir' but no assignment is done
    30,4,warning,W0602:Using global for 'ifYaml' but no assignment is done
    31,4,warning,W0602:Using global for 'structYaml' but no assignment is done
    32,4,warning,W0602:Using global for 'top_file' but no assignment is done
    35,27,error,E0602:Undefined variable 'top_file'


    Your code has been rated at 6.29/10 (previous run: 6.29/10, +0.00)

  4. brettcannon commented on Sep 10, 2018

    @brettcannon
    Member

    There should be a line saying Starting Microsoft Python language server. and then a line about Initializing. I'm trying to make sure there are not any error messages and that the language server is ready running and done analyzing.

  5. atomlin commented on Sep 10, 2018

    @atomlin
    Author

    Restarted code. In the python window I see
    Starting Jedi Python language engine.

    In Log (Extension Host)

    [2018-09-10 16:43:57.201] [exthost1] [info] extension host started
    [2018-09-10 16:43:57.226] [exthost1] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"activationEvent":"*"}
    [2018-09-10 16:43:57.226] [exthost1] [info] ExtensionService#loadCommonJSModule /usr/share/code/resources/app/extensions/debug-auto-launch/out/extension
    [2018-09-10 16:43:57.235] [exthost1] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"activationEvent":"*"}
    [2018-09-10 16:43:57.235] [exthost1] [info] ExtensionService#loadCommonJSModule /usr/share/code/resources/app/extensions/emmet/dist/extension
    [2018-09-10 16:43:57.286] [exthost1] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"activationEvent":"*"}
    [2018-09-10 16:43:57.286] [exthost1] [info] ExtensionService#loadCommonJSModule /usr/share/code/resources/app/extensions/git/dist/main
    [2018-09-10 16:43:57.489] [exthost1] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"activationEvent":"*"}
    [2018-09-10 16:43:57.489] [exthost1] [info] ExtensionService#loadCommonJSModule /usr/share/code/resources/app/extensions/merge-conflict/out/extension
    [2018-09-10 16:43:57.502] [exthost1] [info] ExtensionService#_doActivateExtension vscode.search-rg {"startup":true,"activationEvent":"*"}
    [2018-09-10 16:43:57.502] [exthost1] [info] ExtensionService#loadCommonJSModule /usr/share/code/resources/app/extensions/search-rg/out/extension
    [2018-09-10 16:43:57.509] [exthost1] [info] ExtensionService#_doActivateExtension eamodio.gitlens {"startup":true,"activationEvent":"*"}
    [2018-09-10 16:43:57.509] [exthost1] [info] ExtensionService#loadCommonJSModule /home/tomlia/.vscode/extensions/eamodio.gitlens-8.5.6/out/extension
    [2018-09-10 16:43:57.715] [exthost1] [info] ExtensionService#_doActivateExtension ms-vscode.cpptools {"startup":true,"activationEvent":"workspaceContains:/.vscode/c_cpp_properties.json"}
    [2018-09-10 16:43:57.715] [exthost1] [info] ExtensionService#loadCommonJSModule /home/tomlia/.vscode/extensions/ms-vscode.cpptools-0.18.1/out/src/main
    [2018-09-10 16:43:57.897] [exthost1] [info] eager extensions activated
    [2018-09-10 16:44:09.566] [exthost1] [info] ExtensionService#_doActivateExtension vscode.python {"startup":false,"activationEvent":"onLanguage:python"}
    [2018-09-10 16:44:09.566] [exthost1] [info] ExtensionService#loadCommonJSModule /usr/share/code/resources/app/extensions/python/out/pythonMain
    [2018-09-10 16:44:09.568] [exthost1] [info] ExtensionService#_doActivateExtension ms-python.python {"startup":false,"activationEvent":"onLanguage:python"}
    [2018-09-10 16:44:09.568] [exthost1] [info] ExtensionService#loadCommonJSModule /home/tomlia/.vscode/extensions/ms-python.python-2018.8.0/out/client/extension
    
  6. brettcannon commented on Sep 11, 2018

    @brettcannon
    Member

    Andy Tomlin (@atomlin) Thanks! Helps clarify things that this is due to Jedi.

  7. atomlin commented on Sep 13, 2018

    @atomlin
    Author

    Is there a workaround?

  8. d3r3kk commented on Sep 13, 2018

    @d3r3kk

    Can you try switching to the new Python Language Server and see if that helps? In your settings, set "python.jediEnabled": false and restart VSCode.

  9. atomlin commented on Sep 13, 2018

    @atomlin
    Author

    Ok, that worked.

  10. DonJayamanne commented on Sep 20, 2018

    @DonJayamanne
    Collaborator

    I can confirm this works in the latest development environment.
    Andy Tomlin (@atomlin)
    Please could you install the development version of the extension and test this out. Should work now.
    Here are the instructions to download and install the development version of the extension: https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build

  11. atomlin commented on Sep 20, 2018

    @atomlin
    Author

    I installed the new extension. My MS python extension reports 2108.9.0-Alpha
    I reverted the fix provided before by setting python.jediEnabled: True
    Behavior is the same as when I filed the bug.
    See output window:

    Starting Jedi Python language engine.
    ##########Linting Output - pylint##########
    ************* Module inline_shared
    24,4,warning,W0602:Using global for 'registers_file' but no assignment is done
    25,4,warning,W0602:Using global for 'interfaces_file' but no assignment is done
    26,4,warning,W0602:Using global for 'memories_file' but no assignment is done
    27,4,warning,W0602:Using global for 'top' but no assignment is done
    28,4,warning,W0602:Using global for 'ymldir' but no assignment is done
    30,4,warning,W0602:Using global for 'ifYaml' but no assignment is done
    31,4,warning,W0602:Using global for 'structYaml' but no assignment is done
    32,4,warning,W0602:Using global for 'top_file' but no assignment is done
    35,27,error,E0602:Undefined variable 'top_file'
    
    ------------------------------------------------------------------
    Your code has been rated at 6.29/10 (previous run: 6.29/10, +0.00)
    
    

    Re-enabled the workaround by disabling jediEnabled

    Starting Microsoft Python language server.
    Downloading https://pvsc.blob.core.windows.net/python-language-server/Python-Language-Server-linux-x64.0.1.0.nupkg... complete.Unpacking archive... done.
    Initializing for /usr/bin/python3
    ##########Linting Output - pylint##########
    ************* Module inline_shared
    24,4,warning,W0602:Using global for 'registers_file' but no assignment is done
    25,4,warning,W0602:Using global for 'interfaces_file' but no assignment is done
    26,4,warning,W0602:Using global for 'memories_file' but no assignment is done
    27,4,warning,W0602:Using global for 'top' but no assignment is done
    28,4,warning,W0602:Using global for 'ymldir' but no assignment is done
    30,4,warning,W0602:Using global for 'ifYaml' but no assignment is done
    31,4,warning,W0602:Using global for 'structYaml' but no assignment is done
    32,4,warning,W0602:Using global for 'top_file' but no assignment is done
    35,27,error,E0602:Undefined variable 'top_file'
    
    ------------------------------------------------------------------
    Your code has been rated at 6.29/10 (previous run: 6.29/10, +0.00)
    

    Symbols appear correctly. As they did before updating the ms-python engine.
    I have the sense that there is some confusion here. You asked me to update the ms-python, but I think that was working before. My understand - which could be incorrect is that you have two engines
    ms-python and jedi
    Jedi is not working, ms-python is.

  12. DonJayamanne commented on Sep 20, 2018

    @DonJayamanne
    Collaborator

    Jedi is not working, ms-python is.

    Going forward the new (still experimental) Microsoft Language Server will be the default language server for intelliense and related.
    So, my suggestion is to use Language Server going forward (as that's where you'll get the best experience), e.g. this is a good example.

  13. 21 remaining items

  14. jamilraichouni commented on Mar 29, 2021

    @jamilraichouni

    Can confirm this issue using Pylance and having GitLens extension disabled.

    Version: 1.55.0-insider
    Commit: d06d2f1d6245ce00b1c36a9cd81a9087d225173e
    Date: 2021-03-26T13:57:45.993Z
    Electron: 11.3.0
    Chrome: 87.0.4280.141
    Node.js: 12.18.3
    V8: 8.7.220.31-electron.0
    OS: Darwin x64 20.3.0

    Python extension:
    v2021.4.690665134-dev

    Pylance extension:
    v2021.3.4-pre.1

    Global user settings:

    {
      (...)
      "python.languageServer": "Pylance"
      (...)
    }
  15. mrx23dot commented on Sep 15, 2021

    @mrx23dot

    Same issue for me,

    I don't dont have docker nor Gitlens.
    When I have Pylance enabled and start typing outline gets populated.
    After I disable Pylance and reload, start typing, outline remains empty. (I still have intelli sense though)

    So looks like Pylance makes it work, but only on trigger, I would expect it to work without Pylance.

    Still no fix after 3years?

  16. brettcannon commented on Sep 21, 2021

    @brettcannon
    Member

    This is fixed in Jedi behind LSP (just a bit slow; you must wait for the extension and Jedi to fully load). Transferring to Pylance for their side.

    Mathieu Moreau (@mrx23dot) Pylance is only 15 months old.

  17. jakebailey commented on Sep 21, 2021

    @jakebailey
    Member

    Brett Cannon (@brettcannon) Our side is #1823 (so I guess I could close this as a dupe), but as far as I'm concerned, issues with the outline only appearing after typing are squarely in the client or VS Code's domain and need to be fixed there. We don't even get the request for the outline when this happens.

    We're only at the stage where we need to reproduce this and then debug it in the Python extension to see.

  18. Corallus-Caninus commented on Feb 28, 2022

    @Corallus-Caninus

    Same issue as of now for rust-analyzer language server.

  19. jovylle commented on Oct 1, 2022

    @jovylle

    Yeah, how to view it.

  20. dbabits commented on Apr 11, 2024

    @dbabits

    I am on version 1.87 (February 2024) and experience the same problem.
    In outline, it always shows "no symbols found for file.py"
    All consoles (problems, output, terminal ) are empty.
    I am on RHEL8, projecting UI using X. (no code server etc)

  21. debonte commented on Apr 11, 2024

    @debonte
    Contributor

    dbabits, this issue has been closed for a long time. Please open a new one. If you're really not seeing anything in the output pane, not just under Python Language Server, but in any of the logs, I'd guess that this is a VS Code issue rather than a Pylance issue, so I'd suggest opening it here: https://github.com/microsoft/vscode/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions