LuaLS / LuaLS/lua-language-server

为函数的参数增加key注释

Open
#2,216 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
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?

Visual Studio Code Extension (sumneko.lua)

### Which OS are you using?

Windows

### What is the issue affecting?

Other

### Expected Behaviour

当一个函数的参数为table时,该怎么为这个参数内的一些key做说明呢,
![image](https://github.com/LuaLS/lua-language-server/assets/58101915/ceed1553-6d00-49cd-8a57-0ca94d0fd65a)
比如这个例子,直接这样写注释是可以看到,但是看起来乱糟糟的,无法清楚的识别,
有什么办法可以做到类似@alias的格式很方便观看table内每个key都是需要传入什么吗

### Actual Behaviour

如上

### Reproduction steps

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

### Additional Notes

_No response_

### Log File

_No response_

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

Reproduce the request in the Visual Studio Code Extension with a Lua function whose table parameter has documented keys. Review LuaLS's existing parameter and @alias annotation behavior, then define how key annotations should be represented and displayed; done means the keys are clearly identifiable in the editor.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.