facebook / starlark-rust

A Rust implementation of the Starlark language
Apache License 2.0
672 stars 53 forks source link

Codelens support for the LSP #107

Open cameron-martin opened 6 months ago

cameron-martin commented 6 months ago

Most of the work is done by a new method on the LspContext, codelens. This returns the span of codelenses, and the actions they perform. Even though the LSP can execute actions, these are intended to be executed by the editor since they need to have richer interaction than the LSP supports, for example opening a terminal to display the build result.

Commands sent via the LSP are not very strongly-typed, so this introduces an associated Command type, and conversion to the LSP type is handled via a trait method.

Resolves #105.