Something went wrong. Try again.
A general purpose .. programming language written in zig ijadux2.tngl.sh/Rinnescript
zig language
Something went wrong. Try again.
1.4 kB · 52 lines
Lua
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152--- RinneScript Neovim plugin — native LSP integration.------ Usage:--- require('rinne').setup({ bin = '/path/to/rinne' })--- -- or just require('rinne') — resolves bin from g:rinne_path or PATH.local M = {}
local function find_bin(opts) local bin = opts.bin or vim.g.rinne_path or 'rinne'
-- Resolve to absolute path; if it contains a slash, treat as explicit path. if bin:find('/') then if vim.fn.executable(bin) == 1 then return bin end error(('rinne LSP binary not found or not executable: %s'):format(bin)) end
-- Bare name: search PATH. local resolved = vim.fn.executable(bin) if resolved == 1 then return bin end error( ('rinne LSP binary %q not found on PATH. ' .. 'Set g:rinne_path or pass opts.bin to require("rinne").setup().'):format(bin) )end
--- Configure and enable the RinneScript LSP client.--- Never throws for a missing binary: warns once and leaves startup intact--- (the editor must not break when the server isn't installed yet).--- @param opts? {bin?: string}function M.setup(opts) opts = opts or {} local ok, bin = pcall(find_bin, opts) if not ok then vim.notify(tostring(bin), vim.log.levels.WARN, { title = 'rinne.nvim' }) return M end
vim.lsp.config('rinne', { cmd = { bin, 'lsp' }, filetypes = { 'rinne' }, root_markers = { 'build.zig.zon', '.git' }, })
vim.lsp.enable('rinne') return Mend
return M