chore: add default luarc.json for Lua development (#16487)

The Sumneko Lua language server has matured quite a bit and many
Neovim developers use it while working on Neovim. Having a default
configuration for Neovim development is a nice convenience (and
dovetails well with the auto-generated compile_command.json for C
development).

The file is shipped under `contrib` and users can make use of it by
symlinking to `.luarc.json` in the project root.
This commit is contained in:
Gregory Anders 2021-12-01 12:09:50 -07:00 committed by GitHub
parent 99f6260f84
commit 73b35ef10f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
# Tools
/venv/
compile_commands.json
/.luarc.json
# IDEs
/.vs/

View File

@ -244,6 +244,10 @@ You can lint a single file (but this will _not_ exclude legacy errors):
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
unmaintained and won't recognize many function signatures in Neovim source.)
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
- If using [lua-language-server][], symlink `contrib/luarc.json` into the
project root:
$ ln -s contrib/luarc.json .luarc.json
Reviewing
@ -288,3 +292,4 @@ as context, use the `-W` argument as well.
[pr-draft]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
[uncrustify]: https://formulae.brew.sh/formula/uncrustify
[lua-language-server]: https://github.com/sumneko/lua-language-server/

23
contrib/luarc.json Normal file
View File

@ -0,0 +1,23 @@
{
"runtime.version": "LuaJIT",
"diagnostics": {
"enable": true,
"globals": [
"vim",
"describe",
"it",
"before_each",
"after_each",
"setup",
"teardown"
]
},
"workspace": {
"library": {
"runtime/lua": true
},
"maxPreload": 2000,
"preloadFileSize": 1000
},
"telemetry.enable": false
}