-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Quasy quoting for assists #2227
Copy link
Copy link
Open
Labels
A-assistsBroken WindowBugs / technical debt to be addressed immediatelyBugs / technical debt to be addressed immediatelyE-hardS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right nowfunA technically challenging issue with high impactA technically challenging issue with high impact
Metadata
Metadata
Assignees
Labels
A-assistsBroken WindowBugs / technical debt to be addressed immediatelyBugs / technical debt to be addressed immediatelyE-hardS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right nowfunA technically challenging issue with high impactA technically challenging issue with high impact
Type
Fields
Give feedbackNo fields configured for issues without a type.
Assist (and, once we have more of those, fixits and refactorings) need to produce a lot of syntax trees.
This is done with the help of
makemodule at the moment. Here's how a moderately-complex let statement is produced:It would be sweet if the above code could be condensed to the following:
There exists a trivial solution: use
format!, produce a string, re-parse string back into an AST. This actually works great! This is the solution employed by IntelliJ Rust(example), and I don't remember having any problems with it.However, adding more type-safety seems like a good thing to try! So, the
magic!macro should ideally produce the code above, and not some formatting-based thing.