LuaLS / LuaLS/lua-language-server

`[meta]` annotations should be loaded instead of just reading the file

Đang mở
#2,358 0 bình luận 0 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?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

MacOS

What is the issue affecting?

Annotations, Libraries

Expected Behaviour
{
    "Lua.workspace.checkThirdParty": false,
    "diagnostics.groupSeverity": {
        "ambiguity": "Error",
        "await": "Error",
        "codestyle": "Error",
        "duplicate": "Hint",
        "global": "Error",
        "luadoc": "Error",
        "redefined": "Information",
        "strict": "Error",
        "strong": "Error",
        "type-check": "Error",
        "unbalanced": "Error",
        "unused": "Hint",
        "conventions": "Error"
    },
    "diagnostics.disable": [
        "duplicate-doc-alias",
        "duplicate-doc-field"
    ],
    // "runtime.path": [
    //     "?.lua",
    //     "?/init.lua",
    // ],
    "runtime.pathStrict": true,
    "runtime.version": "LuaJIT",
    "workspace.ignoreDir": [
        ".vscode",
        ".luarocks"
    ],
    "workspace.library": [
        "/Users/frityet/Library/Application Support/Code/User/globalStorage/sumneko.lua/addonManager/addons/penlight/module/library",
        "${3rd}/lfs/library",
        "lua_modules/lib/lua/5.1/",
        "lua_modules/share/lua/5.1/",
        "/Users/frityet/Library/Application Support/Code/User/globalStorage/sumneko.lua/addonManager/addons/openresty/module/library"
    ],
    "diagnostics.globals": [
        "ngx"
    ],
}

local stringio = require("pl.stringio")

stringio should use the definition from meta

Actual Behaviour

it reads the real pl.stringio and uses that (which does have't luaLS annotations, etc)

Reproduction steps
  1. Download and load penlight into a directory
  2. Add the penlight addon
  3. require a penlight file
Additional Notes

No response

Log File

file_Users_frityet_Documents_ChatGPT-Plugins_Lua.log

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 bằng cách theo dõi cách require("pl.stringio") phân giải addon Penlight và cách các chú thích [meta] được xử lý, đồng thời so sánh đường đi đó với tệp pl.stringio thực tế. Được xem là hoàn thành khi require sử dụng định nghĩa từ các chú thích meta, bao gồm cả các chú thích LuaLS của chúng, thay vì tệp runtime không có chú thích.

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
devtools
Loại issue
Lỗi
Độ 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
45/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.