LuaLS / LuaLS/lua-language-server

neovim补全项对比vscode下有缺漏

Open
#2,579 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### How are you using the lua-language-server?

NeoVim

### Which OS are you using?

Windows WSL

### What is the issue affecting?

Completion

### Expected Behaviour

想使用自动require配置类,发现nvim不会提供补全,vscode可以
![图片](https://github.com/LuaLS/lua-language-server/assets/55068959/9b174018-42c3-499f-9ca7-b586c9df0564)
配置类都形如
``` lua
--- @class TradeFesLevelConfigData
--- @field _id string
--- @field exp integer
--- @field storage integer
--- @field extraToken number

--- @class TradeFesLevelConfig
local TradeFesLevelConfig = {}
TradeFesLevelConfig.NAME="TradeFesLevel"

--- @return TradeFesLevelConfigData
function TradeFesLevelConfig.getConfig(id)
return ConfigUtil.getConfig(TradeFesLevelConfig.NAME, tostring(id))
end

--- @retrun {[string]: TradeFesLevelConfigData}
function TradeFesLevelConfig.getAllConfig()
return ConfigUtil.getAllConfig(TradeFesLevelConfig.NAME)
end

--- @return TradeFesLevelConfigData[]
function TradeFesLevelConfig.getArrayConfig()
return ConfigUtil.getConfArr(TradeFesLevelConfig.NAME)
end

return TradeFesLevelConfig
```

### Actual Behaviour

但是neovim环境下没有这些选项![图片](https://github.com/LuaLS/lua-language-server/assets/55068959/741584d5-ba8c-4fb6-a8c6-66d72598803c)

### Reproduction steps

1. Go to '...'
2. Click '...'
3. See error '...'

### Additional Notes

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

配置为lazyvim

### Log File

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the missing completion behavior in NeoVim with the provided Lua class, return annotations, and lazyvim configuration, then compare it with the reported VSCode behavior. Check whether completion exposes the returned configuration fields and methods; done means the same relevant options appear in NeoVim, with a focused reproduction or test documenting the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
devtools
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.