user9763248
user9763248

Reputation: 45

code navigation not working in vscode python

Switched to visualcode(Version: 1.53.1) recently for Python(2.7.5 is the interpreter). Set up remote-ssh(localclient - OSX and remote machine - CentOS 7) and i am able to write and execute code without issues. It's a pretty big code base and the directory structure looks like below. I tried opening both src/ and main/ but the "Go to Definition" or "Go to references" would not work - it just says "Nothing is found".

It works if its under the same directory for some cases - for example the reference and definition in d22 might only be listed when i am searching in d22 but that does not work always either.

src

Tried the following but nothing is helping:

I also want to know if we have something like Kite that will work over remote ssh.

Upvotes: 3

Views: 11726

Answers (3)

Akshay thakur
Akshay thakur

Reputation: 91

I updated my vs code and it worked. Basically, an update was already there, but a restart was required. Once restarted, it worked magically.

Please note: It may not resolve for all.

Upvotes: 0

zangsir
zangsir

Reputation: 65

Not sure if you solved this problem, but as of now, for me, I had the same problem, but when I go check out the Python extension in VS Code, there is a warning that "code navigation is disabled in this workspace" when it is remote. It suggested that I need to install the same extension in the remote in order to enable that functionality, which I could do with one click. After that, it works fine.

Upvotes: 0

Jill Cheng
Jill Cheng

Reputation: 10354

I noticed that the extension you used is "Python for VSCode". In VS Code, the "Go to Definition" and "Go to references" functions are provided by the "Python" extension. It is recommended that you install it or try to reinstall it if you have already installed it.

for the methods in the module:

enter image description here

for custom methods:

before "Go to Definition":

enter image description here

after "Go to Definition":

enter image description here

For remote development using SSH in VS Code, you could refer to this docs: Remote Development using SSH.

Upvotes: 1

Related Questions