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

Jump to definition broken (Python + PyLSP) #22384

Open
1 task done
pchalasani opened this issue Dec 24, 2024 · 5 comments
Open
1 task done

Jump to definition broken (Python + PyLSP) #22384

pchalasani opened this issue Dec 24, 2024 · 5 comments
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue

Comments

@pchalasani
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When I place my cursor on any class or function, and hit Cmd-B, I expect it to jump to the defn, but it doesn't do anything. Here's my language settings. Please tell me what I'm doing wrong

  "languages": {
      "Python": {
        "language_servers": ["ruff", "pylsp", "!python-refactoring", "!pyright"],
        "enable_language_server": true,
        "format_on_save": "on",
        "formatter": [
          {
            "code_actions": {
              "source.organizeImports.ruff": true,
              "source.fixAll.ruff": true
            }
          },
          {
            "language_server": {
              "name": "ruff"
            }
          }
        ]
      }
    },
    
  "lsp": {
      "pyright": {
        "settings": {
          "python.analysis": {
            "ignore": ["*"],
            "diagnosticMode": "workspace",
            "typeCheckingMode": "strict"
          },
          "python": {
            "pythonPath": ".venv/bin/python"
          }
        }
      },
      "ruff": {
            "initialization_options": {
              "settings": {
                // Ruff server settings goes here
                "lineLength": 89,
                "lint": {
                  "extendSelect": ["I", "F", "E"]
                }
              }
            }      
      },
      "pylsp": {
            "settings": {
              "python": {
                "pythonPath": ".venv/bin/python"
              },              
              "plugins": {
                "mypy": {
                  "enabled": true
                },
                "pycodestyle": {
                  "enabled": false
                },
                "flake8": {
                  "enabled": false
                },
                "rope": {
                  "enabled": false
                },
                "pyflakes": {
                  "enabled": false
                },
                "mccabe": {
                  "enabled": false
                }
              }
            }
      },      
    },

Zed Version and System Specs

Zed: v0.166.1 (Zed)
OS: macOS 15.0.0
Memory: 64 GiB
Architecture: aarch64

If applicable, add screenshots or screencasts of the incorrect state / behavior

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

@pchalasani pchalasani added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Dec 24, 2024
@CharlesChen0823
Copy link
Contributor

your config is work well, might because your cmd-b keybinding have some conflict

@pchalasani
Copy link
Author

your config is work well, might because your cmd-b keybinding have some conflict

Thanks, but it doesn't work even when I directly use the command "Editor: go to definition"

image

@pchalasani
Copy link
Author

it doesn't work

and it doesn't work even after swapping out pylsp and enabling pyright, and there are no docs about how to achieve this.

@pchalasani
Copy link
Author

Could this be a cache issue, and if so, how to clear the cache (and where is it)?
My global ~/.cache/zed is empty

@pchalasani
Copy link
Author

I just reinstalled zed and this inexplicably started working again.
It would be good to know where zed keeps its state and helper files so there's a cleaner solution than re-installing zed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue
Projects
None yet
Development

No branches or pull requests

2 participants