{"_id":"bend2-lsp","_rev":"2-7a248be187db8d9208c6d081af71a76e","name":"bend2-lsp","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"bend2-lsp","version":"0.1.0","license":"Apache-2.0","_id":"bend2-lsp@0.1.0","maintainers":[{"name":"don2e4","email":"donpollofeet@gmail.com"}],"homepage":"https://github.com/don2e4/bend2-lsp#readme","bugs":{"url":"https://github.com/don2e4/bend2-lsp/issues"},"bin":{"bend2-lsp":"dist/server.js"},"dist":{"shasum":"0dedbe0be4fde02308d1aa5822fc748e3e603d0a","tarball":"https://registry.npmjs.org/bend2-lsp/-/bend2-lsp-0.1.0.tgz","fileCount":28,"integrity":"sha512-/fLIoTfBRlG0qisE4OWH2uu/CdjImKFI89M45zEcKWV9r7ZTTQdVSjDLqoZyz4JkpHt+K20zlTSTYmqQLeGN6Q==","signatures":[{"sig":"MEUCIHUAvoaBSo3HId8d1wWcxcnJQPfE1uYaIC+33LfKjx8MAiEA7j3yuSxG649TKVcJp4AKwJGGgxRbNIDV4oatCbjYjlU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":521847},"type":"module","engines":{"node":">=22"},"gitHead":"b3547434dbd52450e342dddaa6addf2614906bd1","scripts":{"test":"npm run build && node --test dist/test/*.test.js","build":"node build.mjs && tsc -p tsconfig.json --emitDeclarationOnly","prepack":"npm run build"},"_npmUser":{"name":"don2e4","email":"donpollofeet@gmail.com"},"repository":{"url":"git+https://github.com/don2e4/bend2-lsp.git","type":"git"},"_npmVersion":"12.0.2","description":"Language server for Bend 2","directories":{},"_nodeVersion":"26.7.0","dependencies":{"vscode-languageserver":"^9.0.1","vscode-languageserver-textdocument":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.25.9","typescript":"^5.9.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bend2-lsp_0.1.0_1789981234473_0.6714642520705472","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"bend2-lsp@0.1.1","bin":{"bend2-lsp":"dist/server.js"},"bugs":{"url":"https://github.com/don2e4/bend2-lsp/issues"},"dist":{"shasum":"5a8b5b8c9d6bc09e9183d41457221eeb7fe00044","tarball":"https://registry.npmjs.org/bend2-lsp/-/bend2-lsp-0.1.1.tgz","fileCount":28,"integrity":"sha512-1qU+MMcYL5oqdLfEiOjnfTxeekb9oKiv6gcsq4FJKK5bV/0ooP3ksPAj2wfowiOykzekVD7fCDUvWOyLoFvyxA==","signatures":[{"sig":"MEQCIFTBwR8pbEeSuN21R/95DiTvLpNwdah/9NQCuQttAVtcAiBV6D24XA56jh4lORegtk2PxeR521O8o2lZlP2axh22PA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGwUEFUK4UK/51zWpVkaETlf2Jb1BOCYaSkxUXNvV1XQAiBXyVVrG6TOvukQuzFcBkmMSy2EwD5wRidOoFNpN2irLw=="}],"unpackedSize":549803},"name":"bend2-lsp","type":"module","engines":{"node":">=26.9.0"},"gitHead":"d85e556febcd3e787c48f4558b5f89a34729626d","license":"Apache-2.0","scripts":{"test":"npm run build && node --test dist/test/*.test.js","build":"node build.mjs && tsc -p tsconfig.json --emitDeclarationOnly","prepack":"npm run build"},"version":"0.1.1","_npmUser":{"name":"don2e4","email":"donpollofeet@gmail.com"},"homepage":"https://github.com/don2e4/bend2-lsp#readme","repository":{"url":"git+https://github.com/don2e4/bend2-lsp.git","type":"git"},"_npmVersion":"12.0.2","description":"Language server for Bend 2","directories":{},"maintainers":[{"name":"don2e4","email":"donpollofeet@gmail.com"}],"_nodeVersion":"26.7.0","allowScripts":{"esbuild@0.28.2":true},"dependencies":{"vscode-languageserver":"10.1.1","vscode-languageserver-textdocument":"1.0.14"},"_hasShrinkwrap":false,"devDependencies":{"esbuild":"0.28.2","typescript":"7.0.2","@types/node":"26.6.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bend2-lsp_0.1.1_1790074519988_0.972887760178692"}}},"time":{"created":"2026-09-21T09:00:34.274Z","modified":"2026-09-22T10:55:20.227Z","0.1.0":"2026-09-21T09:00:34.618Z","0.1.1":"2026-09-22T10:55:20.074Z"},"bugs":{"url":"https://github.com/don2e4/bend2-lsp/issues"},"license":"Apache-2.0","homepage":"https://github.com/don2e4/bend2-lsp#readme","repository":{"url":"git+https://github.com/don2e4/bend2-lsp.git","type":"git"},"description":"Language server for Bend 2","maintainers":[{"name":"don2e4","email":"donpollofeet@gmail.com"}],"readme":"# Bend 2 language server\n\n`bend2-lsp` provides formatting, live compiler diagnostics, Markdown hover,\nand import go-to-definition for Bend 2 over LSP stdio. Node.js 26.9 or newer is required.\n\n```sh\nnpm install -g bend2-lsp\nbend2-lsp --stdio\n```\n\nTo build from source, run `npm ci && npm test`.\n\nThe server accepts the `bend` and `bend2` language IDs. It uses full-document\nsync, publishes diagnostics on open and 250 ms after edits, and rechecks open\ndocuments that import a changed buffer. Open buffers override files on disk.\nGo-to-definition resolves relative import paths, aliases, and imported top-level\ndeclarations.\nCompiler analysis is limited to `file:` documents; untitled documents still\nreceive formatting, lexical diagnostics, and syntax hover.\n\nAnalysis uses the bundled Bend compiler and Base library in a worker thread.\nRelative imports resolve from the document, then from open overlays. Hash\npackage imports use `BEND_LIB`; missing packages may be downloaded from\n`BEND_HUB`, checked by the compiler, and cached in the normal package layout.\nDownloads time out after 10 seconds.\n\nThe formatter preserves line breaks, blank lines, comments, literal spelling,\nline endings, and final-newline state. It normalizes indentation and safe token\nspacing without wrapping code.\n\n## Editor setup\n\nVS Code:\n\nInstall the [Bend 2 extension](https://marketplace.visualstudio.com/items?itemName=kbrianps.bend2) (`kbrianps.bend2`, also on [Open VSX](https://open-vsx.org/extension/kbrianps/bend2)), which bundles `bend2-lsp` and provides syntax highlighting, live diagnostics, hover, and formatting out of the box.\n\nTo point the extension at a custom or local server build, set `bend.server.path` in `settings.json`:\n\n```json\n{\n  \"bend.server.path\": \"bend2-lsp\"\n}\n```\n\nNeovim with `nvim-lspconfig`:\n\n```lua\nvim.api.nvim_create_autocmd(\"FileType\", {\n  pattern = \"bend\",\n  callback = function()\n    vim.lsp.start({\n      name = \"bend2-lsp\",\n      cmd = { \"bend2-lsp\", \"--stdio\" },\n      root_dir = vim.fs.root(0, { \".git\" }),\n    })\n  end,\n})\n```\n\nHelix (`languages.toml`):\n\n```toml\n[language-server.bend2-lsp]\ncommand = \"bend2-lsp\"\nargs = [\"--stdio\"]\n\n[[language]]\nname = \"bend\"\nscope = \"source.bend\"\nfile-types = [\"bend\"]\nlanguage-servers = [\"bend2-lsp\"]\nauto-format = true\n```\n\nEmacs with Eglot:\n\n```elisp\n(add-to-list 'eglot-server-programs\n             '(bend-mode . (\"bend2-lsp\" \"--stdio\")))\n```\n\nLocal-variable type hover is intentionally out of scope because it would\nrequire instrumentation in the trusted checker. Unknown names and inferred\nlocals therefore return no hover.\n\n## Compiler source\n\n`vendor/bend2/bend.ts` and `vendor/bend2/base.bend` are unmodified copies from\n[`don2e4/bend` commit `bacc663`](https://github.com/don2e4/bend/commit/bacc663b4897e210be43768ca5a73fcbbc6c06dd).\nThey are bundled into the npm package so installation does not require a Bend\ncheckout. The compiler and this language server are licensed under Apache 2.0;\nsee `LICENSE`. Update both vendored files together from a pinned Bend commit,\nthen run `npm test` and inspect `npm pack --dry-run` before releasing.\n","readmeFilename":"README.md"}