LuaLS / LuaLS/lua-language-server

Not loading .luarc.json when using vscode or vim-lsp

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

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

Info Needed
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?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

When I add a .luarc.json file next to my vscode .code-workspace file, the values from my .luarc.json can control the configuration of lua-ls.

Actual Behaviour

The .luarc.json file is ignored in both vscode (v1.79.2) and gvim (9.0.1626).

Reproduction steps
  1. Create a .luarc.json and disable lowercase-global
  2. Open a file with a lowercase global in vscode or gvim
  3. See error [sumneko-lua-language-server] Lua Diagnostics.:Information:lowercase-global:Global variable in lowercase initial.

Following the format in the project's .luarc.json file and the instructions on the wiki. (Possibly those instructions aren't clear enough and there's something I'm setting up incorrectly.)

Additional Notes

Here's the contents of my entire repro project (find . -type f -exec head -n10000 {} +):

==> ./data/.luarc.json <==
{
    "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
    "diagnostics": {
        "disable": [
                        "lowercase-global"
        ]
    },
    "runtime": {
        "version": "Lua 5.4",
        "path": [
            "script/?.lua",
            "script/?/init.lua",
            "test/?.lua",
            "test/?/init.lua",
            "script/meta/?.lua"
        ],
        "pathStrict": true
    }
}

==> ./data/proj.code-workspace <==
{
        "folders": [
                {
                        "path": "scripts"
                }
        ],
        "settings": {
                "debug.allowBreakpointsEverywhere": true
        },
        "extensions": {
                "recommendations": [
                        "dwenegar.vscode-luacheck",
                        "sumneko.lua"
                ]
        },
}

==> ./data/scripts/file.lua <==
okayglobal = 10

print(okayglobal)
Log File

Log file from using gvim with prabirshrestha/vim-lsp and mattn/vim-lsp-settings:
file_C_code_project_data_scripts.log oops, from changelog.md, it looks like that gvim lua-ls version is 1.8.1.

Updated lsp (:LspInstallServer sumneko-lua-language-server) and changelog.md now says 3.0.0. Here's the log for that: file_C_code_project_data_scripts.log

I tried to get the vscode log, but there was no log folder in %homepath%\.vscode\extensions\sumneko.lua-3.2.3\server and there were no other sumneko or lua-ls folders in extensions/. My vscode lua-ls version is v3.6.22.

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

Tái hiện báo cáo với thiết lập được cung cấp gồm data/.luarc.json, data/proj.code-workspace và data/scripts/file.lua trong VS Code hoặc gvim. Kiểm tra xem cấu hình nằm kề workspace có được phát hiện và áp dụng cho các chẩn đoán Lua hay không; được xem là hoàn tất khi việc vô hiệu hóa lowercase-global sẽ loại bỏ chẩn đoán được báo cáo trong thiết lập client đã nêu.

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, vscode
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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.