Skip to content

Commit

Permalink
remove and inline the use of package:ansi_up (#8601)
Browse files Browse the repository at this point in the history
* remove and inline the use of package:ansi_up

* DCM lints
  • Loading branch information
devoncarew authored Dec 6, 2024
1 parent 0a77055 commit ee6877a
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MessageColumn extends ColumnData<LogData>
text: TextSpan(
children: [
if (hasSummary)
...processAnsiTerminalCodes(
...textSpansFromAnsi(
// TODO(helin24): Recompute summary length considering ansi codes.
// The current summary is generally the first 200 chars of details.
data.summary!,
Expand All @@ -78,7 +78,7 @@ class MessageColumn extends ColumnData<LogData>
if (hasSummary && hasDetails())
TextSpan(text: ' • ', style: theme.subtleTextStyle),
if (hasDetails())
...processAnsiTerminalCodes(
...textSpansFromAnsi(
detailsComputed ? data.details! : '<fetching>',
theme.subtleTextStyle,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class DisplayProvider extends StatelessWidget {
if (variable.text != null) {
return SelectableText.rich(
TextSpan(
children: processAnsiTerminalCodes(
variable.text,
children: textSpansFromAnsi(
variable.text ?? '',
theme.subtleFixedFontStyle,
),
),
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/lib/src/shared/console/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class _ConsoleOutputState extends State<_ConsoleOutput>
TextSpan(
// TODO(jacobr): consider caching the processed ansi terminal
// codes.
children: processAnsiTerminalCodes(
children: textSpansFromAnsi(
line.text,
theme.regularTextStyle,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class _DisplayProviderState extends State<DisplayProvider> {
menuButtons: _getMenuButtons(context),
child: Text.rich(
TextSpan(
children: processAnsiTerminalCodes(
widget.variable.text,
children: textSpansFromAnsi(
widget.variable.text!,
theme.subtleFixedFontStyle,
),
),
Expand Down
Loading

0 comments on commit ee6877a

Please sign in to comment.