Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Created November 26, 2023 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasaarholt/1b4ae61670864d08f5cbd9377ac1e187 to your computer and use it in GitHub Desktop.
Save thomasaarholt/1b4ae61670864d08f5cbd9377ac1e187 to your computer and use it in GitHub Desktop.
Working pyright and ruff LSPs for helix languages.toml configuration
[[language]]
name = "python"
scope = "source.python"
injection-regex = "python"
file-types = ["py","pyi","py3","pyw",".pythonstartup",".pythonrc"]
shebangs = ["python"]
roots = [".", "pyproject.toml", "pyrightconfig.json"]
comment-token = "#"
language-servers = ["pyright", "ruff"]
indent = { tab-width = 4, unit = " " }
auto-format = true
[language.formatter]
command = "ruff"
args = ["format", "-"]
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
[language-server.pyright.config]
reportMissingTypeStubs = false
[language-server.pyright.config.python.analysis]
typeCheckingMode = "basic"
autoImportCompletions = true
[language-server.ruff]
command = "ruff-lsp"
[language-server.ruff.config]
settings = {run = "onSave" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment