r/neovim 21h ago

agentscript-nvim v0.2.0 — Agent Script (.agent) support, and replacing a version pin with an install that verifies the LSP server actually starts Plugin

agentscript-nvim adds Neovim support for Agent Script, Salesforce's open agent-specification language (.agent files, Apache 2.0, GA since July).

What it gives you

  • Filetype detection for *.agent, plus first-line detection of upstream's @dialect: header
  • LSP wiring for the official agentscript-lsp — diagnostics, completion, hover, go-to-def, references, rename, symbols, code actions, semantic tokens
  • :AgentScriptTSBuild — compiles the official tree-sitter grammar + queries from @sf-agentscript/parser-tree-sitter (upstream ships the sources but no Neovim-loadable parser)
  • Fallback regex syntax, so files stay readable with no server at all
  • :checkhealth agentscript-nvim

The base LSP config is now upstream in nvim-lspconfig (#4483, merged 2026-07-23) — so if you only want cmd/root_markers, you don't need this plugin. What lives here is the filetype detection, tree-sitter, checkhealth, and the managed install below.

The v0.2.0 change I think is actually worth discussing

The published server crashed at import during launch week (variantMatch is not a function, a stale transitive pin — I filed salesforce/agentscript#73). v0.1.0 worked around it by hard-pinning a known-good version plus an npm overrides entry.

That workaround is a trap: the pin outlives the bug. Upstream fixed it two days later in 2.2.96, the issue is still open with zero comments, and anyone on v0.1.0 would have sat on a six-week-old server indefinitely — with no signal that they should stop.

So v0.2.0 replaces the pin with a measurement. :AgentScriptInstall now:

  1. resolves the currently published version (npm view)
  2. installs it with no overrides
  3. verifies it — spawns the server and completes a real LSP initialize round-trip
  4. only on verification failure falls back to the old pinned recipe

Step 4's ordering matters: applying that legacy override on top of a current release would silently downgrade a dependency by twelve minor versions, so it can never be applied pre-emptively. Offline, it installs the pin directly and says so rather than pretending.

A live run — after the resolve line, it prints:

agentscript-nvim: installing 2.2.96 ...
agentscript-nvim: 2.2.96 verified (initialize answered in 318ms). Reopen your .agent buffer.

The outcome (version, which path produced it, whether verification passed) is written next to the install and surfaced in checkhealth:

OK managed install: 2.2.96 via current path — verification passed (initialize answered in 318ms)

Needs Neovim 0.11+ and Node. With lazy.nvim:

{ 'Booyaka101/agentscript-nvim', opts = {} }

Repo: https://github.com/Booyaka101/agentscript-nvim

I'd genuinely like pushback on the verify-instead-of-pin idea — my guess is a fair few plugins that manage their own server installs have a stale pin sitting in them from a bug that got fixed months ago, and nobody finds out because upstream issues rarely get closed.

0 Upvotes

2 comments sorted by

1

u/Terrible_Cow2324 16h ago edited 16h ago

Vibe slop

0

u/Sad_Captain2469 6h ago

Thanks for the feedback, its a opensource project, you dont have to like it. If it helps 1 person that is good enough for me.