[PR #3402] feat: support lua lsp #10627

Closed
opened 2026-02-16 18:15:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/3402

State: closed
Merged: Yes


Summary

Adds Lua language server for .lua files.

Changes

  • Added LuaLS configuration
  • Registered .lua file extension
  • Auto installs lua-language-server when not available (via Github releases)
  • Updated LSP documentation (packages/web/src/content/docs/lsp.mdx)

Technical Details

  • The lua-language-server needs supporting files (meta/, locale/, etc.) => extract the binary into a separate dir with its supporting files (EG: /Users/user/.local/share/opencode/bin/lua-language-server-arm64-darwin/)
  • Check for NearestRoot with default root_makers - nvim-lspconfig

Testing

Lua project
LSP Attachment Log - filtered log on editing .lua extension file

INFO  2025-10-24T04:23:37 +4ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls, lua-ls enabled LSP servers
INFO  2025-10-24T04:23:59 +3ms service=lsp.server downloading lua-language-server from GitHub releases
INFO  2025-10-24T04:24:01 +1114ms service=lsp.server bin=/Users/username/.local/share/opencode/bin/lua-language-server-arm64-darwin/bin/lua-language-server installed lua-language-server
INFO  2025-10-24T04:24:01 +1ms service=lsp serverID=lua-ls spawned lsp server
INFO  2025-10-24T04:24:01 +0ms service=lsp.client serverID=lua-ls starting client
INFO  2025-10-24T04:24:01 +1ms service=lsp.client serverID=lua-ls sending initialize
INFO  2025-10-24T04:24:01 +385ms service=lsp.client serverID=lua-ls initialized
INFO  2025-10-24T04:24:01 +0ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/didOpen
INFO  2025-10-24T04:24:02 +133ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +3ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +0ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +3ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +0ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +2ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +1ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +6ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +1ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +2ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +1ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +4ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +8ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +6ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:02 +4ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:21 +0ms service=lsp.client serverID=lua-ls path=/dummy-path waiting for diagnostics
INFO  2025-10-24T04:24:21 +0ms service=lsp.client serverID=lua-ls path=/dummy-path version=1 textDocument/didChange
INFO  2025-10-24T04:24:22 +25ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics
INFO  2025-10-24T04:24:22 +0ms service=lsp.client serverID=lua-ls path=/dummy-path got diagnostics

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/3402 **State:** closed **Merged:** Yes --- ## Summary Adds Lua language server for .lua files. ## Changes - Added LuaLS configuration - Registered .lua file extension - Auto installs lua-language-server when not available (via [Github releases](https://github.com/LuaLS/lua-language-server/releases)) - Updated LSP documentation (packages/web/src/content/docs/lsp.mdx) ## Technical Details - The lua-language-server needs supporting files (meta/, locale/, etc.) => extract the binary into a separate dir with its supporting files (EG: /Users/user/.local/share/opencode/bin/lua-language-server-arm64-darwin/) - Check for NearestRoot with default root_makers - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#lua_ls) ## Testing Lua project LSP Attachment Log - filtered log on editing .lua extension file ``` INFO 2025-10-24T04:23:37 +4ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls, lua-ls enabled LSP servers INFO 2025-10-24T04:23:59 +3ms service=lsp.server downloading lua-language-server from GitHub releases INFO 2025-10-24T04:24:01 +1114ms service=lsp.server bin=/Users/username/.local/share/opencode/bin/lua-language-server-arm64-darwin/bin/lua-language-server installed lua-language-server INFO 2025-10-24T04:24:01 +1ms service=lsp serverID=lua-ls spawned lsp server INFO 2025-10-24T04:24:01 +0ms service=lsp.client serverID=lua-ls starting client INFO 2025-10-24T04:24:01 +1ms service=lsp.client serverID=lua-ls sending initialize INFO 2025-10-24T04:24:01 +385ms service=lsp.client serverID=lua-ls initialized INFO 2025-10-24T04:24:01 +0ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/didOpen INFO 2025-10-24T04:24:02 +133ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +3ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +0ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +3ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +0ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +2ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +1ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +6ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +1ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +2ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +1ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +4ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +8ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +6ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:02 +4ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:21 +0ms service=lsp.client serverID=lua-ls path=/dummy-path waiting for diagnostics INFO 2025-10-24T04:24:21 +0ms service=lsp.client serverID=lua-ls path=/dummy-path version=1 textDocument/didChange INFO 2025-10-24T04:24:22 +25ms service=lsp.client serverID=lua-ls path=/dummy-path textDocument/publishDiagnostics INFO 2025-10-24T04:24:22 +0ms service=lsp.client serverID=lua-ls path=/dummy-path got diagnostics ```
yindo added the pull-request label 2026-02-16 18:15:20 -05:00
yindo closed this issue 2026-02-16 18:15:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10627