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

Refactorings: Source model loading and saving #11

Merged
merged 1 commit into from
Mar 25, 2022
Merged

Refactorings: Source model loading and saving #11

merged 1 commit into from
Mar 25, 2022

Conversation

planger
Copy link
Member

@planger planger commented Mar 25, 2022

  • Rename ModelSourceLoader to SourceModelPersistence
  • Add saving to the SourceModelPersistence interface
  • Delegate from the SaveModelActionHandler to that implementation
  • Update javadoc and variable names where fit

eclipse-glsp/glsp#582

@planger planger requested a review from tortmayr March 25, 2022 15:23
Copy link
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks looks good to me.

try {
const data = this.modelSerializer.createSchema(this.modelState.root);
// eslint-disable-next-line no-null/no-null
writeFileSync(this.modelState.sourceUri!, JSON.stringify(data, null, 2));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of disabling the eslint rule you can just use undefined here instead of null

Suggested change
writeFileSync(this.modelState.sourceUri!, JSON.stringify(data, null, 2));
writeFileSync(this.modelState.sourceUri!, JSON.stringify(data, undefined, 2));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, yeah I just moved the code. I amended your change. Thanks!

  - Rename ModelSourceLoader to SourceModelPersistence
  - Add saving to the SourceModelPersistence interface
  - Delegate from the SaveModelActionHandler to that implementation
  - Update javadoc and variable names where fit

eclipse-glsp/glsp#582
@planger planger merged commit ed5493d into main Mar 25, 2022
@planger planger deleted the issues/582 branch March 25, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants