-
Notifications
You must be signed in to change notification settings - Fork 22
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
Improve node factories and copy-pasting in general #1190
Open
alexanderpann
wants to merge
104
commits into
maintenance/mps20232
Choose a base branch
from
feature/copy_paste_handlers
base: maintenance/mps20232
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+34,415
−20,553
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
The first cell should rarely have set punctuation-left to true and the last cell should rarely have punctuation-right set to true if the collection is at the top of the editor.
(cherry picked from commit 787acb1)
…re/copy_paste_handlers # Conflicts: # code/languages/org.iets3.opensource/solutions/org.iets3.core.expr.math.interpreter/org.iets3.core.expr.math.interpreter.msd # code/languages/org.iets3.opensource/tests/test.ts.expr.os/test.ts.expr.os.msd
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.
I introduced 2 new interfaces:
IContainAssignableExpression
andIContainExpression
and let many concepts implements them. When you now use the code completion menu to replace a node with another one, the expression is copied over to the new node.Examples:
In addition, I implemented a lot of node factories to copy even more information from the old nodes.
For a few top-level expressions, I implemented experimental copy-paste handlers:
DotExpression
->IToplevelExprContent
Function
->Expression
Constant
->Expression
EnumLiteral
->Expression
Example: When you copy a function declaration, it will paste a reference to the function into the expression or a constant reference instead of the constant declaration itself.
As long as https://youtrack.jetbrains.com/issue/MPS-24089/copy-paste-handlers-are-not-called-for-extended-concepts is not implemented, it doesn't make sense to implement them for all concepts as it would lead to a lot of code duplication.
For reviewing: All changes related to the refactoring and introduction of those interfaces don't have to be reviewed since all the migrations where done automatically by MPS. I checked the project for broken references and I couldn't find any. Only the node factories and other commits have to be reviewed.
I will squash all the "use X for Y" commits after the review but kept it like that in case we need to remove some commits.