feature request: dmypy/mypy lsp support (python) #1535

Open
opened 2026-02-16 17:31:26 -05:00 by yindo · 5 comments
Owner

Originally created by @nathan-gage on GitHub (Aug 29, 2025).

Originally assigned to: @thdxr on GitHub.

For code bases which make heavy use of static typing, pyright is often insufficient/behaves differently than mypy linting.

Originally created by @nathan-gage on GitHub (Aug 29, 2025). Originally assigned to: @thdxr on GitHub. For code bases which make heavy use of static typing, pyright is often insufficient/behaves differently than mypy linting.
yindo added the help-wanted label 2026-02-16 17:31:26 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 29, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2050: Python lsp not resolving packages in venv - deals with Python LSP configuration and functionality issues
  • #2121: Indicator if an LSP is 'on' for a language? - discusses LSP setup and verification for different languages
  • #2180: Support LSP workspace/didChangeConfiguration in addition to initializationOptions - addresses LSP configuration methods which might be relevant for mypy setup
  • #2182: Support LSP conditions beyond "extensions" (Dockerfile) - discusses expanding LSP trigger conditions beyond file extensions

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 29, 2025): This issue might be a duplicate of existing issues. Please check: - #2050: Python lsp not resolving packages in venv - deals with Python LSP configuration and functionality issues - #2121: Indicator if an LSP is 'on' for a language? - discusses LSP setup and verification for different languages - #2180: Support LSP workspace/didChangeConfiguration in addition to initializationOptions - addresses LSP configuration methods which might be relevant for mypy setup - #2182: Support LSP conditions beyond "extensions" (Dockerfile) - discusses expanding LSP trigger conditions beyond file extensions Feel free to ignore if none of these address your specific case.
Author
Owner

@mjbommar commented on GitHub (Aug 31, 2025):

+1 to supporting ty/ruff as well. The worst part about my opencode experience has been pyright causing crashes.

@mjbommar commented on GitHub (Aug 31, 2025): +1 to supporting `ty`/`ruff` as well. The worst part about my opencode experience has been `pyright` causing crashes.
Author
Owner

@rekram1-node commented on GitHub (Aug 31, 2025):

pyright causing crashes? what is it doing for you? Eating all your memory?

@rekram1-node commented on GitHub (Aug 31, 2025): pyright causing crashes? what is it doing for you? Eating all your memory?
Author
Owner

@mjbommar commented on GitHub (Aug 31, 2025):

pyright causing crashes? what is it doing for you? Eating all your memory?

Normally yes, but today, it was 99% CPU and never returning (on node 24). Appreciate you are not here to debug pyright hogging resources generally.

@mjbommar commented on GitHub (Aug 31, 2025): > pyright causing crashes? what is it doing for you? Eating all your memory? Normally yes, but today, it was 99% CPU and never returning (on node 24). Appreciate you are not here to debug pyright hogging resources generally.
Author
Owner

@AndBoyS commented on GitHub (Nov 25, 2025):

Here's my opencode.json for ruff and mypy (using uv, if you use pip just remove uv run).
You need python-lsp-server and pylsp-mypy packages intalled for mypy (and probably [tool.pylsp-mypy] enabled = true live_mode = true in pyproject.toml)

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "mypy": {
      "command": [
        "uv",
        "run",
        "pylsp",
      ],
      "extensions": [
        ".py",
        ".pyi"
      ]
    },
    "ruff": {
      "command": [
        "uv",
        "run",
        "ruff",
        "server",
      ],
      "extensions": [
        ".py",
        ".pyi"
      ]
    }
  }
}
@AndBoyS commented on GitHub (Nov 25, 2025): Here's my `opencode.json` for ruff and mypy (using uv, if you use pip just remove `uv run`). You need `python-lsp-server` and `pylsp-mypy` packages intalled for mypy (and probably ```[tool.pylsp-mypy] enabled = true live_mode = true``` in pyproject.toml) ``` { "$schema": "https://opencode.ai/config.json", "lsp": { "mypy": { "command": [ "uv", "run", "pylsp", ], "extensions": [ ".py", ".pyi" ] }, "ruff": { "command": [ "uv", "run", "ruff", "server", ], "extensions": [ ".py", ".pyi" ] } } } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1535