vscode-dart-import icon indicating copy to clipboard operation
vscode-dart-import copied to clipboard

Parsing fails for files with comments before import statements

Open JetA2 opened this issue 3 years ago • 1 comments

Hi, thanks for the nice extension!

There is an issue with files that have comments before the import statements, for example source file headers such as:

/*
 * File: xyz.dart
 * Project: ABC
 * Created: 2021-05-06 14:15:51
 */

import 'file.dart';

Parsing stops if the first non-empty line is not an import statement which means no import fixing will be done on files like these.

https://github.com/luanpotter/vscode-dart-import/blob/28c375f14c8f0d87e96c6af567dacee91523143c/src/main.ts#L47-L49

Changing line 48 to continue; should fix it.

JetA2 avatar May 12 '21 21:05 JetA2

Me too.

WorikQCI avatar Oct 18 '22 23:10 WorikQCI