mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
Deprecate ToSourceVisitor
R=scheglov@google.com Review URL: https://codereview.chromium.org/2439773002 .
This commit is contained in:
parent
1baa650388
commit
d42a22bb1d
|
@ -17,7 +17,6 @@ import 'package:analyzer/src/dart/ast/utilities.dart';
|
|||
import 'package:analyzer/src/dart/element/element.dart';
|
||||
import 'package:analyzer/src/dart/element/type.dart';
|
||||
import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine;
|
||||
import 'package:analyzer/src/generated/java_core.dart';
|
||||
import 'package:analyzer/src/generated/java_engine.dart';
|
||||
import 'package:analyzer/src/generated/parser.dart';
|
||||
import 'package:analyzer/src/generated/source.dart' show LineInfo, Source;
|
||||
|
@ -941,9 +940,9 @@ abstract class AstNodeImpl implements AstNode {
|
|||
|
||||
@override
|
||||
String toSource() {
|
||||
PrintStringWriter writer = new PrintStringWriter();
|
||||
accept(new ToSourceVisitor(writer));
|
||||
return writer.toString();
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
accept(new ToSourceVisitor2(buffer));
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -6769,7 +6769,10 @@ class ScopedNameFinder extends GeneralizingAstVisitor<Object> {
|
|||
/**
|
||||
* A visitor used to write a source representation of a visited AST node (and
|
||||
* all of it's children) to a writer.
|
||||
*
|
||||
* This class has been deprecated. Use the class ToSourceVisitor2 instead.
|
||||
*/
|
||||
@deprecated
|
||||
class ToSourceVisitor implements AstVisitor<Object> {
|
||||
/**
|
||||
* The writer to which the source is to be written.
|
||||
|
|
|
@ -138,6 +138,7 @@ abstract class Enum<E extends Enum> implements Comparable<E> {
|
|||
String toString() => name;
|
||||
}
|
||||
|
||||
@deprecated
|
||||
class PrintStringWriter extends PrintWriter {
|
||||
final StringBuffer _sb = new StringBuffer();
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ main() {
|
|||
defineReflectiveTests(NodeLocatorTest);
|
||||
defineReflectiveTests(NodeLocator2Test);
|
||||
defineReflectiveTests(ResolutionCopierTest);
|
||||
// ignore: deprecated_member_use
|
||||
defineReflectiveTests(ToSourceVisitorTest);
|
||||
defineReflectiveTests(ToSourceVisitor2Test);
|
||||
});
|
||||
|
@ -3344,6 +3345,7 @@ class ToSourceVisitor2Test extends EngineTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
@deprecated
|
||||
@reflectiveTest
|
||||
class ToSourceVisitorTest extends EngineTestCase {
|
||||
void test_visitAdjacentStrings() {
|
||||
|
|
Loading…
Reference in a new issue