code: @Override
      public void complete(Symbol sym) throws CompletionFailure {
          // Suppress some (recursive) MemberEnter invocations
          if (!completionEnabled) {
              // Re-install same completer for next time around and return.
              Assert.check((sym.flags() & Flags.COMPOUND) == 0);
              sym.completer = this;
              return;
          }
  
          try {
              annotate.blockAnnotations();
              sym.flags_field |= UNATTRIBUTED;
  
              List<Env<AttrContext>> queue;
  
              dependencies.push((ClassSymbol) sym, CompletionCause.MEMBER_ENTER);
              try {
                  queue = completeClass.completeEnvs(List.of(typeEnvs.get((ClassSymbol) sym)));
              } finally {
                  dependencies.pop();
              }
  
              if (!queue.isEmpty()) {
                  Set<JCCompilationUnit> seen = new HashSet<>();
  
                  for (Env<AttrContext> env : queue) {
                      if (env.toplevel.defs.contains(env.enclClass) && seen.add(env.toplevel)) {
                          finishImports(env.toplevel, () -> {});
                      }
                  }
              }
          } finally {
              annotate.unblockAnnotations();
          }
      }
docs: Complete entering a class.
  @param sym         The symbol of the class to be completed.