Deperecated Source.modificationStamp

43 views
Skip to first unread message

Dmitry Krutskikh

unread,
Nov 29, 2021, 10:41:43 PM11/29/21
to Dart Analyzer Discussion
In recently released analyzer 2.8.0 you deprecated `Source.modificationStamp` without any suggested alternatives. We use modificationStamp in analyzer plugin Dart Code Metrics to create SourceFileEdit object to implement fixes for custom rules. (code with usage) In documentation I found mention `AnalysisContext.getModificationStamp` but can't find implementation. Please suggest me right way.

Brian Wilkerson

unread,
Nov 29, 2021, 10:55:24 PM11/29/21
to analyzer...@dartlang.org, Konstantin Shcheglov
Konstantin can correct me if I'm wrong, but I believe that the reason the getter was deprecated is because the value is never actually used anywhere anymore. As far as I can see, all of the code that creates a `SourceFileEdit` now passes in either `0` or `-1`.

We should probably deprecate the field in `SourceFileEdit` and add documentation explaining that the value is no longer used and suggesting one of those constant values.

On Mon, Nov 29, 2021 at 7:41 PM Dmitry Krutskikh <dmitry.k...@gmail.com> wrote:
In recently released analyzer 2.8.0 you deprecated `Source.modificationStamp` without any suggested alternatives. We use modificationStamp in analyzer plugin Dart Code Metrics to create SourceFileEdit object to implement fixes for custom rules. (code with usage) In documentation I found mention `AnalysisContext.getModificationStamp` but can't find implementation. Please suggest me right way.

--
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/8bf30e8c-d1f1-4e42-be5a-f4777e92948en%40dartlang.org.

Konstantin Shcheglov

unread,
Nov 30, 2021, 12:33:46 AM11/30/21
to Brian Wilkerson, analyzer...@dartlang.org

  Correct, currently we practically use `timeStamp = result.exists ? 0 : -1`.

  We don't have a proposed replacement, because the modification stamp has some meaning only for files, and eventually we should have `FileSource` that has `file`, which can be asked for the content, modification stamp, path, etc.
--
Konstantin Scheglov
Software Engineer
Google, Inc.
Reply all
Reply to author
Forward
0 new messages