You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
box,clock,config,decimal,fiber,json,log,net.box,string,table,uri,uuid,yamlmodules (lua: add basic Lua Language Server support #11038).buffer,csv,datetime,digest,fio,fun,http,merger,pickle,socket,utf8.crypto,iconv,popen,strict,swim,xlog.vshardluatestcrudqueueexpirationdkafkaIterations
Since the task is even too big for a single epic, it's split into iterations.
Reference list