use of org.elixir_lang.beam.psi.stubs.ModuleStub in project intellij-elixir by KronicDeth.
the class BeamFileImpl method buildFileStub.
public static PsiFileStub<?> buildFileStub(byte[] bytes) {
ElixirFileStubImpl stub = new ElixirFileStubImpl();
Beam beam = null;
try {
beam = Beam.from(bytes);
} catch (IOException e) {
LOGGER.error(e);
} catch (OtpErlangDecodeException e) {
LOGGER.error(e);
}
ModuleStub moduleStub = buildModuleStub(stub, beam);
if (moduleStub == null) {
stub = null;
}
return stub;
}
use of org.elixir_lang.beam.psi.stubs.ModuleStub in project intellij-elixir by KronicDeth.
the class BeamFileImpl method buildModuleStub.
@Nullable
private static ModuleStub buildModuleStub(PsiFileStub<ElixirFile> parentStub, Beam beam) {
ModuleStub moduleStub = null;
if (beam != null) {
Atoms atoms = beam.atoms();
if (atoms != null) {
String moduleName = atoms.moduleName();
if (moduleName != null) {
String name = defmoduleArgument(moduleName);
moduleStub = new ModuleStubImpl(parentStub, name);
buildCallDefinitions(moduleStub, beam, atoms);
}
}
}
return moduleStub;
}
Aggregations