use of org.metaborg.spoofax.core.config.ISpoofaxProjectConfig in project spoofax by metaborg.
the class SingleFileScopeGraphContextFactory method create.
@Override
public ISingleFileScopeGraphContext create(ContextIdentifier identifier) {
final ISpoofaxProjectConfig config = configService.get(identifier.project);
final NaBL2Config nabl2Config = config != null ? config.nabl2Config() : null;
return new SingleFileScopeGraphContext(injector, identifier, nabl2Config);
}
use of org.metaborg.spoofax.core.config.ISpoofaxProjectConfig in project spoofax by metaborg.
the class TermFactoryService method get.
@Override
public ITermFactory get(ILanguageComponent component, @Nullable IProject project, boolean supportsTypesmart) {
if (!supportsTypesmart || project == null) {
return genericFactory;
}
ISpoofaxProjectConfig config = configService.get(project);
if (config == null || !config.typesmart()) {
return genericFactory;
}
TypesmartContext context = getTypesmartContext(component);
if (!context.isEmpty()) {
return new TypesmartTermFactory(genericFactory, typesmartLogger, context);
} else {
return genericFactory;
}
}
use of org.metaborg.spoofax.core.config.ISpoofaxProjectConfig in project spoofax by metaborg.
the class MultiFileScopeGraphContextFactory method create.
@Override
public IMultiFileScopeGraphContext create(ContextIdentifier identifier) {
final ISpoofaxProjectConfig config = configService.get(identifier.project);
final NaBL2Config nabl2Config = config != null ? config.nabl2Config() : null;
return new MultiFileScopeGraphContext(injector, identifier, nabl2Config);
}
use of org.metaborg.spoofax.core.config.ISpoofaxProjectConfig in project spoofax by metaborg.
the class TermFactoryService method get.
@Override
public ITermFactory get(ILanguageImpl impl, @Nullable IProject project, boolean supportsTypesmart) {
if (!supportsTypesmart || project == null) {
return genericFactory;
}
ISpoofaxProjectConfig config = configService.get(project);
if (config == null || !config.typesmart()) {
return genericFactory;
}
TypesmartContext context = getTypesmartContext(impl);
if (!context.isEmpty()) {
return new TypesmartTermFactory(genericFactory, typesmartLogger, context);
} else {
return genericFactory;
}
}
Aggregations