Commit Graph

5 Commits

Author SHA1 Message Date
Qi Xiao
79207b39b6 Fix recording of CPU profiles when using cmd/withprof/elvish.
pprof.Program.Run called pprof.StopCPUProfile in a defer, so the profile will
only capture the extent of that method.

In order to capture an actual Elvish session pprof.StopCPUProfile needs to be
called before the overall program terminates. This is done by allowing the
special "next program" error to carry cleanup functions.

This fixes #1605.
2022-11-26 12:05:39 +00:00
Qi Xiao
92c7e4b303 pkg/lsp: Support textDocument/completion. 2022-03-07 14:27:26 +00:00
Qi Xiao
d3a31ae193 Revamp command-line flag doc.
- Document all flags, and remove doc for removed flags.

- Update in-code flag descriptions to be more consistent with the markdown doc.
2022-03-03 00:41:39 +00:00
Qi Xiao
33a04f8dc1 Revamp flag handling in pkg/prog.
Instead of putting all possible flags in prog.Flags, flags are now registered by
the individual subprograms. The 3 flags -sock, -db and -json are shared by
multiple subprograms and still handled by the prog package.

This new design allows separating the support for -cpuprofile into a separate
subprogram, which is no longer included by the default entry point, making the
binary slightly smaller. A new entrypoint "withpprof" is created.

Also include the LSP subprogram in the nodaemon entry point.
2022-02-05 14:52:29 +00:00
Qi Xiao
ffeb3ab963 Make the LSP server part of the Elvish binary.
Also add tests.
2022-02-05 11:34:14 +00:00