Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- The language server has an initialization option called `respect_editor_formatting_options`.
If it's true, the formatting handler will override the configurations `indent-width` and `indent-type` with values from [FormattingOptions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions)

### Changed

- In language server mode, compute the difference between the unformatted and formatted document and only respond with the changes.
- Include `serverInfo` in the language server's [`InitializeResponse`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initializeResult)

### Fixed

- Fixed comments lost from expression after parentheses are removed when we are attempting to "hang" the expression. ([#1033](https://github.com/JohnnyMorganz/StyLua/issues/1033))
- `document_range_formatting_provider` field missing from `ServerCapabilities`

## [2.2.0] - 2025-09-14

Expand Down
14 changes: 12 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ num_cpus = "1.16.0"
regex = "1.10.2"
serde = "1.0.188"
serde_json = "1.0.108"
similar = { version = "2.3.0", features = ["text", "inline", "serde"] }
similar = { version = "2.3.0", features = ["text", "inline", "serde", "bytes"] }
strum = { version = "0.25.0", features = ["derive"], optional = true }
thiserror = "1.0.49"
threadpool = "1.8.1"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ StyLua can run as a language server, connecting with language clients that follo
It will then respond to `textDocument/formatting` and `textDocument/rangeFormatting` requests.
Formatting is only performed on files with a `lua` or `luau` language ID.

If the initialization option `respect_editor_formatting_options` is set to `true`, the formatting handler will override the configurations `indent-width` and `indent-type` with values from [FormattingOptions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#formattingOptions).

You can start the language server by running:

```sh
Expand Down
Loading
Loading