Skip to content

repl: Support kernel language aliases in REPL#49762

Merged
miguelraz merged 1 commit intozed-industries:mainfrom
rgbkrk:rgbkrk/repl-kernel-language
Mar 4, 2026
Merged

repl: Support kernel language aliases in REPL#49762
miguelraz merged 1 commit intozed-industries:mainfrom
rgbkrk:rgbkrk/repl-kernel-language

Conversation

@rgbkrk
Copy link
Copy Markdown
Collaborator

@rgbkrk rgbkrk commented Feb 20, 2026

Add a kernel_language_names field to LanguageConfig that allows languages to declare alternative names that Jupyter kernels may use. This fixes REPL matching for cases where a kernel reports a different language identifier than Zed's language name.

For example, the Nu extension would set kernel_language_names = ["nushell", "nu"] in its config.toml, enabling REPL support for nu-jupyter-kernel which reports "language": "nushell" in its kernelspec.

The change consolidates kernel language matching logic into a single Language::matches_kernel_language() method that checks the code fence block name, language name, and the new aliases list (all case-insensitive).

  • Done a self-review taking into account security and performance aspects

Release Notes:

  • Added kernel_language_names field for extensions to self identify REPL mappings

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 20, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Feb 20, 2026
@rgbkrk rgbkrk requested a review from yeskunall February 20, 2026 22:58
@rgbkrk rgbkrk added area:repl repl, jupyter, notebooks, etc area:languages An umbrella label for all programming languages syntax behaviors labels Feb 20, 2026
Add a `kernel_language_names` field to `LanguageConfig` that allows
languages to declare alternative names that Jupyter kernels may use.
This fixes REPL matching for cases where a kernel reports a different
language identifier than Zed's language name.

For example, the Nu extension would set `kernel_language_names = ["nushell"]`
in its config.toml, enabling REPL support for nu-jupyter-kernel which reports
`"language": "nushell"` in its kernelspec.

The change consolidates kernel language matching logic into a single
`Language::matches_kernel_language()` method that checks the code fence
block name, language name, and the new aliases list (all case-insensitive).
@rgbkrk rgbkrk force-pushed the rgbkrk/repl-kernel-language branch from a32991c to f2f2c77 Compare February 20, 2026 22:59
@miguelraz miguelraz merged commit 74e747a into zed-industries:main Mar 4, 2026
27 checks passed
@rgbkrk rgbkrk deleted the rgbkrk/repl-kernel-language branch March 4, 2026 17:59
ian-h-chamberlain added a commit to ian-h-chamberlain/nu that referenced this pull request Mar 23, 2026
See zed-industries/zed#49762 for details, this
enables out-of-the-box support for nu-juypter-kernel (which registers
itself with the language name `nushell`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:languages An umbrella label for all programming languages syntax behaviors area:repl repl, jupyter, notebooks, etc cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants