rfmt 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/Cargo.lock +266 -92
- data/README.md +22 -18
- data/ext/rfmt/Cargo.toml +4 -1
- data/ext/rfmt/src/doc/builders.rs +528 -0
- data/ext/rfmt/src/doc/mod.rs +220 -0
- data/ext/rfmt/src/doc/printer.rs +684 -0
- data/ext/rfmt/src/format/context.rs +448 -0
- data/ext/rfmt/src/format/formatter.rs +226 -0
- data/ext/rfmt/src/format/mod.rs +35 -0
- data/ext/rfmt/src/format/registry.rs +195 -0
- data/ext/rfmt/src/format/rule.rs +555 -0
- data/ext/rfmt/src/format/rules/begin.rs +295 -0
- data/ext/rfmt/src/format/rules/body_end.rs +109 -0
- data/ext/rfmt/src/format/rules/call.rs +409 -0
- data/ext/rfmt/src/format/rules/case.rs +359 -0
- data/ext/rfmt/src/format/rules/class.rs +160 -0
- data/ext/rfmt/src/format/rules/def.rs +216 -0
- data/ext/rfmt/src/format/rules/fallback.rs +116 -0
- data/ext/rfmt/src/format/rules/if_unless.rs +407 -0
- data/ext/rfmt/src/format/rules/loops.rs +325 -0
- data/ext/rfmt/src/format/rules/mod.rs +31 -0
- data/ext/rfmt/src/format/rules/module.rs +150 -0
- data/ext/rfmt/src/format/rules/singleton_class.rs +202 -0
- data/ext/rfmt/src/format/rules/statements.rs +122 -0
- data/ext/rfmt/src/format/rules/variable_write.rs +296 -0
- data/ext/rfmt/src/lib.rs +8 -5
- data/ext/rfmt/src/parser/prism_adapter.rs +157 -2
- data/lib/rfmt/version.rb +1 -1
- data/lib/ruby_lsp/rfmt/formatter_runner.rb +2 -0
- metadata +23 -2
- data/ext/rfmt/src/emitter/mod.rs +0 -1760
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 538d3def9f35a241acf4089c99a2d905acb03f77a097a2ad88b19e47c2009d16
|
|
4
|
+
data.tar.gz: 28e0cbe935992181c22056f16c1a2edb52fac170a80400905e2cee90f0eec1ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4169b3f6b4d2dae45fbddec1b299ca2f787b8a854999d03c3f63307e9af2ef5007076d74f96852e3624e3a0d269b9480c2fbe8064bb707e57863df71e7d88618
|
|
7
|
+
data.tar.gz: fc8cd1357d92ca01a5829248a58bc42f4f731f4122274950e98d17daa7a51c0a53a0e35c3cbbc2132b8a489d474adaf4489be05e9ec41f37c4412d6da1e27ece
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.6.0] - 2026-04-23
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Rule-based formatter architecture**: new modular `format/` pipeline (`Formatter`, `Registry`, `Rule`) replacing the legacy monolithic emitter
|
|
7
|
+
- **Intermediate Representation (IR) module**: decouples parsing from emission for composability and testability
|
|
8
|
+
- New formatter rules: `StatementsRule` (body indentation), `SingletonClassRule`, `VariableWriteRule`
|
|
9
|
+
- Method chain reformatting: convert aligned style to indented style when lines exceed the configured width
|
|
10
|
+
- Chain reformatting wired into the fallback path for resilience
|
|
11
|
+
- `config` module exported for test consumption
|
|
12
|
+
- **Editor Integration Documentation**: comprehensive setup guides for VSCode, Neovim, Helix, Emacs, and Zed
|
|
13
|
+
- VSCode: Format on Save configuration with Ruby LSP, settings reference table, project-specific setup
|
|
14
|
+
- Zed: full configuration with `initialization_options` and `format_on_save`
|
|
15
|
+
- All editors work through the Ruby LSP addon system — no editor-specific plugins required
|
|
16
|
+
- README: Editor Integration section updated with VSCode quick start (replacing "Coming Soon")
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Printer optimized with indent cache and inline hints
|
|
20
|
+
- `reformat_chain_lines` deduplicated across rules and optimized with `Cow` to reduce allocations
|
|
21
|
+
- README: Neovim integration updated from CLI-based to Ruby LSP-based approach
|
|
22
|
+
- Removed Sublime Text section from editor documentation (replaced by Zed)
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Prism comment JSON deserialization now accepts `comment_type` and `embdoc` fields (#97)
|
|
26
|
+
- BTreeMap range panic when computing comment indices on edge inputs
|
|
27
|
+
- Comment duplication during source extraction
|
|
28
|
+
- Empty source input handled gracefully by the formatter runner
|
|
29
|
+
- Clippy warnings: use `repeat_n`
|
|
30
|
+
|
|
31
|
+
### Removed
|
|
32
|
+
- Legacy `Emitter` module (1844 LOC) — superseded by the new `Formatter`
|
|
33
|
+
|
|
34
|
+
## [1.5.3] - 2026-02-22
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Update package dependencies
|
|
38
|
+
|
|
3
39
|
## [1.5.2] - 2026-02-21
|
|
4
40
|
|
|
5
41
|
### Added
|