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

broken python intellisense is making zed unusable #22266

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

broken python intellisense is making zed unusable #22266

pchalasani opened this issue Dec 19, 2024 · 5 comments
Labels
bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors python Python programming language support

Comments

@pchalasani
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

The various AI features are great but the very basic code completion seems broken.
To try to get this working, I commented out the entire "languages" section in my settings.json, and uninstalled all relevant extensions, but can't seem to get basic path-completions to work.

E.g. if I do from blah. I expect to see (good) auto-complete suggestions, but nothing shows up.
Sometimes I've seen it show a drop-down of choices, but sometimes (more often) I don't, so I've no idea what's going on, nor is there anything helpful in discord or docs.

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 19, 2024
@jansol jansol added the needs info / awaiting response Issue that needs more information from the user label Dec 19, 2024
@jansol
Copy link
Contributor

jansol commented Dec 19, 2024

What languages specifically? And what do you mean by "path-completions"?

@pchalasani
Copy link
Author

What languages specifically? And what do you mean by "path-completions"?

Python.

By path-completions I just meant import statements like from blah. where I pause at the "dot" and expect suggestions/completions.

@pchalasani pchalasani changed the title broken intellisense is making zed unusable broken python intellisense is making zed unusable Dec 19, 2024
@pchalasani
Copy link
Author

Also maybe "intellisense" is not the exact technical term, but what I mean is suggestions where it shows the best/likeliest choice of class/function etc. There may be two "competing" completions - copilot and the ones from the LSP, but I don't know where to specify which to prefer (or I don't fully understand the interplay).

@jansol jansol added python Python programming language support language server An umbrella label for all language servers and removed needs info / awaiting response Issue that needs more information from the user triage Maintainer needs to classify the issue labels Dec 20, 2024
@EnnFour
Copy link

EnnFour commented Dec 20, 2024

I'm running into similar issues with unusable intellisense -- pretty much everything suggested is an import from a different module. Here's an example of me attempting to annotate one of my methods with the @AbstractMethod decorator. I've already imported abstractmethod:
image

I'd love some toggleable settings which

  • enable/disable suggestions which require an import
  • enable/disable suggestions within a from x import y block (though I'd also be happy with the ability to selectively enable autocompletions for the x component or the y component)

@pchalasani
Copy link
Author

pchalasani commented Dec 20, 2024

I'm thinking this is probably mainly a docs issue and not a bug -- there needs to be a definitive document somewhere that shows, "if you want to have x,y,z capabilities, this is what your settings.json should contain", etc. Currently I'm finding partial and inconsistent success by hunting down these settings in various gh issues and even reddit. The latest incarnation of my hundreds of iterations of settings.json that seems to work for me (at least until it breaks on another update) is below.
The module auto-complete is sort of working but nowhere near as good as JetBrains/IntelliJ --

e.g. when I do from blah.foo import MyModule, now I do get good suggestions when I enter ".", but as soon as I type the first letter "M", I expect to see suggestions immediately (which I do in JetBrains), but I don't; I have to type the second letter "y" and only then I see suggestions.

 "languages": {
      "Python": {
        "language_servers": ["pyright", "ruff", "!python-refactoring", "!pylsp"],
        "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": {
              "plugins": {
                "mypy": {
                  "enabled": true
                },
                "pycodestyle": {
                  "enabled": false
                },
                "flake8": {
                  "enabled": false
                },
                "rope": {
                  "enabled": false
                },
                "pyflakes": {
                  "enabled": false
                },
                "mccabe": {
                  "enabled": false
                }
              }
            }
      },      
    },

EDIT - I know the settings above are redundant since pylsp is not actually used, etc, but just throwing it here for completeness.

@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors and removed admin read Pending admin review labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors python Python programming language support
Projects
None yet
Development

No branches or pull requests

4 participants