Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

bad intellisense info for type after import #1385

@bmoyles

Description

@bmoyles

I reported this as a part of #1377 originally but was asked to break this into a separate issue with a minimal repro.

Language server 0.3.41.0 from daily
VSCode 1.36.1
Python 3.7.3
OS Ubuntu 19.04

I started by removing ~/.cache/Microsoft/Python Language Server to ensure I had a clean slate. I also set python.analysis.logLevel to Trace and captured the output during this test.

I opened vscode with this simple Python file:

import builtins

a = type(type)

b = builtins.type(type)


class Foo(type):
    pass

With a clean cache and on a fresh open, intellisense returns type() for the type docstring/signature (I suppose the language server needs a python source file and does not look at help()), and peek/goto definition/declaration do not work (as expected):

image

Now I add a single import statement, import operator. I haven't tested further to see if this is specific to operator or triggers on any new import, but after adding that import statement, I saw a flurry of analysis output in the Python Output panel, and afterwards, intellisense returns information for http.client.Message (which subclasses email.message.Message) when hovering/peeking at type():

Hover:
image

Peek:
image

and here's the Python Output panel contents from the time I first opened vscode until I grabbed the screenshots after adding import operator
vscode-completion-python-output.txt

This problem also existed with language server 0.3.39.0 as well as 0.3.40.0.

Let me know if there's more info I can provide or more I can test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions