Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Issue 9651004: Make SourceInfo a class, rename its menthods. (Closed)

Created:
8 years, 9 months ago by scheglov
Modified:
8 years, 9 months ago
Reviewers:
zundel, Brian Wilkerson
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make SourceInfo a class, rename its menthods. This is preparation for avoiding calling Element.getNode() during analysis. R=brianwilkerson@google.com,zundel@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5208

Patch Set 1 #

Total comments: 5

Patch Set 2 : Tweak for formatting, lazily create LainesInfo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+602 lines, -557 lines) Patch
M compiler/java/com/google/dart/compiler/DartCompilationError.java View 6 chunks +44 lines, -34 lines 0 comments Download
M compiler/java/com/google/dart/compiler/DartCompiler.java View 5 chunks +12 lines, -11 lines 0 comments Download
M compiler/java/com/google/dart/compiler/DeltaAnalyzer.java View 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/LibraryDeps.java View 3 chunks +4 lines, -3 lines 0 comments Download
M compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java View 2 chunks +2 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartComment.java View 2 chunks +2 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartNode.java View 1 chunk +0 lines, -37 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartUnit.java View 1 chunk +0 lines, -5 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/viz/DotWriter.java View 1 chunk +2 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/ast/viz/TextWriter.java View 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/common/AbstractNode.java View 1 chunk +4 lines, -63 lines 0 comments Download
M compiler/java/com/google/dart/compiler/common/HasSourceInfo.java View 1 chunk +3 lines, -36 lines 0 comments Download
M compiler/java/com/google/dart/compiler/common/SourceInfo.java View 1 1 chunk +136 lines, -31 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/CommentPreservingParser.java View 3 chunks +9 lines, -6 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 2 chunks +3 lines, -3 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/DartScannerParserContext.java View 2 chunks +2 lines, -4 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Elements.java View 1 chunk +2 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java View 1 chunk +2 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/SupertypeResolver.java View 2 chunks +2 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/TopLevelElementBuilder.java View 2 chunks +2 lines, -2 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/DeltaBench.java View 1 chunk +4 lines, -3 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/parser/CPParserTest.java View 2 chunks +4 lines, -1 line 0 comments Download
M compiler/javatests/com/google/dart/compiler/parser/DartASTValidator.java View 2 chunks +6 lines, -6 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverAuditVisitor.java View 2 chunks +9 lines, -2 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java View 2 chunks +9 lines, -7 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTestCase.java View 1 chunk +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ErrorListener.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/Library.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/analysis/ResolveLibraryTask.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/NodeFinder.java View 5 chunks +10 lines, -9 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/rewrite/ASTRewrite.java View 5 chunks +14 lines, -10 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/rewrite/TargetSourceRangeComputer.java View 1 chunk +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/builder/CompilerListener.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/CompletionEngine.java View 22 chunks +35 lines, -40 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/CompletionParser.java View 1 chunk +2 lines, -2 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/ScopedNameFinder.java View 3 chunks +2 lines, -2 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/ast/CompletionUtil.java View 1 chunk +4 lines, -2 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/dom/rewrite/ASTRewriteAnalyzer.java View 42 chunks +67 lines, -49 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/dom/rewrite/LineCommentEndOffsets.java View 1 1 chunk +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/dom/rewrite/RewriteEventStore.java View 5 chunks +11 lines, -6 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/dom/rewrite/TrackedNodePositionImpl.java View 2 chunks +4 lines, -4 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/formatter/CodeFormatterVisitor.java View 10 chunks +18 lines, -22 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/formatter/CodeSnippetParsingUtil.java View 3 chunks +3 lines, -4 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/contributor/IndexContributor.java View 5 chunks +14 lines, -10 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/impl/InMemoryIndex.java View 4 chunks +4 lines, -4 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/CompilationUnitImpl.java View 10 chunks +32 lines, -24 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/LibraryConfigurationFileImpl.java View 2 chunks +4 lines, -4 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/SourceRangeImpl.java View 1 chunk +2 lines, -2 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/problem/CategorizedProblem.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/DOMFinder.java View 1 chunk +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java View 10 chunks +25 lines, -24 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/compiler/DartCompilerUtilities.java View 4 chunks +6 lines, -5 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/callhierarchy/CalleeAnalyzerVisitor.java View 3 chunks +8 lines, -8 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/Selection.java View 5 chunks +15 lines, -12 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/SelectionAnalyzer.java View 2 chunks +4 lines, -3 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/dart/DartAutoIndentStrategy.java View 5 chunks +7 lines, -6 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/DartEditor.java View 6 chunks +13 lines, -12 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/NLSKeyHyperlinkDetector.java View 1 chunk +2 lines, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightingReconciler.java View 3 chunks +5 lines, -5 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/selectionactions/StructureSelectNextAction.java View 3 chunks +5 lines, -5 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/selectionactions/StructureSelectPreviousAction.java View 3 chunks +4 lines, -4 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/selectionactions/StructureSelectionAction.java View 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
scheglov
8 years, 9 months ago (2012-03-08 22:00:53 UTC) #1
Brian Wilkerson
https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java File compiler/java/com/google/dart/compiler/common/SourceInfo.java (right): https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java#newcode38 compiler/java/com/google/dart/compiler/common/SourceInfo.java:38: private static final Map<Source, LinesInfo> lines = new MapMaker().weakKeys().makeMap(); ...
8 years, 9 months ago (2012-03-08 22:52:04 UTC) #2
scheglov
https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java File compiler/java/com/google/dart/compiler/common/SourceInfo.java (right): https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java#newcode38 compiler/java/com/google/dart/compiler/common/SourceInfo.java:38: private static final Map<Source, LinesInfo> lines = new MapMaker().weakKeys().makeMap(); ...
8 years, 9 months ago (2012-03-08 23:28:31 UTC) #3
Brian Wilkerson
https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java File compiler/java/com/google/dart/compiler/common/SourceInfo.java (right): https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java#newcode38 compiler/java/com/google/dart/compiler/common/SourceInfo.java:38: private static final Map<Source, LinesInfo> lines = new MapMaker().weakKeys().makeMap(); ...
8 years, 9 months ago (2012-03-08 23:49:23 UTC) #4
scheglov
On 2012/03/08 23:49:23, Brian Wilkerson wrote: > https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java > File compiler/java/com/google/dart/compiler/common/SourceInfo.java (right): > > https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java#newcode38 ...
8 years, 9 months ago (2012-03-09 00:47:16 UTC) #5
scheglov
On 2012/03/08 23:49:23, Brian Wilkerson wrote: > https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java > File compiler/java/com/google/dart/compiler/common/SourceInfo.java (right): > > https://chromiumcodereview.appspot.com/9651004/diff/1/compiler/java/com/google/dart/compiler/common/SourceInfo.java#newcode38 ...
8 years, 9 months ago (2012-03-09 00:48:38 UTC) #6
scheglov
On 2012/03/09 00:48:38, scheglov wrote: > On 2012/03/08 23:49:23, Brian Wilkerson wrote: > > > ...
8 years, 9 months ago (2012-03-09 00:56:00 UTC) #7
Brian Wilkerson
8 years, 9 months ago (2012-03-09 01:12:50 UTC) #8
On 2012/03/09 00:56:00, scheglov wrote:
> On 2012/03/09 00:48:38, scheglov wrote:
> Do you want to put getLine(offset)/getColumn(offset) methods
> into Source class?

No, just getLinesInfo().

> And actually I don't like this.
> There was no need AFAIK for this functionality before, line/column was
> accessible only from DartNode.
> So, I'd prefer to keep it in the place where we actually hold all location
> information, i.e. in SourceInfo.

Understood, but I really don't like having tightly coupled information being
stored in a loose association like this.

> Plus, there are many implementations of the Source, would be not nice to
> implement getLine()/getColumn() in every of them.

Seems like we could add an abstract superclass that could implement this
functionality.

Oh well, I guess we'll just have to agree to disagree for now. It isn't worth
holding up the check-in while we discuss it, so LGTM.

Powered by Google App Engine
This is Rietveld 408576698