Skip to content

Fix typos across DevTools #5012

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

Merged
merged 2 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/devtools_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Future<void> runDevTools({bool shouldEnableExperiments = false}) async {
usePathUrlStrategy();

// This may be from our Flutter integration tests. Since we call
// [runDevTools] from Dart code, we cannot set the 'enable_experiements'
// [runDevTools] from Dart code, we cannot set the 'enable_experiments'
// environment variable before calling [runDevTools].
if (shouldEnableExperiments) {
setEnableExperiments();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class SyntaxHighlighter {
///
/// If there are multiple scopes for a span, styling for each scope is
/// applied in the order the scopes are listed (i.e., later scope styles take
/// precidence).
/// precedence).
TextStyle _getStyleForSpan() {
if (_spanStack.isEmpty) {
return const TextStyle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class InspectorController extends DisposableController

RemoteDiagnosticsNode? subtreeRoot;

bool programaticSelectionChangeInProgress = false;
bool programmaticSelectionChangeInProgress = false;

ValueListenable<InspectorTreeNode?> get selectedNode => _selectedNode;
final ValueNotifier<InspectorTreeNode?> _selectedNode = ValueNotifier(null);
Expand Down Expand Up @@ -312,7 +312,7 @@ class InspectorController extends DisposableController
// Wait for the selection to be resolved followed by waiting for the tree to be computed.
await _selectionGroups?.pendingUpdateDone;
await _treeGroups?.pendingUpdateDone;
// TODO(jacobr): are there race conditions we need to think mroe carefully about here?
// TODO(jacobr): are there race conditions we need to think more carefully about here?
}

Future<void> refresh() {
Expand All @@ -337,7 +337,7 @@ class InspectorController extends DisposableController
// It is critical we clear all data that is kept alive by inspector object
// references in this method as that stale data will trigger inspector
// exceptions.
programaticSelectionChangeInProgress = true;
programmaticSelectionChangeInProgress = true;
_treeGroups?.clear(isolateStopped);
_selectionGroups?.clear(isolateStopped);

Expand All @@ -348,7 +348,7 @@ class InspectorController extends DisposableController
subtreeRoot = null;

inspectorTree.root = inspectorTree.createNode();
programaticSelectionChangeInProgress = false;
programmaticSelectionChangeInProgress = false;
valueToInspectorTreeNode.clear();
}

Expand Down Expand Up @@ -548,10 +548,10 @@ class InspectorController extends DisposableController
}

void syncTreeSelection() {
programaticSelectionChangeInProgress = true;
programmaticSelectionChangeInProgress = true;
inspectorTree.selection = selectedNode.value;
inspectorTree.expandPath(selectedNode.value);
programaticSelectionChangeInProgress = false;
programmaticSelectionChangeInProgress = false;
animateTo(selectedNode.value);
}

Expand Down Expand Up @@ -815,7 +815,7 @@ class InspectorController extends DisposableController
if (node != null) {
unawaited(inspectorTree.maybePopulateChildren(node));
}
if (programaticSelectionChangeInProgress) {
if (programmaticSelectionChangeInProgress) {
return;
}
if (node != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const overflowEpsilon = 0.1;
///
/// if [useMaxSizeAvailable] is set to true,
/// this method will ignore the largestRenderSize
/// and compute it's own largestRenderSize to force
/// and compute its own largestRenderSize to force
/// the sum of the render size to be equals to [maxSizeAvailable]
///
/// Formula for computing render size:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class _MemoryLog {

MemoryController controller;

/// Persist the the live memory data to a JSON file in the /tmp directory.
/// Persist the live memory data to a JSON file in the /tmp directory.
List<String> exportMemory() {
ga.select(gac.memory, gac.export);

Expand Down
31 changes: 18 additions & 13 deletions packages/devtools_app/lib/src/screens/memory/memory_protocol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,27 @@ class MemoryTracker {
_recalculate(true);
}

/// Poll Fultter engine's Raster Cache metrics.
/// @returns engine's rasterCache estimates or null.
/// Fetch the Fultter engine's Raster Cache metrics.
///
/// Returns engine's rasterCache estimates or null.
Future<RasterCache?> _fetchRasterCacheInfo() async {
final response = await serviceManager.rasterCacheMetrics;
if (response == null) return null;
final rasterCache = RasterCache.parse(response.json);
return rasterCache;
}

/// Poll ADB meminfo, ADB returns values in KB convert to total bytes.
/// Fetch ADB meminfo, ADB returns values in KB convert to total bytes.
Future<AdbMemoryInfo> _fetchAdbInfo() async => AdbMemoryInfo.fromJsonInKB(
(await serviceManager.adbMemoryInfo).json!,
);

/// Returns the MemoryUsage of a particular isolate.
/// @param id isolateId.
/// @param usage associated with the passed in isolate's id.
/// @returns the MemoryUsage of the isolate or null if isolate is a sentinal.
///
/// `id`: id for the isolate
/// `usage`: usage associated with the passed in isolate's id.
///
/// Returns the MemoryUsage of the isolate or null if isolate is a sentinel.
Future<MemoryUsage?> _isolateMemoryUsage(
String id,
MemoryUsage? usage,
Expand All @@ -174,24 +177,24 @@ class MemoryTracker {
for (var index = 0; index < isolateCount; index++) {
final isolateId = keys[index];
var usage = isolateHeaps[isolateId];
// Check if the isolate is dead (sentinal), null implies sentinal.
// Check if the isolate is dead (sentinel), null implies sentinel.
final checkIsolateUsage = await _isolateMemoryUsage(isolateId, usage);
if (checkIsolateUsage == null && !keysToRemove.contains(isolateId)) {
// Sentinal Isolate don't include in the heap computation.
// Sentinel Isolate don't include in the heap computation.
keysToRemove.add(isolateId);
// Don't use this sential isolate for any heap computation.
usage = null;
}

if (usage != null) {
// Isolate is live (a null usage implies sentinal).
// Isolate is live (a null usage implies sentinel).
used += usage.heapUsage!;
capacity += usage.heapCapacity!;
external += usage.externalUsage!;
}
}

// Removes any isolate that is a sentinal.
// Removes any isolate that is a sentinel.
isolateHeaps.removeWhere((key, value) => keysToRemove.contains(key));

final memoryTimeline = memoryController.memoryTimeline;
Expand Down Expand Up @@ -248,10 +251,12 @@ class MemoryTracker {
}

/// Many extension events could arrive between memory collection ticks, those
/// events need to be associated with a particular memory tick (timestamp). This
/// routine collects those new events received that are closest to a tick
/// events need to be associated with a particular memory tick (timestamp).
///
/// This routine collects those new events received that are closest to a tick
/// (time parameter)).
/// @returns copy of events to associate with an existing HeapSample tick
///
/// Returns copy of events to associate with an existing HeapSample tick
/// (contained in the EventSample). See [processEventSample] it computes the
/// events to aggregate to an existing HeapSample or delay associating those
/// events until the next HeapSample (tick) received see [_recalculate].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class _HeapCouple {
late final AdaptedHeap older;
late final AdaptedHeap younger;

/// Tries to declare earliest heap in a determenistic way.
/// Tries to declare earliest heap in a deterministic way.
///
/// If the earliest heap cannot be identified, returns the first argument.
static AdaptedHeap _older(AdaptedHeap heap1, AdaptedHeap heap2) {
Expand Down Expand Up @@ -78,7 +78,7 @@ class _HeapCouple {
int get hashCode => Object.hash(older, younger);
}

/// List of classes with per-class comparision between two heaps.
/// List of classes with per-class comparison between two heaps.
class DiffHeapClasses extends HeapClasses<DiffClassStats>
with FilterableHeapClasses<DiffClassStats> {
DiffHeapClasses(_HeapCouple couple) {
Expand Down Expand Up @@ -108,7 +108,7 @@ class DiffHeapClasses extends HeapClasses<DiffClassStats>
List<DiffClassStats> get classStatsList => classes;
}

/// Comparision between two heaps for a class.
/// Comparison between two heaps for a class.
class DiffClassStats extends ClassStats {
DiffClassStats._({
required this.heapClass,
Expand Down Expand Up @@ -148,7 +148,7 @@ class DiffClassStats extends ClassStats {
bool isZero() => total.isZero;
}

/// Comparision between two sets of objects.
/// Comparison between two sets of objects.
class ObjectSetDiff {
ObjectSetDiff({ObjectSet? before, ObjectSet? after}) {
before ??= ObjectSet.empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SnapshotInstanceItem extends SnapshotItem {

AdaptedHeap? heap;

/// This method is expected to be called once when heap is actually recieved.
/// This method is expected to be called once when heap is actually received.
void initializeHeapData(AdaptedHeapData? data) {
assert(heap == null);
if (data != null) heap = AdaptedHeap(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class MemoryTimeline {
void addMonitorResetEvent() {
final timestamp = DateTime.now().millisecondsSinceEpoch;
// TODO(terry): Enable to make continuous events visible?
// displayContinousEvents();
// displayContinuousEvents();

postEventSample(
EventSample.accumulatorReset(
Expand All @@ -160,7 +160,7 @@ class MemoryTimeline {
);
}

void displayContinousEvents() {
void displayContinuousEvents() {
for (var index = liveData.length - 1; index >= 0; index--) {
final sample = liveData[index];
if (sample.memoryEventInfo.isEventAllocationAccumulator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class EnhanceTracingHint extends StatelessWidget {
final phaseType = phase.type;
// TODO(kenz): when [enhanceTracingState] is not available, use heuristics
// to detect whether tracing was enhanced for a frame (e.g. the depth or
// quanity of child events under build / layout / paint).
// quantity of child events under build / layout / paint).
final tracingEnhanced =
enhanceTracingState?.enhancedFor(phaseType) ?? false;
switch (phaseType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ abstract class BaseTraceEventProcessor {
timestampMicros: fakeTimestampMicros,
args: {
'message': 'Warning - the end time of this event may be '
'innacurate. The end trace event was missing, so the end '
'innaccurate. The end trace event was missing, so the end '
'time was inferred.',
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Future<InstanceRef> _resolveInstanceRefForPath(
///
/// In rare cases, it is possible for this function to mutate the wrong property.
/// This can happen when an object contains multiple fields with the same name
/// (such as private properties or overriden properties), where the conflicting
/// (such as private properties or overridden properties), where the conflicting
/// fields are both defined in the same library.
Future<void> _mutate(
String newValueExpression, {
Expand Down
5 changes: 3 additions & 2 deletions packages/devtools_app/lib/src/service/service_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,9 @@ class ServiceConnectionManager {
);
}

/// @returns view id of selected isolate's 'FlutterView'.
/// @throws Exception if no 'FlutterView'.
/// Returns the view id for the selected isolate's 'FlutterView'.
///
/// Throws an Exception if no 'FlutterView' is present in this isolate.
Future<String> get flutterViewId async {
final flutterViewListResponse = await _callServiceExtensionOnMainIsolate(
registrations.flutterListViews,
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/lib/src/shared/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Each call to addDatum will
1. chart the data
1. update the X-axis.

One important piece of information is adding a heartbeat. If a live chart is needed where the timeline (X axis) moves in a linear fashion requires adding a heart beat (at the grandularity requested of the X axis) a tickstamp is added to the ChartController timestamps field on every tick e.g.,
One important piece of information is adding a heartbeat. If a live chart is needed where the timeline (X axis) moves in a linear fashion requires adding a heart beat (at the granularity requested of the X axis) a tickstamp is added to the ChartController timestamps field on every tick e.g.,

```
controller.addTimestamps(currentTime.millisecondsSinceEpoch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ChartController extends DisposableController
this.name,
List<int>? sharedLabelimestamps,
}) {
// TODO(terry): Compute dynamically based on X-axis lables text height.
// TODO(terry): Compute dynamically based on X-axis labels text height.
bottomPadding = !displayXLabels ? 0.0 : 40.0;

if (sharedLabelimestamps != null) {
Expand All @@ -59,7 +59,7 @@ class ChartController extends DisposableController
/// Spacing for title iff title != null.
double topPadding = 0.0;

// TODO(terry): Compute dynamically based on Y-axis lables text width.
// TODO(terry): Compute dynamically based on Y-axis labels text width.
final leftPadding = 50.0;

/// Computed minimum right padding.
Expand Down Expand Up @@ -575,7 +575,7 @@ class TapLocation {
TapLocation(this.tapDownDetails, this.timestamp, this.index);

/// Copy of TapLocation w/o the detail, implies not where tap occurred
/// but the multiple charts tied to the the same timeline should be hilighted
/// but the multiple charts tied to the same timeline should be hilighted
/// (selection point).
TapLocation.copy(TapLocation original)
: tapDownDetails = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class AxisScale {
/// Unit for the label (exponent) e.g., 6 = 10^6
late double labelUnitExponent;

/// Number of lables.
/// Number of labels.
late double labelTicks;

void _calculate() {
Expand Down
4 changes: 2 additions & 2 deletions packages/devtools_app/lib/src/shared/inspector_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class InspectorService extends InspectorServiceBase {

/// As we aren't running from an IDE, we don't know exactly what the pub root
/// directories are for the current project so we make a best guess if needed
/// based on the the root directory of the first non artifical widget in the
/// based on the root directory of the first non artifical widget in the
/// tree.
Future<List<String>> inferPubRootDirectoryIfNeeded() async {
final group = createObjectGroup('temp');
Expand Down Expand Up @@ -1413,7 +1413,7 @@ abstract class InspectorServiceClient {
/// object references associated with the current displayed UI and object
/// references associated with the candidate next frame of UI to display. Once
/// the next frame is ready, you determine whether you want to display it and
/// discard the current frame and promote the next frame to the the current
/// discard the current frame and promote the next frame to the current
/// frame if you want to display the next frame otherwise you discard the next
/// frame.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class LineSegment {
/// Whether [this] line segment intersects [rect] along the cross axis.
///
/// For [HorizontalLineSegment]s, this will return true if [this] line segment
/// fits withing the y bounds of the [rect]. For [VerticalLineSegment]s, this
/// fits within the y bounds of the [rect]. For [VerticalLineSegment]s, this
/// will return true if [this] line segment fits within the x bounds of the
/// [rect].
bool crossAxisIntersects(Rect rect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ T? _treeTraversal<T extends TreeNode<T>>(
action(node);
}
if (exploreChildrenCondition == null || exploreChildrenCondition(node)) {
// For DFS, reverse the children to gaurantee preorder traversal.
// For DFS, reverse the children to guarantee preorder traversal.
final children = bfs ? node.children : node.children.reversed;
children.forEach(toVisit.add);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/devtools_app/lib/src/shared/table/table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class FlatTable<T> extends StatefulWidget {
/// This notifier's value will be updated when a row of the table is selected.
final ValueNotifier<T?> selectionNotifier;

/// Whether the verical scroll position for this table should be preserved for
/// Whether the vertical scroll position for this table should be preserved for
/// each data set.
///
/// This should be set to true if the table is not disposed and completely
Expand Down Expand Up @@ -402,7 +402,7 @@ class TreeTable<T extends TreeNode<T>> extends StatefulWidget {
/// Whether the data roots in this table should be automatically expanded.
final bool autoExpandRoots;

/// Whether the verical scroll position for this table should be preserved for
/// Whether the vertical scroll position for this table should be preserved for
/// each data set.
///
/// This should be set to true if the table is not disposed and completely
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/lib/src/shared/ui/hover.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class HoverCard {

/// Ensures that only one [HoverCard] is ever displayed at a time.
class HoverCardController {
/// The card that is currenty being displayed.
/// The card that is currently being displayed.
HoverCard? _currentHoverCard;

/// Sets [hoverCard] as the most recently displayed [HoverCard].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void main() {
extensions.toggleSelectWidgetMode.extension],
isFalse,
);
// Verify the the other service extension's state hasn't changed.
// Verify the other service extension's state hasn't changed.
expect(
fakeExtensionManager
.extensionValueOnDevice[extensions.debugPaint.extension],
Expand Down
Loading