• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Alloyed/lua-lsp: A Lua language server

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Alloyed/lua-lsp

开源软件地址(OpenSource Url):

https://github.com/Alloyed/lua-lsp

开源编程语言(OpenSource Language):

Lua 99.8%

开源软件介绍(OpenSource Introduction):

lua-lsp

Build Status

A Language Server for Lua code, written in Lua.

It's still a work in progress, but it's usable for day-to-day. It currently supports:

  • Limited autocompletion
  • Goto definition
  • As you type linting and syntax checking
  • Code formatting
  • Supports Lua 5.1-5.3 and Luajit

Installation/Usage

lua-lsp can be installed using luarocks:

$ luarocks install --server=http://luarocks.org/dev lua-lsp

This will install the lua-lsp command. Language clients can then communicate with this process using stdio as a transport. See editors.md for more instructions specific to your editor of choice.

Plugins

lua-lsp automatically integrates with common lua packages, when they are installed. For linting, install luacheck:

$ luarocks install luacheck

For code formatting, we currently support Formatter and LCF. Formatter is 5.1 only, whereas lcf is 5.3 only. 5.1:

$ luarocks-5.1 install Formatter
$ luarocks-5.3 install lcf

If you have another package you'd like to see integrated, feel free to leave an issue/PR. Other plugins are always welcome, especially if they provide materially different results.

if lua-cjson is installed, we will optionally use it for a speed boost. It is unfortunately not supported by all versions of lua at the moment, but as soon as it is we will switch to making it mandatory.

$ luarocks install lua-cjson

Configuration

lua-lsp reads a few project-level configuration files to do its work.

To configure linting, we read your standard .luacheckrc file.

For autocomplete support, we reimplement the .luacompleterc format created by atom-autocomplete-lua. In particular, we need luaVersion to properly understand your code.

More LSP-specific configuration flags will hopefully be provided through your editor's configuration support.

TODO

The LSP spec is big, and we don't implement all of it. here's a quick wishlist ordered by roughly by priority/feasibility.

  • List references (textDocument/references)
  • Find symbols (workspace/symbol)
  • Function signature help (textDocument/signatureHelp)
  • Code links (textDocument/documentLink)
  • File events (workspace/didChangeWatchedFiles)



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap