Closed creachadair closed 1 year ago
@radeksimko I wanted to give you a chance to comment on this change before I merge and release it.
I patched this change locally against the terraform-ls package: It does require one small usage change at current line 579 of internal/langserver/handlers/service.go, but otherwise everything builds and tests pass locally both with and without -tags=longtest
set.
Still, if you have other uses I haven't caught, or other concerns, please let me know.
In practice there turns out to be no practical advantage to having the Handler type be an interface. All the existing usage that I can find, including in the handler support package, is based on explicit functions.
This change replaces the Handler interface with a type alias to the expected function signature for the interface's Handle method. Any existing use based on the interface can be updated by extracting the method directly. For example, given a type like:
Replace usage like:
with:
This is a breaking change to the package API.