async validate(e, t) {
    var r, i;
    const s = this.serviceRegistry.getServices(e.uri).validation.DocumentValidator, a = this.getBuildOptions(e).validation, o = typeof a == "object" ? a : void 0, l = await s.validateDocument(e, o, t);
    e.diagnostics ? e.diagnostics.push(...l) : e.diagnostics = l;
    const c = this.buildState.get(e.uri.toString());
    if (c) {
      (r = c.result) !== null && r !== void 0 || (c.result = {});
      const u = (i = o == null ? void 0 : o.categories) !== null && i !== void 0 ? i : si.all;
      c.result.validationChecks ? c.result.validationChecks.push(...u) : c.result.validationChecks = [...u];
    }
  }
Run validation checks on the given document and store the resulting diagnostics in the document.
If the document already contains diagnostics, the new ones are added to the list.