chore: luals runtime.version only set during check, to prevent lua version ambuguity at dev time
This commit is contained in:
parent
14039337a5
commit
53d178dbf2
@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "Lua 5.1",
|
||||
"runtime.version.luals-check-only": "Lua 5.1",
|
||||
"workspace": {
|
||||
"library": [
|
||||
"$VIMRUNTIME/lua/vim",
|
||||
|
||||
@ -9,15 +9,20 @@ if [ -z "${VIMRUNTIME}" ]; then
|
||||
export VIMRUNTIME="/usr/share/nvim/runtime"
|
||||
fi
|
||||
|
||||
DIR_SRC="lua"
|
||||
DIR_OUT="luals-out"
|
||||
DIR_SRC="${PWD}/lua"
|
||||
DIR_OUT="${PWD}/luals-out"
|
||||
FILE_LUARC="${DIR_OUT}/luarc.json"
|
||||
|
||||
# clear output
|
||||
rm -rf "${DIR_OUT}"
|
||||
mkdir "${DIR_OUT}"
|
||||
|
||||
# Uncomment runtime.version for strict neovim baseline 5.1
|
||||
# It is not set normally, to prevent luals loading 5.1 and 5.x, resulting in both versions being chosen on vim.lsp.buf.definition()
|
||||
cat "${PWD}/.luarc.json" | sed -E 's/.luals-check-only//g' > "${FILE_LUARC}"
|
||||
|
||||
# execute inside lua to prevent luals itself from being checked
|
||||
OUT=$(lua-language-server --check="${DIR_SRC}" --configpath="${PWD}/.luarc.json" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error)
|
||||
OUT=$(lua-language-server --check="${DIR_SRC}" --configpath="${FILE_LUARC}" --checklevel=Information --logpath="${DIR_OUT}" --loglevel=error)
|
||||
RC=$?
|
||||
|
||||
echo "${OUT}" >&2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user