LuaLS / LuaLS/lua-language-server

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

未关闭
#2,358 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

### 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

```json
{
"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"
],
}

```

```lua
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](https://github.com/LuaLS/lua-language-server/files/12778338/file_Users_frityet_Documents_ChatGPT-Plugins_Lua.log)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪 require("pl.stringio") 如何解析 Penlight addon,以及 [meta] 注解如何被处理,并将该路径与实际的 pl.stringio 文件进行比较。完成的标准是:require 使用来自 meta 注解的定义,包括其中的 LuaLS 注解,而不是未添加注解的运行时文件。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。