awesome-flutter-snippets icon indicating copy to clipboard operation
awesome-flutter-snippets copied to clipboard

[Feature Request] Auto Imports along with Snippets

Open matthew-nm opened this issue 5 years ago • 1 comments
trafficstars

First, thanks for creating these snippets. Being able to leverage modern conveniences like this makes using vim (neovim, in my case) extremely feasible, which is great because it's my favorite coding editor.

The context for this request is the following: When using coc.nvim, the standard completion suggestion for something like StatelessWidget includes the automatic import '...' line at the top of the file, if it doesn't exist. This is not only helpful so I don't have to remember where the import comes from and type it out myself, but it also prevents a lot of errors from appearing since the system won't be confused as to where from StatelessWidget comes.

When using awesome-flutter-snippets however, the automatic import is not done, which throws a lot of errors until I go add it in.

This is not a big deal, and I can imagine that it could be hard for a snippets engine to know if the import is already done or not, but I wanted to mention that it would be nice to have a single completion take care of the snippet as well as any necessary imports.

But I'm not sure where the functionality lies between coc.nvim and these snippets, so I don't know what the feasibility is of having something like this work.

Thanks for reading!

matthew-nm avatar Apr 13 '20 00:04 matthew-nm

Hi @matthew-nm! Thank you for the request. This would be something very cool to add.

I am not familiar with the way in which imports are handled by vscode so it is something I will look into.

Nash0x7E2 avatar Apr 17 '20 17:04 Nash0x7E2