Closed vekatze closed 1 month ago
neut format-source
import {..}
textDocument/formatting
neut format-source --minimize-imports
# format ← (used by textDocument/formatting) ❯ hyperfine "neut format-source source/neural.nt" Benchmark 1: neut format-source source/neural.nt Time (mean ± σ): 33.6 ms ± 1.3 ms [User: 14.9 ms, System: 15.8 ms] Range (min … max): 30.4 ms … 36.1 ms 82 runs # format + remove used items in `import {..}` ← (used by textDocument/codeAction) ❯ hyperfine "neut format-source --minimize-imports source/neural.nt" Benchmark 1: neut format-source --minimize-imports source/neural.nt Time (mean ± σ): 135.7 ms ± 7.4 ms [User: 245.9 ms, System: 74.6 ms] Range (min … max): 124.3 ms … 148.8 ms 19 runs
before
neut format-source
tracks all the imported files recursively and remove unused items inimport {..}
automaticallytextDocument/formatting
== (format + remove used items inimport {..}
)after
neut format-source
simply formats given filesneut format-source --minimize-imports
formats given files and removes unused items inimport {..}
textDocument/formatting
== (format)import {..}
)benchmark