-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Ctrl+Click for jump-to-definition stops working when I use it (in some cases) #13966
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
Comments
@haimat, thanks for letting us know about this. Please provide the content of your settings.json and the "Python" output panel. Thanks! |
Here is the content of the project settings: {
"python.linting.pylintArgs": [
"--max-line-length=120",
"--generate-members",
"--disable=W0142,W0403,W0613,R0903,R0913,R0914,C0103,F0401,C0330,R0902"
],
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=120",
"--ignore=E203"
],
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/bin/black",
"python.formatting.blackArgs": [
"--line-length=120"
],
"python.autoComplete.extraPaths": [
],
} Here is the content of the {
"python.pythonPath": "/usr/bin/python"
} And last but not least there the content of the editor's settings: {
"breadcrumbs.enabled": true,
"editor.renderControlCharacters": false,
"editor.renderWhitespace": "none",
"editor.formatOnSave": true,
"editor.cursorBlinking": "smooth",
"files.autoSave": "off",
"workbench.colorTheme": "Darcula Theme 2.0",
"workbench.sideBar.location": "right",
"svn.enabled": true,
"svn.showOutput": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/__pycache__": true,
"**/.DS_Store": true
},
"python.linting.pylintArgs": [
"--max-line-length=120",
"--generate-members",
"--disable=W0142,W0403,W0613,R0903,R0913,R0914,C0103,F0401,C0330,R0902"
],
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=120",
"--ignore=E203"
],
"python.formatting.provider": "black",
"python.formatting.blackPath": "/usr/local/bin/black",
"python.formatting.blackArgs": [
"--line-length=120"
],
"remote.SSH.remotePlatform": {
"Sinntelligence-Aerion": "linux"
},
"remote.SSH.showLoginTerminal": true,
"terminal.integrated.env.linux": {
"DISPLAY": "localhost:10.0"
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.jediEnabled": false,
"vsintellicode.features.python.deepLearning": "enabled",
"vsintellicode.java.completionsEnabled": false,
"vsintellicode.typescript.completionsEnabled": false,
"vsintellicode.sql.completionsEnabled": false,
"editor.mouseWheelZoom": true,
"editor.fontSize": 15,
"window.zoomLevel": 0,
"markdown.preview.breaks": true,
"python.languageServer": "Microsoft",
"python.showStartPage": false,
"workbench.startupEditor": "newUntitledFile",
} And here the output of the Python output panel:
|
btw. I just noticed that holding Ctrl and moving the mouse cursor of the import of the additional workspace folder is enough to lead to this error. I do not even have to click on the import to get there ... |
Here is an update: Using pylance as Python language server does solve this issue for me. |
This looks like a duplicate of #13441. |
Closing as we're moving to Pylance long term and it solves the issue. |
Environment data
python.languageServer
setting: JediExpected behaviour
Holding Ctrl while clicking on a Python variable or function or alike the editor jumps to the definition of that object. This is working as expected in most cases within VS Code.
Actual behaviour
In some cases, at least for my project, this features stops working completely if I Ctrl+Click on to a custom class that I import in my code. My project layout is this:
I have a project root folder, which also is the
${workspaceFolder}
in my VS Code workspace. Ctrl+Clicking on any imports from that folder (or its sub folders) works as expected. Then I have added another folder to the workspace, On disk that folder is not within the workspace root folder. Now, when I Ctrl+Click on to an imported class for example that lies in this additional project folder, then nothing happens, the editor does not jump to that class. Moreover, the whole Ctrl+Click functionality does not work any longer, even where it has worked before. I need to restart VS Code that to get that functionality again.What I also noticed is that before I try to Ctrl+Click on to that "problematic" imports from that additional workspace folder, when I just mouse-hover over that class import, its docstring description is shown correctly in the tooltip window. So that class is found by the edtior and it also can be found when running the application. It's just this Ctrl+Click that leads to the problem described above.
The text was updated successfully, but these errors were encountered: