Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No definition found(when open vscode.app) #5074

Closed
ahuigo opened this issue Apr 2, 2019 · 10 comments
Closed

No definition found(when open vscode.app) #5074

ahuigo opened this issue Apr 2, 2019 · 10 comments
Assignees

Comments

@ahuigo
Copy link

@ahuigo ahuigo commented Apr 2, 2019

I've searched google and github for this issue. But I do not find the key to fix this issue.

Environment data

With Python 3.7.2 installed:

vscode 1.32.3 
Mac Mojave 10.14
pylint 2.3.1
astroid 2.2.5
Python 3.7.2 (default, Feb 12 2019, 08:15:36)

➜ pydemo$ code --list-extensions --show-versions
batisteo.vscode-django@0.19.0
donjayamanne.jupyter@1.1.5
donjayamanne.python-extension-pack@1.4.0
magicstack.MagicPython@1.1.0
ms-python.python@2019.3.6215
ms-vscode.Go@0.9.2
ms-vsliveshare.vsliveshare@0.3.1403
msjsdiag.debugger-for-chrome@4.11.3
mushan.vscode-paste-image@1.0.4
Shan.code-settings-sync@3.2.7
tht13.python@0.2.3
VisualStudioExptTeam.vscodeintellicode@1.1.5
vscodevim.vim@1.3.0
wholroyd.jinja@0.0.8
yzane.markdown-pdf@1.2.0
yzhang.markdown-all-in-one@2.2.0

I've set the interpreter:

{
     "python.pythonPath": "/usr/local/opt/python/libexec/bin/python",
}

Expected behaviour

Go to denifition successfully

Actual behaviour

I find that if I open code cli from Iterm2 or terminal .
The code works well with go to definition. (vscode will analyze project with 100% cpu usage at the
same time)

$ '/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code'

If I open vscode.app through dock or terminal or iterm2,
vscode will not analyze my project, and vscode will say No definition found for ...

$ open /Applications/Visual\ Studio\ Code.app

Steps to reproduce:

  1. Install python plugin and config: "python.pythonPath": "/usr/local/opt/python/libexec/bin/python",
  2. Open /Applications/Visual\ Studio\ Code.app
  3. create a simple file to test go to definition.
    Apr-02-2019 14-34-41

Logs

There is no logs output.
The following is Screen Shot of Develop Tool:
image
image
image

@pvscbot pvscbot added the classify label Apr 2, 2019
@ahuigo ahuigo changed the title No definition found No definition found(not work when open vscode.app) Apr 2, 2019
@ahuigo ahuigo changed the title No definition found(not work when open vscode.app) No definition found(when open vscode.app) Apr 2, 2019
@ahuigo

This comment has been minimized.

Copy link
Author

@ahuigo ahuigo commented Apr 2, 2019

I find that if I open code cli from Iterm2 or terminal .
The code works well with go to definition.

$ /usr/local/bin/code

If I open vscode.app through dock or terminal or iterm2. It tells me No definition found for ...

$ open /Applications/Visual\ Studio\ Code.app
@ahuigo

This comment has been minimized.

Copy link
Author

@ahuigo ahuigo commented Apr 2, 2019

Another issue, it also does not work for go to variable's definition.

from .user.config import name
from aiohttp.log import access_logger

Both name and access_logger are variables . press F12 will cause error: No definition for ...

@karrtikr

This comment has been minimized.

Copy link

@karrtikr karrtikr commented Apr 4, 2019

Please check the gif you mentioned in Steps to reproduce . Can you please try uninstalling the second item Python for VS Code from the list?

tht13.python@0.2.3

Make sure its not there by checking the above line is no longer present on running code --list-extensions --show-versions.

@karrtikr karrtikr added the info needed label Apr 4, 2019
@ahuigo

This comment has been minimized.

Copy link
Author

@ahuigo ahuigo commented Apr 5, 2019

Remove tht13.python and problem is still at there

➜ www$ code --list-extensions --show-versions
ms-python.python@2019.3.6352
ms-vscode.Go@0.9.2
ms-vsliveshare.vsliveshare@1.0.18
msjsdiag.debugger-for-chrome@4.11.3
mushan.vscode-paste-image@1.0.4
Shan.code-settings-sync@3.2.8
VisualStudioExptTeam.vscodeintellicode@1.1.5
vscodevim.vim@1.3.0
yzane.markdown-pdf@1.2.0
yzhang.markdown-all-in-one@2.2.0
➜ www$

At present, if I open /bin/code , a segment error appears from python-language-server.
image

@ahuigo

This comment has been minimized.

Copy link
Author

@ahuigo ahuigo commented Apr 8, 2019

# config.py
name = "Jack"

Could not go to variable's definition:

# main.py
# Could not go to  `name` definition: 
from config import name
@mplachter

This comment has been minimized.

Copy link

@mplachter mplachter commented Apr 11, 2019

Any update on this? Same is happening here.

ms-python.python@2019.3.6558

@karrtikr

This comment has been minimized.

Copy link

@karrtikr karrtikr commented Apr 18, 2019

Remove tht13.python and problem is still at there

➜ www$ code --list-extensions --show-versions
ms-python.python@2019.3.6352
ms-vscode.Go@0.9.2
ms-vsliveshare.vsliveshare@1.0.18
msjsdiag.debugger-for-chrome@4.11.3
mushan.vscode-paste-image@1.0.4
Shan.code-settings-sync@3.2.8
VisualStudioExptTeam.vscodeintellicode@1.1.5
vscodevim.vim@1.3.0
yzane.markdown-pdf@1.2.0
yzhang.markdown-all-in-one@2.2.0
➜ www$

At present, if I open /bin/code , a segment error appears from python-language-server.
image

This seems like a separate issue, can you please open another issue for this? thanks

@karrtikr

This comment has been minimized.

Copy link

@karrtikr karrtikr commented Apr 18, 2019

@mplachter @ahuigo Apologies for the late response. Meanwhile while I am trying to reproduce this, can you please confirm if this particular to Python extension? i.e if other languages also pose the same issue, it maybe a bug on the vscode end.

@mplachter

This comment has been minimized.

Copy link

@mplachter mplachter commented Apr 18, 2019

@karrtikr No worries I totally for got about this.
I actually found my issue on this.

I updated my Python from 3.7.1 to 3.7.3 and my pipenv symlinks broke which vscode was using.
After a quick

pipenv --rm and another pipenv install i was back up and running.

@ahuigo I don't know if this was your issue ^

@ahuigo

This comment has been minimized.

Copy link
Author

@ahuigo ahuigo commented Apr 23, 2019

After I update python-language-server, the problem seems to gone.
microsoft/python-language-server#875 (comment)

@ahuigo ahuigo closed this Apr 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.