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

EmmyLua/EmmyLua-LanguageServer

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

开源软件名称(OpenSource Name):

EmmyLua/EmmyLua-LanguageServer

开源软件地址(OpenSource Url):

https://github.com/EmmyLua/EmmyLua-LanguageServer

开源编程语言(OpenSource Language):

Java 74.7%

开源软件介绍(OpenSource Introduction):

Emmy Lua Language Server

CI status Download
Build status EmmyLua-LS-all.jar

Emmy lua Language server have lots of features for lua language, including:

  • Find usages
  • Go to definition
  • Comment based type/class annotation
  • Basic completion

For an exhaustive list of features see the intellij plugin description.

Requirements

Building

Run from root:

$ gradlew shadowJar

The EmmyLua-LS-all.jar file will be created in EmmyLua-LanguageServer/EmmyLua-LS/build .

Running Server

To run the language server use:

$ java -cp EmmyLua-LS-all.jar com.tang.vscode.MainKt

Adding to an Sublime

Just pass the instantiating instruction to the LSP plugin.

Example: adding EmmyLua to SublimeText with Sublime-LSP:

  • install the LSP plugin in sublime
  • add emmy as a client to LSP.sublime-settings:
{
    "clients":
    {
        "emmy":
        {
            "command":
            [
                "java",
                "-cp",
                "<path to jar>/*",
                "com.tang.vscode.MainKt"
            ],
            "enabled": true,
            "languageId": "lua",
            "scopes":
            [
                "source.lua"
            ],
            "syntaxes":
            [
                "Packages/Lua/Lua.sublime-syntax"
            ]
        }
    }
}

Adding to Emacs

you can use lsp-lua-emmy as lsp client.

add following code to your ~/.emacs or .emacs.d/init.el .

(use-package lsp-mode
  :ensure t
  :commands lsp
  :hook ((lua-mode) . lsp)
  :config
  )

(use-package company-lsp
  :ensure t
  :after lsp-mode
  :config
  (setq company-lsp-enable-recompletion t)
  (setq lsp-auto-configure nil)         ;该功能会自动执行(push company-lsp company-backends)
  )

(use-package lsp-lua-emmy
  :demand
  :ensure nil
  :load-path "~/github/lsp-lua-emmy"
  :hook (lua-mode . lsp)
  :config
  (setq lsp-lua-emmy-jar-path (expand-file-name "EmmyLua-LS-all.jar" user-emacs-directory))
  )

(defun set-company-backends-for-lua()
  "Set lua company backend."
  (setq-local company-backends '(
                                 (
                                  company-lsp
                                  company-lua
                                  company-keywords
                                  company-gtags
                                  company-yasnippet
                                  )
                                 company-capf
                                 company-dabbrev-code
                                 company-files
                                 )))

(use-package lua-mode
  :ensure t
  :mode "\\.lua$"
  :interpreter "lua"
  :hook (lua-mode . set-company-backends-for-lua)
  :config
  (setq lua-indent-level 4)
  (setq lua-indent-string-contents t)
  (setq lua-prefix-key nil)
  )

work with company-mode and lua-mode in Emacs 26.1:

work-with-emacs

Adding to Vim/NeoVim

Install Vim-EasyComplete. Run InstallLspServer after opening a lua file with vim.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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