Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated (field and function) completion items for recursively called functions in module #613

Closed
smackesey opened this issue Jul 21, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@smackesey
Copy link

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
@sumneko sumneko added the bug Something isn't working label Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants