Closed
Description
Describe the bug
Both a field and a function completion item are generated for functions that are called recursively in a module. Only a function item should be generated.
To Reproduce
Steps to reproduce the behavior:
Create this module:
# test.lua
local m = {}
function m.myfunc(n)
print(n)
if n == 1 then return
else m.myfunc(n-1)
end
end
function m.myotherfunc(n)
print(n)
end
return m
Then require it in another module and look at the provided completions:
# test_other.lua
local test = require('test')
test. -- cursor here
I get three completion items from test (text representation here is from coc, but that's incidental):
myfunc~ m [LS]
myfunc(n)~ S [LS]
myotherfunc(n)~ S [LS]
Expected behavior
The first completion item should not show up.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- OS: macOS big sur
- Is WSL remote?
- Client: Neovim 0.5