tarantool / tarantool/tarantool
lua: add support for Lua Language Server
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 3.7k
- Forks
- 419
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 88
Description
Introduction
Lua used by Tarantool has dynamic type system. It may complicate the development of the Tarantool applications because of lack of static checks and absence of IDE/text editor autocomplete support since types of the values can't be inferred before script execution. There are tools such as Lua Language Server (ex. Sumneko Lua Server) [1] allowing providing type annotations and class definitions for performing some static checks. There is a Tarantool VSCode extension [2] for Lua Language Server with type definitions for the most of the Tarantool functions. The problem is that the extension is maintained externally. It means some of the type definitions are deprecated and aren't used in the internal code during the development.
Suggestion
It's suggested to migrate the type definitions inside the Tarantool itself and to provide a straightforward way to supply IDE with type definitions for performing static checks when developing Tarantool. It'd good to reuse the language server checks during the development to make new code more reliable, simplify the development and review process. Also, this type definitions may involve documentation on the functions thus they can be reused for exporting documentation reference.
Implementation
Adding the support includes the following tasks.
- Migrate and actualize type definitions for C-defined Lua functions and Lua modules from the VSCode extension [2]. Since there are a lot of modules it's suggested to work in three iterations.
-
box,clock,config,decimal,fiber,json,log,net.box,string,table,uri,uuid,yamlmodules (#11038). -
buffer,csv,datetime,digest,fio,fun,http,merger,pickle,socket,utf8. -
crypto,iconv,popen,strict,swim,xlog.
-
- Support exporting definition files for Lua Language Server [3] for developing Tarantool applications (#11038).
- Migrate and provide type definitions for popular Tarantool modules.
-
vshard -
luatest -
crud -
queue -
expirationd -
kafka - Likely, something else.
-
- Implement building plugins for popular text editors: Neovim, VSCode.
- Bulid a PoC of exporting Lua function documentation reference from type definitions.
- Add type definitions for internal Lua methods and classes.
- Add support for explicitly specifying space schema for providing static checks of the database tuples.
- Include static checks of the Lua Language Server in CI.
- Require the developer to supply type definitions for new Lua functions.
Iterations
Since the task is even too big for a single epic, it's split into iterations.
- #11038
Reference list
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading iteration #11038 and the Lua Language Server definition-file guidance, then compare the Tarantool VSCode extension definitions referenced in the issue. The issue spans migration, editor integration, documentation, and CI without naming project files or tests; a contribution needs one explicitly scoped iteration with its validation criteria defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- developer-experience, documentation, testing-qa, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100