Define new event target for JSON, and revert option passing

For the program to be consistent, the 'EventListener' target that we
  pass to a Project should be responsible for the output format.
  Otherwise, we are contingent on developers to remember passing the
  option at call-site. Plus, it overloads the project code with an extra
  boolean option.

  Instead, since the behaviour is solely driven by the execution
  context, we can instantiate a different event target upfront, and
  simply hold on to it throughout the program.

  As a nice side-effect, we can gently re-organize the code to keep the
  terminal printing logic and the json printing logic separate.
This commit is contained in:
KtorZ
2024-11-13 11:01:58 +01:00
parent 1a75568027
commit d24a71ee04
9 changed files with 621 additions and 597 deletions

View File

@@ -38,7 +38,6 @@ impl LspProject {
PropertyTest::DEFAULT_MAX_SUCCESS,
Tracing::verbose(),
None,
false,
);
self.project.restore(checkpoint);