-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
refactor(declarations): move declaration uniqueness check to model file #794
Merged
mttrbrts
merged 3 commits into
accordproject:main
from
ekarademir:ertugrul/i785/move-declaration-uniqueness-check-to-modelfile
Jan 29, 2024
Merged
refactor(declarations): move declaration uniqueness check to model file #794
mttrbrts
merged 3 commits into
accordproject:main
from
ekarademir:ertugrul/i785/move-declaration-uniqueness-check-to-modelfile
Jan 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ertugrul Karademir <[email protected]>
Signed-off-by: Ertugrul Karademir <[email protected]>
ekarademir
commented
Jan 29, 2024
@@ -190,21 +190,6 @@ class ClassDeclaration extends Declaration { | |||
validate() { | |||
super.validate(); | |||
|
|||
const declarations = this.getModelFile().getAllDeclarations(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nothing in this removed code that references the particular declaration (this
,) and it already calls the model file. So we can just move this logic to model file and remove unnecessary O(n^2) loop.
jamieshorten
approved these changes
Jan 29, 2024
stefanblaginov
approved these changes
Jan 29, 2024
Signed-off-by: Ertugrul Karademir <[email protected]>
mttrbrts
approved these changes
Jan 29, 2024
ekarademir
deleted the
ertugrul/i785/move-declaration-uniqueness-check-to-modelfile
branch
January 29, 2024 14:55
5 tasks
This was referenced Feb 6, 2024
mttrbrts
pushed a commit
to mttrbrts/composer-concerto
that referenced
this pull request
Mar 10, 2024
…le (accordproject#794) * refactor(declarations): Move unique name check to model file. Signed-off-by: Ertugrul Karademir <[email protected]> * refactor(test): move validation checks for duplicate class to model file Signed-off-by: Ertugrul Karademir <[email protected]> * test: empty commit to trigger test Signed-off-by: Ertugrul Karademir <[email protected]> --------- Signed-off-by: Ertugrul Karademir <[email protected]>
mttrbrts
pushed a commit
to mttrbrts/composer-concerto
that referenced
this pull request
Mar 11, 2024
…le (accordproject#794) * refactor(declarations): Move unique name check to model file. Signed-off-by: Ertugrul Karademir <[email protected]> * refactor(test): move validation checks for duplicate class to model file Signed-off-by: Ertugrul Karademir <[email protected]> * test: empty commit to trigger test Signed-off-by: Ertugrul Karademir <[email protected]> --------- Signed-off-by: Ertugrul Karademir <[email protected]>
mttrbrts
added a commit
that referenced
this pull request
Mar 11, 2024
* fix(build): include unions in index Signed-off-by: Matt Roberts <[email protected]> * chore(deps): upgrade codegen to latest release Signed-off-by: Matt Roberts <[email protected]> --------- Signed-off-by: Matt Roberts <[email protected]> * fix(class): throw error when class is extending itself (#767) * fix(parser): throw error when concept is extending itself in CTO Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> * fix(parser): throw error when concept is extending itself in JSON metamodel form Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> * fix(parser): throw error when concept is extending itself in the AST Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> * refactor(validation): alphabetical rearrangement Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> * test(self-extending): remove redundant tests (codepath covered in concerto-cto) Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> * test(fix): remove unneeded import Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> --------- Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> Co-authored-by: Stefan Blaginov <[email protected]> * fix(class-declaration): throw with undefined ast properties (#771) Signed-off-by: Ertugrul Karademir <[email protected]> * fix(error): adding type to error in string validator in introspect (#773) * fix(error): adding type to error in string validator in introspect Signed-off-by: Santanu Roy <[email protected]> Co-authored-by: Santanu Roy <[email protected]> * refactor(declarations): move declaration uniqueness check to model file (#794) * refactor(declarations): Move unique name check to model file. Signed-off-by: Ertugrul Karademir <[email protected]> * refactor(test): move validation checks for duplicate class to model file Signed-off-by: Ertugrul Karademir <[email protected]> * test: empty commit to trigger test Signed-off-by: Ertugrul Karademir <[email protected]> --------- Signed-off-by: Ertugrul Karademir <[email protected]> * perf(core): don't use arrays to check uniqueness (#802) refactor: don't use arrays to check uniqueness Signed-off-by: Ertugrul Karademir <[email protected]> * perf(core): remove usage of arrays while forming duplicate item errors (#804) * refactor: don't use arrays to check uniqueness Signed-off-by: Ertugrul Karademir <[email protected]> * refactor: also refactor unique property name check Signed-off-by: Ertugrul Karademir <[email protected]> * refactor: remove array for decorator uniqueness check Signed-off-by: Ertugrul Karademir <[email protected]> * refactor: remove uniqueness check from scalar declarations as well Signed-off-by: Ertugrul Karademir <[email protected]> --------- Signed-off-by: Ertugrul Karademir <[email protected]> --------- Signed-off-by: Matt Roberts <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Stefan Blaginov <[email protected]> Signed-off-by: Ertugrul Karademir <[email protected]> Signed-off-by: Santanu Roy <[email protected]> Co-authored-by: Stefan Blaginov <[email protected]> Co-authored-by: Stefan Blaginov <[email protected]> Co-authored-by: Ertugrul Karademir <[email protected]> Co-authored-by: Santanu Roy <[email protected]> Co-authored-by: Santanu Roy <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #785
This logic doesn't need to run for each declaration in the class. It basically calls the model file and fetches declarations and creates a set. There is nothing special about the particular declaration within this logic.
Changes
Author Checklist
--signoff
option of git commit.main
fromfork:branchname