kakehashi lets you use intelligent features like completion and hover on source code embedded in another language — for example, the code blocks inside Markdown.
I built a VSCode extension so you can use kakehashi from VSCode too! Here’s how it works in action. Give it a try!
By the way, Markdown is just an example — kakehashi can be extended to a variety of document formats. I’ll save that story for another post…
How to install
- Install kakehashi (CLI)
- Install via cargo or brew
brew install atusy/tap/kakehashicargo install --git https://github.com/atusy/kakehashi
- Adjust your
PATHenvironment variable if necessary
- Install via cargo or brew
- Configure kakehashi (CLI)
Create
~/.config/kakehashi/kakehashi.tomlConfigure the language servers for the languages you want to use with kakehashi
# kakehashi.toml [languageServers.basedpyright] cmd = ["basedpyright-langserver", "--stdio"] languages = ["python"] [languageServers.r_language_server] cmd = [ "R", "--no-echo", "-e", "languageserver::run()"] languages = ["R", "r"]
- Install kakehashi (extension)
- Search for
kakehashiin the Marketplace, or runcode --install-extension atusy.kakehashi-vscode
- Search for
- Configure VSCode (
settings.json)Open the command palette with
Ctrl+Shift+Pand runPreferences: Open User Settings (JSON)Add
["markdown"]and"kakehashi.documentSelector"as shown below{ "[markdown]": { "editor.quickSuggestions": { "other": "on" } }, "kakehashi.documentSelector": [ "markdown" ] }
If you want to use it with Quarto or R Markdown
- Add configuration to kakehashi (CLI)
toml [languages.qmd] base = "markdown" [languages.rmd] base = "markdown" - Add configuration to VSCode
- Install the required extensions (quarto.quarto / REditorSupport.r)
- Add
"rmd"or"quarto"tokakehashi.documentSelectorinsettings.json
ENJOY!!
If you’d like to learn more about kakehashi itself or the extension, please check the README in each repository. Stars are a huge motivation booster!!
As an R user you might be wondering about Positron support — it’s not supported yet! Stay tuned!!
Sponsorship is also very welcome!
Atusy's blog