Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart analyze cannot analyze file without .dart extension. #55591

Open
lrhn opened this issue Apr 29, 2024 · 1 comment
Open

dart analyze cannot analyze file without .dart extension. #55591

lrhn opened this issue Apr 29, 2024 · 1 comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-analyze Issues related to the 'dart analyze' tool P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lrhn
Copy link
Member

lrhn commented Apr 29, 2024

I have a script file with the name dgr, and a first line of #! ...path-to-dart-exe. Pretty standard for a Dart script file.

If I try to analyze that as dart analyze ~/bin/dgr, the analyzer reports "No issues", even if the file is full of errors.

It seems the analyzer tries to avoid non-Dart files by ignoring files not ending in .dart, which is reasonable if I'm analyzing entire directories, but when being asked to analyze a single specific file, the analyzer should probably do what is being asked for.

I'm not sure whether this affects other dart sub-commands.
Both dart run and dart format works with no problem.
I don't know if it affects dart fix, haven't been able to make a mistake that fix can fix (probably because the file is not in a context with an analysis options).

@lrhn lrhn added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-analyze Issues related to the 'dart analyze' tool labels Apr 29, 2024
@bwilkerson bwilkerson added the P3 A lower priority bug or feature request label Apr 29, 2024
@bwilkerson
Copy link
Member

It almost certainly impacts dart fix as both tools use the analysis server, which is likely to be where the bug is.

@scheglov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-analyze Issues related to the 'dart analyze' tool P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants