flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Change live templates to use analyzer

Open stevemessick opened this issue 3 years ago • 1 comments

Switch live templates to use the analyzer snippets instead of XML files. That will fix #6071.

stevemessick avatar May 09 '22 22:05 stevemessick

This was added to M68 with the intent of determining how much work is required to implement it.

From reading some Dart SDK code, it appears that snippets support this kind of functionality. Snippets are only accessible via the Language Server Protocol. The plugin does not currently use LSP so adding a connection would be the first problem to solve. The snippet syntax is not identical to the IntellliJ live template syntax, so we would have to translate it. (I don't believe live templates have anything like placeholders in snippets.) Finally, I did not see any way to query the available snippets. I think we need that for discoverability. The live templates are all available in the preferences dialog, and can be individually enabled or disabled, as well as showing the code that is generated.

@jacob314 @jwren for context, and I think we can change the milestone to On Deck.

stevemessick avatar May 10 '22 17:05 stevemessick