chore: luals runtime.version only set during check, to prevent lua version ambuguity at dev time (#2975)
* chore: luals runtime.version only set during check, to prevent lua version ambuguity at dev time
* inject lua 5.1 check failure
* Revert "inject lua 5.1 check failure"
This reverts commit eed966dc7b.
This commit is contained in:
parent
14039337a5
commit
8f974879a0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
"$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": {
|
"workspace": {
|
||||||
"library": [
|
"library": [
|
||||||
"$VIMRUNTIME/lua/vim",
|
"$VIMRUNTIME/lua/vim",
|
||||||
|
|||||||
@ -9,15 +9,20 @@ if [ -z "${VIMRUNTIME}" ]; then
|
|||||||
export VIMRUNTIME="/usr/share/nvim/runtime"
|
export VIMRUNTIME="/usr/share/nvim/runtime"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DIR_SRC="lua"
|
DIR_SRC="${PWD}/lua"
|
||||||
DIR_OUT="luals-out"
|
DIR_OUT="${PWD}/luals-out"
|
||||||
|
FILE_LUARC="${DIR_OUT}/luarc.json"
|
||||||
|
|
||||||
# clear output
|
# clear output
|
||||||
rm -rf "${DIR_OUT}"
|
rm -rf "${DIR_OUT}"
|
||||||
mkdir "${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
|
# 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=$?
|
RC=$?
|
||||||
|
|
||||||
echo "${OUT}" >&2
|
echo "${OUT}" >&2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user