LuaLS / LuaLS/lua-language-server

Formatting is not working

オープン
#2,191 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Info Needed
主要言語
Lua
スター
4.4k
フォーク
442
PR マージ指標
30日以内にマージされた PR はありません

説明

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Formatting

Expected Behaviour

The document gets formatted.

Actual Behaviour

I get [LSP] Format request failed, no matching language servers. logged. Formatters for other lsps are working. :LspInfo shows lua_ls is running.

Reproduction steps
  1. I installed lua-language-server 3.6.22 via nix
  2. Here is my lspconfig:
require'lspconfig'.lua_ls.setup{
    settings = {
    Lua = {
      runtime = {
        -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
        version = 'LuaJIT',
      },
      diagnostics = {
        -- Get the language server to recognize the `vim` global
        globals = {'vim'},
      },
      workspace = {
        -- Make the server aware of Neovim runtime files
        library = vim.api.nvim_get_runtime_file("", true),
      },
      -- Do not send telemetry data containing a randomized but unique identifier
      telemetry = {
        enable = false,
      },
      format = {
        enable = true,
        defaultConfig = {
          indent_style = "tab",
        },
      },
    },
  },
}
Additional Notes

:LspInfo:

 Press q or <Esc> to close this window. Press <Tab> to view server doc.
 
 Language client log: /home/marcel/.local/state/nvim/lsp.log
 Detected filetype:   lua
 
 0 client(s) attached to this buffer: 
 
 Other clients that match the filetype: lua
 
 Config: lua_ls
 	filetypes:         lua
 	root directory:    /home/marcel/.dotfiles
 	cmd:               /nix/var/nix/profiles/default/bin/lua-language-server
 	cmd is executable: true
 	autostart:         true
 	custom handlers:   
 
 Configured servers list: phpactor, tsserver, lua_ls, ccls, elmls, rust_analyzer, pyright, vuels, texlab
Log File
[START][2023-02-22 23:00:05] LSP logging initiated
[INFO][2023-02-22 23:01:41] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2023-02-22 23:01:42] LSP logging initiated
[START][2023-02-22 23:03:42] LSP logging initiated
[START][2023-02-22 23:04:00] LSP logging initiated
[START][2023-02-22 23:05:11] LSP logging initiated
[START][2023-02-22 23:06:26] LSP logging initiated

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、示されている lspconfig.lua_ls.setup 設定を使って NeoVim で失敗を再現し、次に :LspInfo と参照されている /home/marcel/.local/state/nvim/lsp.log を調べます。Lua バッファが lua_ls にアタッチされ、「no matching language servers」エラーなしでフォーマット要求が成功すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
lua, neovim
領域
developer-experience, tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。