Open johnsonmh opened 5 years ago
This would definitely be a great change, if for no other reason than I use them in IntelliJ (which calls them "Live Templates") a lot.
One issue is that LiveTemplates are a feature of IntelliJ rather than the analysis server or CodeMirror. I'm not sure how much work would be required to implement these.
Does anyone have an example of a site based on CodeMirror that's implemented this type of template expansion?
FYI, the IntelliJ Flutter live templates are defined here:
bu that may not necessarily help with implementing them in dartpad.
If the intent is to implement a full code editor, we could use https://github.com/cdr/code-server to take full advantage of the dart and flutter editing support already implemented by @DanTup instead of implementing yet another editor
That's a great idea, I didn't know we could leverage existing code server logic. I'm all for that!
Android studio has common Flutter templates. By typing
stless
hitting<cntrl> + <space>
and then hittingenter
, you can very easily create a new stateless widget.A very similar thing happens for entering
stful
-> hitting<cntrl> + <space>
-> hitting<enter>
.These shortcuts are great time savers and would be awesome to have in DartPad. This is not the most high priority feature though, just nice to have.