https://github.com/nahoj/xonsh-jetbrains
Xonsh language support in JetBrains IDEs
https://github.com/nahoj/xonsh-jetbrains
jetbrains-plugin language-support xonsh
Last synced: 21 days ago
JSON representation
Xonsh language support in JetBrains IDEs
- Host: GitHub
- URL: https://github.com/nahoj/xonsh-jetbrains
- Owner: nahoj
- License: mit
- Created: 2026-05-01T22:14:16.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-01T23:55:16.000Z (about 1 month ago)
- Last Synced: 2026-05-02T00:33:00.894Z (about 1 month ago)
- Topics: jetbrains-plugin, language-support, xonsh
- Language: Kotlin
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://plugins.jetbrains.com/plugin/31595)
[](https://plugins.jetbrains.com/plugin/31595)
[](https://github.com/nahoj/xonsh-jetbrains/releases)
[](https://github.com/nahoj/xonsh-jetbrains/commits)
This is a plugin that adds [Xonsh](https://xon.sh/) language support to JetBrains IDEs (IntelliJ, PyCharm, etc.).
You can install it from your IDE or the [Marketplace](https://plugins.jetbrains.com/plugin/31595), or build it from source (see below).
**Status:** It works. I intend to fix bugs and possibly make improvements over time. Issues and PRs are welcome!
## Features
Features are basically that of [xonsh-language-server](https://github.com/FoamScience/xonsh-language-server):
- Syntax highlighting
- Code completion
- Inspections / diagnostics
- Documentation on hover, and other useful info such as env var values.
- Go To Declaration, Show/Find Usages
- and more
## Install
### Prerequisites
IntelliJ-based IDE (PyCharm, etc.) v2024.2+ with [LSP4IJ plugin](https://plugins.jetbrains.com/plugin/23257-lsp4ij) (installed automatically).
[xonsh-lsp](https://github.com/FoamScience/xonsh-language-server) is run via `uvx` or `pipx` unless installed in `PATH` or specified in Language Server settings. ℹ️ As of 05/2026, `xonsh-lsp` doesn't work if installed/run with `mise` (starts but doesn't start its backend).
The plugin is known to work on Linux and macOS. I expect it to work on Windows if `xonsh-lsp` does as well.
### Python LSP backend
`xonsh-lsp` supports several Python backends:
- [jedi](https://github.com/davidhalter/jedi) (default, built-in), [pyright](https://github.com/microsoft/pyright), and [pylsp](https://github.com/python-lsp/python-lsp-server) work well out of the box.
- `basedpyright`, `ty`, and `lsp-proxy` don't work as well as of 05/2026.
### ⚠️ Known Issue
If `*.xsh` / `*.xonshrc` files are registered as Python in your IDE (which PyCharm may suggest), the plugin will not work on them. To fix it, go to Settings → Editor → File Types → Python and remove xsh extensions, then restart the IDE.
## Development
### Build from source
Requires JDK 21 (will download on build if you don't have it installed).
```sh
./gradlew buildPlugin
```
The package is created in `./build/distributions/`
### Sandbox IDE
`./gradlew runIde` launches a sandbox IDE with the plugin loaded.
By default, it downloads PyCharm from Maven. To skip the download and use your locally installed IDE, create `local.properties` at the project root:
```properties
#localIdePath=/Applications/PyCharm Professional.app/Contents
#localIdePath=/home//.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate
localIdePath=/snap/pycharm-community/current
```
## Credits
Most features are provided by [xonsh-language-server](https://github.com/FoamScience/xonsh-language-server).
Syntax highlighting outside LSP scope uses the TextMate grammar from [vscode-xonsh](https://github.com/jnoortheen/vscode-xonsh), itself based on [MagicPython](https://github.com/MagicStack/MagicPython).
Logo [from the Xonsh project](https://github.com/xonsh/logo) (MIT License).