Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-7348

Refactor DroolsLspServer and DroolsLspDocumentService

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • LSP
    • None
    • 2023 Week 09-11 (from Feb 27), 2023 Week 12-14 (from Mar 20), 2023 Week 15-17 (from Apr 10), 2023 Week 18-20 (from May 1), 2023 Week 21-23 (from May 22), 2023 Week 27-29 (from Jul 3), 2023 Week 30-32 (from Jul 24), 2023 Week 33-35 (from Aug 14), 2023 Week 36-38 (from Sep 4), 2023 Week 24-26 (from Jun 12)
    • NEW
    • NEW
    • ---
    • ---

      Issue Description:

      Currently, DroolsLspServer creates its own instance of DroolsLspDocumentService;

          public DroolsLspServer() {
              textService = new DroolsLspDocumentService(this);
              workspaceService = new DroolsLspWorkspaceService();
          }
      

      At the same time, DroolsLspDocumentService accept DroolsLspServer as parameter in constructor because it needs to retrieve the "client" from it

      server.getClient()....
      

      This could be improved a lot IMO; since the "client" is needed for the code to run, and this client is set inside DroolsLspServer:

          @Override
          public void connect(LanguageClient client) {
              this.client = client;
          }
      

      The instantiation of DroolsLspDocumentService could happen here (or - its "initialization", i.e. setting the client directly in DroolsLspDocumentService), avoiding this reciprocal binding DroolsLspServer <-> DroolsLspDocumentService (that, generally speaking, is bad)

      Acceptance Criteria:

      Refactor to solve the reciprocal binding.

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: