this checks all the dependencies and the main module to generate completion caches
added a code action that performs neut check --full
performance fix: cache the clang digest when performing textDocument/completion
see below
the effect of the performance fix on textDocument/completion
# before
❯ hyperfine "neut bench-completion"
Benchmark 1: neut bench-completion
Time (mean ± σ): 215.8 ms ± 8.9 ms [User: 725.7 ms, System: 680.6 ms]
Range (min … max): 207.4 ms … 242.3 ms 14 runs
# after
❯ hyperfine "neut bench-completion"
Benchmark 1: neut bench-completion
Time (mean ± σ): 45.7 ms ± 1.4 ms [User: 26.2 ms, System: 25.0 ms]
Range (min … max): 41.8 ms … 48.9 ms 63 runs
The subcommand bench-completion is only for this performance comparison (not commited to main); The internal of the subcommand is essentially as follows:
benchCompletion :: App ()
benchCompletion = do
result <- runAppM $ complete (Uri "file:///path/to/some/file.nt") (Position 10 0)
case result of
Left es -> do
printErrorList es
printNote' "err"
Right _ ->
printNote' "pass"
return ()
neut check --full
neut check --full
textDocument/completion
the effect of the performance fix on
textDocument/completion
The subcommand
bench-completion
is only for this performance comparison (not commited tomain
); The internal of the subcommand is essentially as follows: