BQN
BQN language support for Zed
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for BQN. The extension's id is bqn.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
BQN language support for Zed
Prerequisites
BQN LSP
should be installed in your $PATH as BQNLSP!
This uses
Decisions
The syntax highlighting choices I've made.
- Function glyphs are highlighted as
operators, leavingfunctionhighlighting for user written functions. - 1- and 2-modifiers use
typehighlighting (since BQN doesn't specify types). { } : ; ← ↩ ⇐(𝕊in headers) are highlighted askeywordsto make them stand as controllflow primitives.- In contrast with
𝕊,𝕩 𝕨 𝔽 𝔾 𝕤 _𝕣 _𝕣_keep their syntactic coloring in headers for readibility reasons.
Features
- Syntax highlighting.
- Outline support.
- Runnable blocks.
- When you write a nameless block, a run button will apear next to it.
- You need
bqnin your path in order to use this.
- Hover documentation (powered by the lsp).
Gripes
- Sadly system functions
•aren't deconstructed in the tree-sitter grammar, that is why I can't do the.seperated notation highlighting. - The lsp, while very nice, could use features like
goto definitionorrefactoringtools. - The LSP should download automatically. Now that needs to happen manually.
- Hover documentation doesn't always seem to work.
Making Zed BQN friendly
Install the BQN font
And add it in your settings "buffer_font_family": "BQN386 Unicode",
These tasks might be nice to have
{
"label": "BQN run file",
"command": "bqn -f '$ZED_FILE'"
},
{
"label": "BQN run line",
"command": "cat './${ZED_RELATIVE_FILE}' | head -n $ZED_ROW | tail -n 1 | bqn -p",
},
{
"label": "BQN run $ZED_SELECTED_TEXT",
"command": "bqn -p '$ZED_SELECTED_TEXT'",
}
You can ofcourse also write a task for running your specific project.
If you use option/alt as your BQN modifier key, reclaim the keys in your keymap.json:
[
{
"context": "Editor",
"bindings": {
"alt-h": null,
"alt-d": null,
"alt-b": null,
"alt-f": null,
"alt-shift-b": null,
"alt-shift-f": null,
"alt-v": null,
"alt-shift-t": null
}
},
{
"context": "Workspace",
"bindings": {
"alt-t": null,
"alt-shift-t": null
}
},
{
"context": "Editor && mode == full",
"bindings": {
"alt-z": null
}
}
]