Hi, I'm trying to find a place where the file's unit is recalculated when another file it depends on is changed.
Could you point me out to that place?
--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/d15d3598-6e81-4b9b-bf6a-71e54e51f928n%40dartlang.org.
Thank you, the second one is what I've been looking for.
Finally have time to look deeper into the analyzer implementation (the linking, scope resolution and flow analysis look so interesting 😁).
If I'm not mistaken, the resolved unit always goes through linting / analysis errors calculation. Any chance this work can be skipped with a flag?
Also, talking about the affected files: for barrel files, for example, will the analyze invalidate all the files that import a barrel file or it tracks exact usages and invalidates partially?
среда, 15 февраля 2023 г. в 22:29:05 UTC+4, sche...@google.com:It depends on the level you want to know this.For `ServerPlugin` you call `contentChanged`, and then it uses analyzer to decide which files were affected, and invokes `handleAffectedFiles()`, which eventually invokes `analyzeFile()`. The implementation of `analyzeFile()` will usually invoke `AnalysisSession.getResolvedUnit()` and do checks.For the analyzer itself, you call `AnalysisDriver.changeFile()`, which accumulates these changes, and then in `_applyPendingFileChanges()` applies all accumulated changes. It uses a `_removePotentiallyAffectedLibraries()` that collects any files that depend on a changed file, directly or indirectly. These files are potentially affected, so we will try to recompute elements for them, and re-analyze them.On Wed, Feb 15, 2023 at 3:00 AM Dmitry Zhifarsky <dimann...@gmail.com> wrote:Hi, I'm trying to find a place where the file's unit is recalculated when another file it depends on is changed.
Could you point me out to that place?--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/d15d3598-6e81-4b9b-bf6a-71e54e51f928n%40dartlang.org.
--Konstantin ScheglovSoftware EngineerGoogle, Inc.
Thank you, I'll take a look at the `_resolveForCompletion`.
> Invalidation is conservative, meaning that yes, if anything changed in the API of any exported library, the whole exporting library will be relinked.
Was this approach intentionally chosen over a more atomic one or there are hidden costs that make the atomic one too bad?