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.

Intellisense not working when using a specific import / return combination

See original GitHub issue

Environment data

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

Actual behavior

Inellisense not working when using a specific import / return combination.

Expected behavior

Intellisense to work.

Steps to reproduce:

File policy/ab.py:

class BaseAB:
    def smthng(self, i):
        pass

class A(BaseAB):
    def smthng(self, i):
        print("A smthng " + str(i))

class B(BaseAB):
    def smthng(self, i):
        print("B smthng " + str(i))

File policy/__init__.py:

from policy.ab import A, B

def build_test(input):
    return {
        'A': A,
        'B': B
    }[input]()

Intellisense does not know what build_test returns: image

Interestingly, it works in other combinations, like the same input but when return is with ifs: image Or the same return but when import is a bit different, when not importing to the class level: image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
brettcannoncommented, Oct 23, 2018

[ @bjg2 I edited your ✉️ ⬆️ to come off as more 😃 and less 😠 ]

We are just swamped with things, but we will triage this and figure out who to reach out to in order to get this potentially fixed.

0reactions
kimadelinecommented, Sep 13, 2019

Closing, language server & jedi have the same result for all combinations, and go to definition works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vscode Intellisense of importing modules stopped working
I just updated Visual Studio Code, and suddenly when I import modules in Javascript: import module from './module'. Intellisense doesn't ...
Read more >
Intellisense not working in sass/scss files for mixins when ...
In my scss file, for example: @import '~foundation-sites/scss/foundation'; @include foundation-everything($flex: true); I get a squiggly line in the editor ...
Read more >
Python Intellisense not working with Visual Studio 2017 15.2
Hi I tried all possible options to enable Intellisense but not ... If I have a text editor with "import numpy as np"...
Read more >
Intellisense not working for Visual Studio Code
Operating System: Windows 10 Problem: 1. Intellisense and Autocomplete not working for VScode. 2. Opening c# script within the editor opens ...
Read more >
[UE 5.1] VisualStudio 2022 Intellisense for engine files not ...
After running UnrealBuildTool through the debugger, and messing around with it a little bit, found out that if you add the -Engine cmd...
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