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.

Autocompletion doesn't work for some numpy's functions #1621

Closed
@duskmoon314

Description

@duskmoon314

I have searched issues and found microsoft/vscode-python#679. But it seems out of date since it was updated on 11 Jul 2018.

Environment data

  • VS Code version: 1.38.1
  • Extension version (available under the Extensions sidebar): 2019.9.34911
  • OS and version: Windows_NT x64 10.0.18362
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.2 (64-bit)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions:
    • pyright 1.0.68
    • Visual Studio IntelliCode 1.1.9
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977): "python.jediEnabled": false

Expected behaviour

I expect to see what parameters I need to fill and what will those functions return to me.

Actual behaviour

After I imported numpy in the way import numpy as np, I tried to use some math functions. When I tried to type in np.sin, nothing about sin appeared. I could only see other methods like _sanity_check. This happened to cos and exp. But for matmul, sum, dot, autocompletion and hints sometimes work well. (It seems that after vs intellicode run for a moment, they work well for matmul. At the buttom of how to use is matmul: unknown)

Besides, when I moved the cursor onto np.sin(), it showed sin: unknown

p.s. On another computer which I don't install visual studio intellicode, autocompletion works. But it only tells me sin and matmul are ufunc, which is no use.

Steps to reproduce:

  1. import numpy as np
  2. try to type in np.sin

Logs

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

User belongs to experiment group 'AlwaysDisplayTestExplorer - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
> conda --version
> pyenv root
> python3.7 -c "import sys;print(sys.executable)"
> python3.6 -c "import sys;print(sys.executable)"
> python3 -c "import sys;print(sys.executable)"
> python2 -c "import sys;print(sys.executable)"
> python -c "import sys;print(sys.executable)"
> py -3.7 -c "import sys;print(sys.executable)"
> py -3.6 -c "import sys;print(sys.executable)"
> py -3 -c "import sys;print(sys.executable)"
> py -2 -c "import sys;print(sys.executable)"
> d:\Program\python_hello_world\venv\Scripts\python.exe -c "import sys;print(sys.executable)"
> conda info --json
> ~\AppData\Local\Microsoft\WindowsApps\python.exe c:\Users\kpcam\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Microsoft\WindowsApps\python.exe c:\Users\kpcam\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Microsoft\WindowsApps\python3.exe c:\Users\kpcam\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\interpreterInfo.py
> ~\AppData\Local\Microsoft\WindowsApps\python3.exe c:\Users\kpcam\.vscode\extensions\ms-python.python-2019.9.34911\pythonFiles\interpreterInfo.py
> d:\Program\python_hello_world\venv\Scripts\python.exe -m pep8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s d:\Program\python_hello_world\main.py
cwd: d:\Program\python_hello_world
> d:\Program\python_hello_world\venv\Scripts\python.exe -m pep8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s d:\Program\python_hello_world\main.py
cwd: d:\Program\python_hello_world
Starting Microsoft Python language server.
##########Linting Output - pep8##########
> conda info --json
> conda --version
> d:\Program\python_hello_world\venv\Scripts\python.exe -m yapf --diff d:\Program\python_hello_world\main.py.99ad77dd49b9b85fe32975c34ba70b47.py
cwd: d:\Program\python_hello_world
> d:\Program\python_hello_world\venv\Scripts\python.exe -m yapf --diff d:\Program\python_hello_world\main.py.99ad77dd49b9b85fe32975c34ba70b47.py
cwd: d:\Program\python_hello_world
> d:\Program\python_hello_world\venv\Scripts\python.exe -m pep8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s d:\Program\python_hello_world\main.py
cwd: d:\Program\python_hello_world
> d:\Program\python_hello_world\venv\Scripts\python.exe -m pep8 --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s d:\Program\python_hello_world\main.py
cwd: d:\Program\python_hello_world
##########Linting Output - pep8##########

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

XXX

Don't know what I need to paste here. There a lot of logs in Console under the Developer Tools


I have tried to uninstall python extension and reinstrall, nothing happen.

I find a solution, using Jedi. But I want to try coding with visual studio intellicode, which needs me to use MS language server

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