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

Unified Diff: pkg/analysis_server/test/integration/analysis/highlights_test2.dart

Issue 1241193002: Add '--useAnalysisHighlight2' option to generate version 2 of semantic highlight. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/integration/analysis/highlights_test2.dart
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
similarity index 74%
copy from pkg/analysis_server/test/integration/analysis/highlights_test.dart
copy to pkg/analysis_server/test/integration/analysis/highlights_test2.dart
index b466ff66660c3106fb92fe433fb439d7b24e2d9a..71913f02d5beb34e722a474b8f5e4579fda1402c 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
@@ -2,7 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library test.integration.analysis.highlights;
+library test.integration.analysis.highlights2;
+
+import 'dart:async';
import 'package:analysis_server/src/protocol.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -16,6 +18,10 @@ main() {
@reflectiveTest
class AnalysisHighlightsTest extends AbstractAnalysisServerIntegrationTest {
+ Future startServer() {
+ return server.start(useAnalysisHighlight2: true);
+ }
+
test_highlights() {
String pathname = sourcePath('test.dart');
String text = r'''
@@ -49,6 +55,7 @@ class Class<TypeParameter> {
}
set setter(int parameter) {
+ print(parameter);
}
}
@@ -118,13 +125,14 @@ int topLevelVariable;
HighlightRegionType.COMMENT_END_OF_LINE, ['// End of line comment']);
check(HighlightRegionType.CONSTRUCTOR, ['constructor']);
check(HighlightRegionType.DIRECTIVE, ["import 'dart:async' as async;"]);
- check(HighlightRegionType.DYNAMIC_TYPE, ['dynamicType']);
- check(HighlightRegionType.FIELD, ['field']);
- check(HighlightRegionType.FIELD_STATIC, ['staticField']);
- check(HighlightRegionType.FUNCTION, ['print']);
- check(HighlightRegionType.FUNCTION_DECLARATION, ['function']);
+ check(HighlightRegionType.DYNAMIC_PARAMETER_DECLARATION, ['dynamicType']);
+ check(HighlightRegionType.INSTANCE_FIELD_DECLARATION, ['field']);
+ check(HighlightRegionType.INSTANCE_SETTER_REFERENCE, ['field']);
+ check(HighlightRegionType.STATIC_FIELD_DECLARATION, ['staticField']);
+ check(HighlightRegionType.TOP_LEVEL_FUNCTION_REFERENCE, ['print']);
+ check(HighlightRegionType.TOP_LEVEL_FUNCTION_DECLARATION, ['function']);
check(HighlightRegionType.FUNCTION_TYPE_ALIAS, ['functionType']);
- check(HighlightRegionType.GETTER_DECLARATION, ['getter']);
+ check(HighlightRegionType.INSTANCE_GETTER_DECLARATION, ['getter']);
check(HighlightRegionType.IDENTIFIER_DEFAULT, ['unresolvedIdentifier']);
check(HighlightRegionType.IMPORT_PREFIX, ['async']);
check(HighlightRegionType.KEYWORD, ['class', 'true', 'return']);
@@ -137,18 +145,18 @@ int topLevelVariable;
'{2: local}'
]);
check(HighlightRegionType.LITERAL_STRING, ["'dart:async'", "'string'"]);
- check(HighlightRegionType.LOCAL_VARIABLE, ['local']);
check(HighlightRegionType.LOCAL_VARIABLE_DECLARATION, ['local']);
- check(HighlightRegionType.METHOD, ['toList']);
- check(HighlightRegionType.METHOD_DECLARATION, ['method']);
- check(HighlightRegionType.METHOD_DECLARATION_STATIC, ['staticMethod']);
- check(HighlightRegionType.METHOD_STATIC, ['wait']);
- check(HighlightRegionType.PARAMETER, ['parameter']);
- check(HighlightRegionType.SETTER_DECLARATION, ['setter']);
- check(HighlightRegionType.TOP_LEVEL_VARIABLE, [
- 'override',
- 'topLevelVariable'
- ]);
+ check(HighlightRegionType.LOCAL_VARIABLE_REFERENCE, ['local']);
+ check(HighlightRegionType.INSTANCE_METHOD_REFERENCE, ['toList']);
+ check(HighlightRegionType.INSTANCE_METHOD_DECLARATION, ['method']);
+ check(HighlightRegionType.STATIC_METHOD_DECLARATION, ['staticMethod']);
+ check(HighlightRegionType.STATIC_METHOD_REFERENCE, ['wait']);
+ check(HighlightRegionType.PARAMETER_DECLARATION, ['parameter']);
+ check(HighlightRegionType.PARAMETER_REFERENCE, ['parameter']);
+ check(HighlightRegionType.INSTANCE_SETTER_DECLARATION, ['setter']);
+ check(HighlightRegionType.TOP_LEVEL_GETTER_REFERENCE, ['override']);
+ check(HighlightRegionType.TOP_LEVEL_VARIABLE_DECLARATION,
+ ['topLevelVariable']);
check(HighlightRegionType.TYPE_NAME_DYNAMIC, ['dynamic']);
check(HighlightRegionType.TYPE_PARAMETER, ['TypeParameter']);
expect(highlights, isEmpty);
« no previous file with comments | « pkg/analysis_server/test/analysis/test_all.dart ('k') | pkg/analysis_server/test/integration/analysis/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698