diff --git a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/TestGrammarParser.java b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/TestGrammarParser.java index b4daf10b337..bb0b0359471 100644 --- a/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/TestGrammarParser.java +++ b/legend-engine-core/legend-engine-core-base/legend-engine-core-language-pure/legend-engine-language-pure-grammar/src/test/java/org/finos/legend/engine/language/pure/grammar/test/TestGrammarParser.java @@ -27,6 +27,7 @@ import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.PackageableElement; import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.domain.Function; +import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.section.SectionIndex; import org.finos.legend.engine.shared.core.ObjectMapperFactory; import org.finos.legend.engine.shared.core.identity.Identity; import org.finos.legend.engine.shared.core.identity.factory.*; @@ -92,7 +93,15 @@ public void testParserGrammarIdentifierInclusion() protected static PureModelContextData test(String val) { - return PureGrammarParser.newInstance().parseModel(val); + PureModelContextData pureModelContextData = PureGrammarParser.newInstance().parseModel(val); + for (PackageableElement element : pureModelContextData.getElements()) + { + if (!(element instanceof SectionIndex)) + { + Assert.assertNotNull("Missing source information: " + element.getClass().getName() + '(' + element.getPath() + ')', element.sourceInformation); + } + } + return pureModelContextData; } protected static void test(String val, String expectedErrorMsg) diff --git a/legend-engine-xts-authentication/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/engine/language/pure/dsl/authentication/grammar/from/demo/AuthenticationDemoParseTreeWalker.java b/legend-engine-xts-authentication/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/engine/language/pure/dsl/authentication/grammar/from/demo/AuthenticationDemoParseTreeWalker.java index e6cc66f04e5..74880d93a61 100644 --- a/legend-engine-xts-authentication/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/engine/language/pure/dsl/authentication/grammar/from/demo/AuthenticationDemoParseTreeWalker.java +++ b/legend-engine-xts-authentication/legend-engine-xt-authentication-grammar/src/test/java/org/finos/legend/engine/language/pure/dsl/authentication/grammar/from/demo/AuthenticationDemoParseTreeWalker.java @@ -53,6 +53,7 @@ private AuthenticationDemo visitAuthenticationDemo(AuthenticationParserGrammar.E AuthenticationParserGrammar.AuthenticationDemoContext ctx = elementDefinitionContext.authenticationDemo(); authenticationDemo.name = PureGrammarParserUtility.fromIdentifier(ctx.qualifiedName().identifier()); authenticationDemo._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); + authenticationDemo.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); // authentication AuthenticationParserGrammar.AuthenticationContext authenticationContext = PureGrammarParserUtility.validateAndExtractRequiredField(ctx.authentication(), "authentication", authenticationDemo.sourceInformation); diff --git a/legend-engine-xts-authentication/legend-engine-xt-authentication-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/authentication/demo/AuthenticationDemo.java b/legend-engine-xts-authentication/legend-engine-xt-authentication-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/authentication/demo/AuthenticationDemo.java index 04d3bdcdb88..af6f073e083 100644 --- a/legend-engine-xts-authentication/legend-engine-xt-authentication-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/authentication/demo/AuthenticationDemo.java +++ b/legend-engine-xts-authentication/legend-engine-xt-authentication-protocol/src/main/java/org/finos/legend/engine/protocol/pure/v1/model/packageableElement/authentication/demo/AuthenticationDemo.java @@ -23,8 +23,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "_type") public class AuthenticationDemo extends PackageableElement { - public SourceInformation sourceInformation; - public AuthenticationSpecification authenticationSpecification; public T accept(PackageableElementVisitor visitor) diff --git a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java index 432fc19fd8e..d628f08e450 100644 --- a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java +++ b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-grammar/src/main/java/org/finos/legend/engine/language/hostedService/grammar/from/HostedServiceTreeWalker.java @@ -159,6 +159,7 @@ private ExecutionEnvironmentInstance visitExecutionEnvironment(HostedServicePars ExecutionEnvironmentInstance execEnv = new ExecutionEnvironmentInstance(); execEnv.name = PureGrammarParserUtility.fromIdentifier(ctx.qualifiedName().identifier()); execEnv._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); + execEnv.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); List execEnvCtxList = PureGrammarParserUtility.validateRequiredListField(ctx.executions().execParams(), "executions", walkerSourceInformation.getSourceInformation(ctx.executions())); if (execEnvCtxList.stream().anyMatch(x -> x.singleExecEnv() != null)) { diff --git a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/grammar/from/ServiceParseTreeWalker.java b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/grammar/from/ServiceParseTreeWalker.java index 0749c23c7ff..c82abd1e6ec 100644 --- a/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/grammar/from/ServiceParseTreeWalker.java +++ b/legend-engine-xts-service/legend-engine-language-pure-dsl-service/src/main/java/org/finos/legend/engine/language/pure/dsl/service/grammar/from/ServiceParseTreeWalker.java @@ -554,6 +554,7 @@ private ExecutionEnvironmentInstance visitExecutionEnvironment(ServiceParserGram ExecutionEnvironmentInstance execEnv = new ExecutionEnvironmentInstance(); execEnv.name = PureGrammarParserUtility.fromIdentifier(ctx.qualifiedName().identifier()); execEnv._package = ctx.qualifiedName().packagePath() == null ? "" : PureGrammarParserUtility.fromPath(ctx.qualifiedName().packagePath().identifier()); + execEnv.sourceInformation = walkerSourceInformation.getSourceInformation(ctx); List execEnvCtxList = PureGrammarParserUtility.validateRequiredListField(ctx.executions().execParams(), "executions", walkerSourceInformation.getSourceInformation(ctx.executions())); if (execEnvCtxList.stream().anyMatch(x -> x.singleExecEnv() != null)) {