Coder Social home page Coder Social logo

lua-lsp's Introduction

tarantool-lsp

Build Status

A Language Server for Tarantool/Lua code, written in Lua.

It is still a work in progress, but quite usable. It currently supports:

  • Limited auto-completion
  • Goto definition
  • As you type linting and syntax checking
  • Code formatting
  • Lua 5.1

Tarantool specific

  • Autocompletion for Tarantool built-in libs on the fly:

    Completion

  • Hovering for Tarantool built-in libs on the fly:

    Hover

  • Enhanced completion:

    • [NEW] Completions triggered only on require
  • Implementation CLI doc manager:

    • parsing Tarantool documentation
    • version management
    • manual updates
  • Powered by Tarantool

Installation/Usage

tarantool-lsp can be installed using brew:

$ brew install https://github.com/tarantool/lua-lsp/raw/master/tarantoollsp.rb --HEAD

This will install the tarantool-lsp.

To enable Tarantool documentation for the server, say:

$ tarantool-lsp docs init

To update the documentation, say:

$ tarantool-lsp docs update

After this, configure your text editor. 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.

Library

You can use tarantool-lsp as a library for webserver with websocket.

tarantoolctl rocks install tarantool-lsp

In-code usage:

create_websocket_handler()

Plugins

tarantool-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 some other package and you would like to see it integrated, feel free to leave an issue/PR. Other plugins are always welcome, especially if they provide materially different results.

Configuration

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

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

For auto-complete 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 is a quick wishlist, roughly ordered by priority/feasibility.

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

lua-lsp's People

Contributors

alloyed avatar artur-barsegyan avatar doronbehar avatar kattrali avatar vadi2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.