LuaLS / LuaLS/lua-language-server

completion not work after a line comment at tail

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

Nobody has claimed this yet.

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?

MacOS

What is the issue affecting?

Completion

Expected Behaviour
obj
    :test() -- some comment
    :test()

the second test() should complete as expected

Actual Behaviour

the second test() can not complete
image

Reproduction steps

the test lua code:

---@meta test

---@class Test
---@overload fun():Test
Test = {}
---@return Test
function Test:test() end

local obj = Test()
obj
    :test()
    :test() -- comment
    :test()
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 completion failure in NeoVim using the Lua code in the issue, especially the chained calls with a trailing line comment. Trace the completion path for the second call after the commented line and compare it with the expected behavior. Done means completion works for that call while preserving the existing comment handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.