LuaLS / LuaLS/lua-language-server
Function assigned to field should be completed as function
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Lua
- Estrelas
- 4.4k
- Forks
- 442
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
### 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?
Completion
### Expected Behaviour
When providing an alias for a function in a table, the alias should be treated as a function.
### Actual Behaviour
When providing an alias for a function in a table, the alias is treated as a field and does not get completed as a function. Hover shows that the field is a function, but completion does not agree or complete with parentheses.

### Reproduction steps
1. Use the below code
```lua
---@class myTable
local t = {}
---Does a thing
---@param a integer
---@param b string
---@param c boolean
function t.myFunc(a, b, c) end
t.myAlias = t.myFunc
```
2. Try to get completions for the **function** `t.myAlias`
### Additional Notes
This would be incredibly useful for aliasing a function — something that [luassert](https://github.com/sumneko/lua-language-server/pull/1556) does **a lot**.
### Log File
_No response_
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Reproduce the issue in the LuaLS Visual Studio Code extension using the provided t.myFunc and t.myAlias example, then trace the completion and type information handling for the alias. Done means t.myAlias is recognized as a function in completion, offers parentheses, and agrees with the function type shown by hover.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- lua
- Domínio
- devtools
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100