Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dcs): enableMapTypes in internal modelmanagers in dcsmanager #905

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/concerto-core/lib/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ class DecoratorManager {
}

if (shouldValidate) {
const enableMapType = modelManager?.enableMapType ? true : false;
const validationModelManager = new ModelManager({
strict: true,
metamodelValidation: true,
addMetamodel: true,
enableMapType
});
validationModelManager.addModelFiles(modelManager.getModelFiles());
validationModelManager.addCTOModel(
Expand Down Expand Up @@ -419,7 +421,8 @@ class DecoratorManager {

});
});
const newModelManager = new ModelManager();
const enableMapType = modelManager?.enableMapType ? true : false;
const newModelManager = new ModelManager({ enableMapType });
newModelManager.fromAst(decoratedAst);
return newModelManager;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/test/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('DecoratorManager', () => {

it('should decorate the specified MapDeclaration', async function() {
// load a model to decorate
const testModelManager = new ModelManager({strict:true, skipLocationNodes: true});
const testModelManager = new ModelManager({strict:true, skipLocationNodes: true, enableMapType: true});
const modelText = fs.readFileSync(path.join(__dirname,'/data/decoratorcommands/test.cto'), 'utf-8');
testModelManager.addCTOModel(modelText, 'test.cto');

Expand Down
Loading