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

Side by Side Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 2879273002: Make server use the common protocol classes (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:math'; 5 import 'dart:math';
6 6
7 import 'package:analysis_server/protocol/protocol_generated.dart'
8 show SourceChange, SourceEdit;
9 import 'package:analysis_server/src/protocol_server.dart' 7 import 'package:analysis_server/src/protocol_server.dart'
10 show doSourceChange_addElementEdit; 8 show doSourceChange_addElementEdit;
11 import 'package:analysis_server/src/services/correction/strings.dart'; 9 import 'package:analysis_server/src/services/correction/strings.dart';
12 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
13 import 'package:analyzer/dart/ast/token.dart'; 11 import 'package:analyzer/dart/ast/token.dart';
14 import 'package:analyzer/dart/ast/visitor.dart'; 12 import 'package:analyzer/dart/ast/visitor.dart';
15 import 'package:analyzer/dart/element/element.dart'; 13 import 'package:analyzer/dart/element/element.dart';
16 import 'package:analyzer/dart/element/type.dart'; 14 import 'package:analyzer/dart/element/type.dart';
17 import 'package:analyzer/src/dart/ast/utilities.dart'; 15 import 'package:analyzer/src/dart/ast/utilities.dart';
18 import 'package:analyzer/src/dart/scanner/reader.dart'; 16 import 'package:analyzer/src/dart/scanner/reader.dart';
19 import 'package:analyzer/src/dart/scanner/scanner.dart'; 17 import 'package:analyzer/src/dart/scanner/scanner.dart';
20 import 'package:analyzer/src/generated/engine.dart'; 18 import 'package:analyzer/src/generated/engine.dart';
21 import 'package:analyzer/src/generated/resolver.dart'; 19 import 'package:analyzer/src/generated/resolver.dart';
22 import 'package:analyzer/src/generated/source.dart'; 20 import 'package:analyzer/src/generated/source.dart';
21 import 'package:analyzer_plugin/protocol/protocol_common.dart'
22 show SourceChange, SourceEdit;
23 import 'package:analyzer_plugin/src/utilities/string_utilities.dart'; 23 import 'package:analyzer_plugin/src/utilities/string_utilities.dart';
24 import 'package:analyzer_plugin/utilities/range_factory.dart'; 24 import 'package:analyzer_plugin/utilities/range_factory.dart';
25 import 'package:path/path.dart'; 25 import 'package:path/path.dart';
26 26
27 /** 27 /**
28 * Adds edits to the given [change] that ensure that all the [libraries] are 28 * Adds edits to the given [change] that ensure that all the [libraries] are
29 * imported into the given [targetLibrary]. 29 * imported into the given [targetLibrary].
30 */ 30 */
31 void addLibraryImports( 31 void addLibraryImports(
32 SourceChange change, LibraryElement targetLibrary, Set<Source> libraries) { 32 SourceChange change, LibraryElement targetLibrary, Set<Source> libraries) {
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 _InvertedCondition expr, int newOperatorPrecedence) { 1646 _InvertedCondition expr, int newOperatorPrecedence) {
1647 if (expr._precedence < newOperatorPrecedence) { 1647 if (expr._precedence < newOperatorPrecedence) {
1648 return "(${expr._source})"; 1648 return "(${expr._source})";
1649 } 1649 }
1650 return expr._source; 1650 return expr._source;
1651 } 1651 }
1652 1652
1653 static _InvertedCondition _simple(String source) => 1653 static _InvertedCondition _simple(String source) =>
1654 new _InvertedCondition(2147483647, source); 1654 new _InvertedCondition(2147483647, source);
1655 } 1655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698