LuaLS / LuaLS/lua-language-server

Support 'textDocument/diagnostic' method and 'diagnosticProvider' capability

Đang mở
#2,868 6 bình luận 6 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

How are you using the lua-language-server?

Command Line

Which OS are you using?

Linux

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

Server's capabilities contain the 'diagnosticProvider' and lua language server supports method "textDocument/diagnostic"

Actual Behaviour

Server's capabilities don't contain the 'diagnosticProvider' and doesn't support method "textDocument/diagnostic"

Reproduction steps
  1. Get initialize response from server with capabilities
  2. Check capabilities list
  3. Send "textDocument/diagnostic" request
Additional Notes

No response

Log File
[06:38:37.231][info] [#0:/home/github/lua-language-server/main.lua:68]: Lua Lsp startup, root: 	/home/github/lua-language-server
[06:38:37.231][info] [#0:/home/github/lua-language-server/main.lua:69]: ROOT:	/home/github/lua-language-server
[06:38:37.231][info] [#0:/home/github/lua-language-server/main.lua:70]: LOGPATH:	/smsfw/log
[06:38:37.231][info] [#0:/home/github/lua-language-server/main.lua:71]: METAPATH:	/home/github/lua-language-server/meta
[06:38:37.231][info] [#0:/home/github/lua-language-server/main.lua:72]: VERSION:	3.10.6
[06:38:37.264][debug][#0:script/pub/pub.lua:50]: Create brave:	1
[06:38:37.264][debug][#0:script/pub/pub.lua:50]: Create brave:	2
[06:38:37.264][debug][#0:script/pub/pub.lua:50]: Create brave:	3
[06:38:37.264][debug][#0:script/pub/pub.lua:50]: Create brave:	4
[06:38:37.264][info] [#0:script/proto/proto.lua:260]: Listen Mode: stdio
[06:38:37.265][info] [#0:script/service/service.lua:146]: 
========= Medical Examination Report =========
    --------------- Memory ---------------
        Total: 2.237 MB
        # 00 : 2.237 MB
        # 01 : 0.000 MB
        # 02 : 0.000 MB
        # 03 : 0.000 MB
        # 04 : 0.000 MB
    --------------- Coroutine ---------------
        Total:     0
        Running:   0
        Suspended: 0
        Normal:    0
        Dead:      0
    --------------- Cache ---------------
        Total: 1
        Dead:  0
    ---------------  RPC  ---------------
        Holdon:   0
        Waiting:  0
==============================================
[06:38:37.371][info] [#0:script/client.lua:657]: Client init	{
  capabilities = {
    textDocument = {
      diagnostic = {
        dynamicRegistration = true
      }
    },
    workspace = {
      configuration = true,
      didChangeConfiguration = {
        dynamicRegistration = false
      }
    }
  },
  rootPath = "/smsfw",
  rootUri = "file:///smsfw",
  trace = "verbose"
}
[06:38:37.371][info] [#0:script/language.lua:137]: VSC language: nil
[06:38:37.371][info] [#0:script/language.lua:138]: LS  language: en-us
[06:38:37.371][info] [#0:script/workspace/workspace.lua:38]: Workspace init root: 	file:///smsfw
[06:38:37.371][info] [#0:script/workspace/workspace.lua:42]: Log path: 	/smsfw/log/file_smsfw.log
[06:38:37.372][info] [#0:script/workspace/workspace.lua:48]: Workspace create: 	file:///smsfw
[06:38:37.372][debug][#0:script/provider/provider.lua:134]: Server init	{
  capabilities = {
    codeActionProvider = {
      codeActionKinds = { "", "quickfix", "refactor.rewrite", "refactor.extract" },
      resolveProvider = false
    },
    codeLensProvider = {
      resolveProvider = true
    },
    colorProvider = true,
    completionProvider = {
      resolveProvider = true,
      triggerCharacters = { "\t", "\n", ".", ":", "(", "'", '"', "[", ",", "#", "*", "@", "|", "=", "-", "{", " ", "+", "?" }
    },
    definitionProvider = true,
    documentFormattingProvider = true,
    documentHighlightProvider = true,
    documentOnTypeFormattingProvider = {
      firstTriggerCharacter = "\n"
    },
    documentRangeFormattingProvider = true,
    documentSymbolProvider = true,
    executeCommandProvider = {
      commands = { "lua.removeSpace", "lua.solve", "lua.jsonToLua", "lua.setConfig", "lua.getConfig", "lua.autoRequire" }
    },
    foldingRangeProvider = true,
    hoverProvider = true,
    implementationProvider = true,
    inlayHintProvider = {
      resolveProvider = true
    },
    offsetEncoding = "utf-16",
    referencesProvider = true,
    renameProvider = {
      prepareProvider = true
    },
    semanticTokensProvider = {
      full = true,
      legend = {
        tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary", "global" },
        tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }
      },
      range = true
    },
    signatureHelpProvider = {
      triggerCharacters = { "(", "," }
    },
    textDocumentSync = {
      change = 2,
      openClose = true,
      save = {
        includeText = false
      }
    },
    typeDefinitionProvider = true,
    workspace = {
      fileOperations = {
        didRename = {
          filters = { {
              pattern = {
                glob = "/smsfw/**",
                options = {
                  ignoreCase = true
                }
              }
            } }
        }
      },
      workspaceFolders = {
        changeNotifications = true,
        supported = true
      }
    },
    workspaceSymbolProvider = true
  },
  serverInfo = {
    name = "sumneko.lua"
  }
}
[06:38:37.574][info] [#0:script/provider/provider.lua:36]: Load config from specified	/smsfw/test-luals-annotations/luarc.json
[06:38:37.574][info] [#0:script/provider/provider.lua:37]: {
  ["window.progressBar"] = false,
  ["window.statusBar"] = false
}
[06:38:37.574][debug][#0:script/filewatch.lua:53]: Watch add:	/smsfw/test-luals-annotations/
[06:38:37.574][debug][#0:script/filewatch.lua:59]: fw.add	/smsfw/test-luals-annotations/
[06:38:37.575][debug][#0:script/provider/provider.lua:274]: didOpen	file:///smsfw/luals/test_scripts/sccp_ns.lua
[06:38:37.575][trace][#0:script/files.lua:288]: Set text:	file:///smsfw/luals/test_scripts/sccp_ns.lua	takes	9.9000000000002e-05	sec.
[06:38:37.575][debug][#0:script/provider/provider.lua:274]: didOpen	file:///smsfw/luals/test_scripts/m3ua_ns.lua
[06:38:37.575][trace][#0:script/files.lua:288]: Set text:	file:///smsfw/luals/test_scripts/m3ua_ns.lua	takes	0.00022	sec.
[06:38:37.575][info] [#0:script/provider/provider.lua:49]: Load config from client	file:///smsfw
[06:38:37.575][info] [#0:script/provider/provider.lua:50]: {
  Lua = {
    diagnostics = {
      enable = true,
      ignoredFiles = "Openned",
      libraryFiles = "Openned"
    },
    workspace = {
      checkThirdParty = "",
      library = { "/smsfw/luals/library", "/smsfw/lua-core/luals_annotations/library" }
    }
  }
}
[06:38:37.676][info] [#0:script/provider/provider.lua:65]: Load config from client	fallback
[06:38:37.676][info] [#0:script/provider/provider.lua:66]: {
  Lua = {
    diagnostics = {
      enable = true,
      ignoredFiles = "Openned",
      libraryFiles = "Openned"
    },
    workspace = {
      checkThirdParty = "",
      library = { "/smsfw/luals/library", "/smsfw/lua-core/luals_annotations/library" }
    }
  }
}
[06:38:37.776][warn] [#0:script/proto/proto.lua:170]: Recieved unknown proto: textDocument/diagnostic

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu trong script/proto/proto.lua, nơi log báo cáo phương thức textDocument/diagnostic không xác định, và script/provider/provider.lua, nơi các capability của server được tập hợp. Theo dõi luồng diagnostics hiện có và cách xử lý request LSP. Được xem là hoàn thành khi phản hồi initialize công bố diagnosticProvider và các request textDocument/diagnostic được hỗ trợ mà không có cảnh báo giao thức không xác định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
lua
Lĩnh vực
backend-api-design, devtools
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.