LuaLS / LuaLS/lua-language-server

一些3.4.0新增功能的语法检查异常

Open
#1,260 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement feat/type check Info Needed
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/8649540/176608459-270e925f-8133-4abb-b80b-87b3c27bd8c2.png)
![image](https://user-images.githubusercontent.com/8649540/176608487-04dcf577-4ec0-4919-8f84-0cc0a5930d4c.png)
单独写lua没能复现
另外有没有强制修改类型的配置方式,比如
`---@class A
local a = {}
---@class B:A

---@type string|number
local c = 1

---comment
---@return A
---@return string|number
local function func1()
return a, c
end

---comment
---@return B
---@return number
local function func2()
local ta, tb = func1()
return ta, tb
end`
在这种情况下我怎么去配置使ta、ta符合返回值类型?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two screenshots and the provided Lua annotations involving A, B, and union return types. Reproduce the 3.4.0 syntax-checking behavior in the language server, then determine whether the reported diagnostics and the requested forced-type configuration can be addressed; done means the behavior is explained and a concrete configuration or limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.