LuaLS / LuaLS/lua-language-server

Remove continuous empty lines

Open
#1,687 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat/formatter
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?

Visual Studio Code Extension (sumneko.lua)

### Which OS are you using?

Linux

### What is the issue affecting?

Formatting

### Expected Behaviour

continuous empty lines should be removed

### Actual Behaviour

nothing happen?

### Reproduction steps

1. Go to lua source file
2. Add continuous empty lines
3. Click save to `Format` the code

### Additional Notes

I have the following vscode setting.json file:
```json
{
"Lua.format.defaultConfig": {
"indent_style": "tab",
"indent_size": "4",
"max_line_length": "80",
"max_continuous_line_distance": "1",
},
}
```

### Log File

[21:31:44.449][info] [#0:/home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/main.lua:65]: Lua Lsp startup, root: /home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server
[21:31:44.450][info] [#0:/home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/main.lua:66]: ROOT: /home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server
[21:31:44.450][info] [#0:/home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/main.lua:67]: LOGPATH: /home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/log
[21:31:44.450][info] [#0:/home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/main.lua:68]: METAPATH: /home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/meta
[21:31:44.450][info] [#0:/home/wahabz/.vscode/extensions/sumneko.lua-3.6.2-linux-x64/server/main.lua:69]: VERSION: 3.6.2
[21:31:44.520][info] [#0:script/service/service.lua:141]:
========= Medical Examination Report =========
--------------- Memory ---------------
Total: 1.545 MB
# 00 : 1.545 MB
# 01 : 0.000 MB
# 02 : 0.000 MB
# 03 : 0.000 MB
# 04 : 0.000 MB
--------------- Coroutine ---------------
Total: 0
Running: 0
Suspended: 0
Normal: 0
Dead: 0
--------------- Cache ---------------
Total: 1
Dead: 0
--------------- RPC ---------------
Holdon: 0
Waiting: 0
==============================================
[21:31:44.531][info] [#0:script/language.lua:137]: VSC language: en-us
[21:31:44.531][info] [#0:script/language.lua:138]: LS language: en-us

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 formatter behavior in a Lua source file using the reported VS Code setting, especially max_continuous_line_distance. Start by tracing the formatting entry point used on save and locate the formatter tests, then verify that formatting removes continuous empty lines while respecting the configured maximum distance.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vscode
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.