import { createDefaultSharedCoreModule as i, createDefaultCoreModule as t } from "../default-module.js";
import { inject as o } from "../dependency-injection.js";
import { LangiumGrammarAstReflection as n } from "../languages/generated/ast.js";
import { EmptyFileSystem as s } from "../workspace/file-system-provider.js";
import "./uri-utils.js";
import { URI as l } from "../../../../../vscode-uri@3.0.8/node_modules/vscode-uri/lib/esm/index.js";
const c = {
  Grammar: () => {
  },
  LanguageMetaData: () => ({
    caseInsensitive: !1,
    fileExtensions: [".langium"],
    languageId: "langium"
  })
}, u = {
  AstReflection: () => new n()
};
function d() {
  const r = o(i(s), u), e = o(t({ shared: r }), c);
  return r.ServiceRegistry.register(e), e;
}
function S(r) {
  var e;
  const m = d(), a = m.serializer.JsonSerializer.deserialize(r);
  return m.shared.workspace.LangiumDocumentFactory.fromModel(a, l.parse(`memory://${(e = a.name) !== null && e !== void 0 ? e : "grammar"}.langium`)), a;
}
export {
  S as loadGrammarFromJson
};
