From 4a2203892fa08b3436701516c01146db75e79001 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Wed, 11 Mar 2026 15:06:31 +0100 Subject: [PATCH] [Lua] Add lovr support --- lovr-integration.sh | 14 +++++++++++ nvim/lua/plugins/lsp/ls/luals.lua | 41 +++++++++++++++++-------------- 2 files changed, 37 insertions(+), 18 deletions(-) create mode 100755 lovr-integration.sh diff --git a/lovr-integration.sh b/lovr-integration.sh new file mode 100755 index 0000000..7366397 --- /dev/null +++ b/lovr-integration.sh @@ -0,0 +1,14 @@ +#!/bin/sh + + +cd ~/.local/share +if [[ -d lovr-docs ]] then + echo "Already present, updating repo" + cd lovr-docs + git pull +else + git clone https://bjornbytes/lovr-docs + cd lovr-docs +fi + +lovr api cats diff --git a/nvim/lua/plugins/lsp/ls/luals.lua b/nvim/lua/plugins/lsp/ls/luals.lua index e4dfbde..0d66ae0 100644 --- a/nvim/lua/plugins/lsp/ls/luals.lua +++ b/nvim/lua/plugins/lsp/ls/luals.lua @@ -7,26 +7,31 @@ local capabilities = require("lsp-options").capabilities local on_attach = require("lsp-options").on_attach lsp.config("lua_ls", { - capabilities = capabilities, - on_attach = on_attach, - settings = { - Lua = { - -- make the language server recognize "vim" global - diagnostics = { - globals = { "vim" }, - }, - workspace = { - -- make language server aware of runtime files - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, + capabilities = capabilities, + on_attach = on_attach, + settings = { + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + workspace = { + -- make language server aware of runtime files + library = { + vim.fn.expand("$VIMRUNTIME/lua"), + vim.fn.stdpath("config") .. "/lua", + vim.fn.expand("~/.luarocks/share/lua/5.3"), + -- To use LÖVR, follow https://lovr.org/docs/dev/VS_Code_Setup#manual-installation + -- TL;DR run lovr api cats in the lovr-docs repo and update the path below + -- Then update the blow path (if you have not used the script in this repo) + vim.fn.expand("~/.local/share/lovr-docs/api/cats/"), + "/usr/share/lua/5.3", + }, + }, + }, + }, }) - -- ── Enable configs ─────────────────────────────────────────────── local enable = vim.lsp.enable enable("lua_ls")