A working Beef language server and VS Code extension for macOS.
Beef ships no editor integration of its own — upstream's IDE is Windows-only. This is a macOS build of a community language server, with the fixes needed to make it compile and run against the current Beef compiler.
completion · hover · go to definition · find references · rename
document symbols · signature help · semantic tokens · folding ranges
formatting · workspace symbols · diagnostics
You need a Beef toolchain first (the server drives the real compiler):
git clone https://github.com/agorangetek/beef-macos && cd beef-macos
bash setup-beef-macos.shThen build the server from this repository and install the extension — see BUILDING.md. Short version:
# 1. put the server sources inside the Beef checkout and build them
cp -R src BeefProj.toml BeefSpace.toml <Beef>/BeefLsp/
cd <Beef>/IDE/dist && ./BeefBuild -workspace=<Beef>/BeefLsp -config=Release -platform=macOS
# 2. make the launcher visible to the editor
mkdir -p ~/bin && cp bin/BeefLsp ~/bin/ && chmod +x ~/bin/BeefLsp
# 3. install the extension
# VS Code / VSCodium -> Extensions -> "..." -> Install from VSIX...
# -> prebuilt/beeflang-0.1.1.vsix
# then set "beeflang.serverPath": "~/bin/BeefLsp" (absolute path) in settingsOpen a folder containing BeefSpace.toml, then a .bf file. Note that a folder must be open — the
server needs a workspace root, and with only a file open it reports No workspace path given.
| Path | |
|---|---|
src/ |
The language server (24 Beef sources) |
BeefProj.toml, BeefSpace.toml |
Its Beef project/workspace, including the macOS build configs |
vscode-extension/ |
The VS Code extension sources (TypeScript + Svelte settings UI) |
prebuilt/beeflang-0.1.1.vsix |
Ready-to-install extension |
bin/BeefLsp |
Launcher (wraps the server, which needs a Beef dist tree as its working directory) |
patches/ |
Our changes as patches against the upstream fork, for upstreaming |
tests/ |
Python LSP clients used to verify the server |
Verified on macOS 27.0 (Apple Silicon), Xcode 26, against the Beef commit pinned by
beef-macos.
Server, driven by a Python LSP client:
| Check | Result |
|---|---|
initialize (VS Code-style capabilities) |
PASS |
rootUri only / workspaceFolders only / minimal capabilities |
PASS |
| Diagnostics for a broken buffer, and clearing them when fixed | PASS — 4 diagnostics, then 0 |
documentSymbol |
PASS — real symbols from the workspace |
TCP transport (--port=N), which the extension uses |
PASS |
shutdown / exit |
PASS |
In VSCodium, end to end: the extension activates on onLanguage:bf, spawns the server, connects over
TCP, and loads the workspace — confirmed from the editor's own Beef LSP output channel:
[INFO ] Connected
[INFO ] Loaded workspace at /tmp/beef_example
[INFO ] Refreshing workspace
- Only the first entry of
workspaceFoldersis used — no multi-root support. - URI decoding handles
%3Aand%20only. - Interactive features (completion/hover popups) are exercised at the protocol level, not clicked through in the editor.
The server is not ours: it is MineGame159's lsp branch, an
alpha-stage community language server that had gone unmaintained since 2023. We ported it onto the
current Beef compiler and fixed the macOS problems:
- API drift — three compiler-output overrides now take
StringView;RemoveChildgained a parameter; the socket calls return payloadResults, so== .Errbecamecase .Err. rootUrisupport — it read only the deprecatedrootPath, so editors that send justrootUri(Zed, Neovim, multi-root) loaded an empty workspace.- A handshake stall —
OnInitializeindexedargs["capabilities"]["textDocument"]["semanticTokens"]["tokenTypes"], and this JSON type reads uninitialized memory when you index into a non-object. A client that did not advertisesemanticTokensmade the server go silent mid-handshake. - A crash loop in the extension — a fixed 1-second wait before connecting with no retry (fail five times, then give up permanently), and a hardcoded port 5556 that stopped two windows coexisting.
- Noisy output —
documentSymbollogged a warning per unrecognised navigation entry, flooding the output channel. beeflang.serverPathsetting — macOS GUI apps do not inherit the shellPATH, soexecFile("BeefLsp")could never find a launcher in~/binwithout it.
The socket layer also needed fixing, but that lives in Beef itself and is carried by
beef-macos: IPv6 was broken on macOS (AF_INET6 was
hardcoded to the Windows value, sockaddr lacked the BSD length byte, addrinfo used the glibc field
order, and socket-option values came from Linux).
Two MIT-licensed works are combined here:
- Beef — Copyright © 2019 BeefyTech LLC — see
LICENSE-Beef.txt - The language server and VS Code extension — Copyright © 2022 MineGame159 — see
LICENSE-vscode-extension.txt
Our changes are offered under the same terms.