Skip to content
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 opened this issue Oct 3, 2019 · 3 comments
Closed

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

duskmoon314 opened this issue Oct 3, 2019 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@duskmoon314
Copy link

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

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Oct 3, 2019
@jakebailey
Copy link
Member

Very likely #1414. Does reloading cause the members to show up?

@duskmoon314
Copy link
Author

Very likely #1414. Does reloading cause the members to show up?

Maybe I have seen the order is inconsistent. But I haven't seen np.sin show up.

I will keep my eyes on it.

@MikhailArkhipov MikhailArkhipov added the duplicate This issue or pull request already exists label Oct 7, 2019
@MikhailArkhipov
Copy link

image

Folding into #1414

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants