Skip to content

Intellisense does not work on function level imports when using Vim plugin and in a decorated function #1547

@chrispouliot

Description

@chrispouliot

Environment data

  • VS Code version: 1.22.2
  • Python Extension version: 2018.4.0-beta (doesn't work with non-beta either)
  • Vim Extension Version: 0.11.5
  • OS and version: MacOS 10.13.4
  • Python version: Python 3.6.2
  • Type of virtual environment used : pyenv virtualenv

Actual behavior

Intellisense does not work when using the Vim plugin and importing a class at function level when the function is wrapped in a decorator, but works when import is module level
intellisense not working

Intellisense starts working if I deleted the decorator. If I add the decorator back it continues to work normally.
intellisense working

Expected behavior

Intellisense should work when imports are at function level in a decorated function

intellisense working

Steps to reproduce:

  1. Install Vim plugin
  2. Import a class while in a function that is wrapped with a decorator
  3. Try and get intellisense on class attributes (doesnt work)
  4. Delete decorator
  5. Intellisense works
  6. Re-add decorator
  7. Intellisense works

Logs

The only output I get is when Flake8 shows that Session. is invalid syntax while waiting for intellisense to start working

##########Linting Output - flake8##########
20,12,E,E999:SyntaxError: invalid syntax

Output from Console under the Developer Tools panel

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3301 Overwriting grammar scope name to file mapping for scope source.python.
Old grammar file: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json.
New grammar file: /Users/christophepouliot/.vscode/extensions/magicstack.MagicPython-1.0.12/grammars/MagicPython.tmLanguage
e.register @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3301
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3301 Overwriting grammar scope name to file mapping for scope source.sql.
Old grammar file: /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/sql/syntaxes/sql.tmLanguage.json.
New grammar file: /Users/christophepouliot/.vscode/extensions/ms-mssql.mssql-1.3.1/syntaxes/SQL.plist
e.register @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3301

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions