LuaLS / LuaLS/lua-language-server
textDocument/formatting should return a edits instead of totall text for client
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
https://github.com/sumneko/lua-language-server/blob/f760dc359b389c20a0d48bef463d14800e67894c/script/core/formatting.lua#L5-L25
As a server, we should diff the document and the return result and generate the edits for the client.
If the server returns totally text result, the context resource in the client may be invalid, like semantic token.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with script/core/formatting.lua, especially lines 5-25, and trace the textDocument/formatting response. Compare the formatted document with the original and follow the issue's requirement to generate edits rather than return the entire text. Done means the client receives edits and its existing context resources remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100