var l = Object.defineProperty;
var u = (n, i) => l(n, "name", { value: i, configurable: !0 });
import { getAutocompletion as a } from "../autocomplete/getAutocompletion.js";
import { getHover as f } from "../hover/getHover.js";
import { getLints as m } from "../lint/getLints.js";
import { createOrUpdateFile as p } from "../sync/update.js";
function F(n) {
  let i = !1, t, o;
  return {
    async initialize() {
      i || (o = await n, t = await o.env, i = !0);
    },
    updateFile({ path: e, code: r }) {
      t && p(t, e, r) && o.onFileUpdated?.(t, e, r);
    },
    getLints({ path: e, diagnosticCodesToIgnore: r }) {
      return t ? m({ env: t, path: e, diagnosticCodesToIgnore: r }) : [];
    },
    getAutocompletion({ path: e, context: r }) {
      return t ? a({ env: t, path: e, context: r }) : null;
    },
    getHover({ path: e, pos: r }) {
      if (t)
        return f({ env: t, path: e, pos: r });
    },
    getEnv() {
      return t;
    }
  };
}
u(F, "createWorker");
export {
  F as createWorker
};
