vscode-dart-import
vscode-dart-import copied to clipboard
Not working with import sorter package
The extension do not work when working with flutter package "import sorter". The problem is occuring when the dart import extension trying to sort lines with comments in between the imported files..
If you have comments within your imports it gets really hard for this to automatically sort everything right? Dare I say impossible as there can multiple desired outcomes.
Let's say you have:
// group 1
import 'local/file.dart';
import 'package:foo/bar.dart';
// group 2
import 'package:my_package/local/file2.dart';
import 'dart:foo';
The expected result (removing the comments would be):
import 'dart:foo';
import 'package:foo/bar.dart';
import 'local/file.dart';
import 'local/file2.dart';
Where should each comment be put on the new structure? Since every import can change place, I don't see how we can correctly place comments back. If you are using this plugin you are relying on automatically defining the ordering of imports; in that case I think it doesn't make sense to have any comments in your import section. Comments are for humans. This plugin treats your import section as a "generated" part of your code.