Hello!
I'm currently working on lint packages and was having some issues understanding the setup of a plugin.
In particular I don't understand the logic of priority files
My understanding is that priority files are supposed to represent the files currently opened by the IDE. As such, we don't want AnalysisDriver.priorityFiles to be the list of all the files in the project (I think).
But I realised that if a file isn't present in priorityFiles, then AnalysisDriver.results will emit an ErrorsResult instead of a ResolvedUnitResult for that file.
I'm also aware that calling driver.getResult for that file will change that.
But what I don't understand is, why is this desired? Because if an analyzer plugin receives an ErrorsResult, then they will be unable to produce lints. Which means that if the plugin wants to treat all files in the projects, they have to either:
- add all files in the project to the list of priority file.
- call driver.getResult on all files.
Neither of these solutions sound logical to me. And considering the name "ErrorResult", maybe there is something that I'm missing.
TD;DR: How can we analyze all Dart files in a project, while also making sure that files currently opened in the IDE are treated first (when possible)?
Thanks!
Remi