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

Side by Side Diff: pkg/analysis_server/lib/src/computer/computer_highlights2.dart

Issue 2613383003: Add support for generic function type syntax, part 1 (Closed)
Patch Set: Created 3 years, 11 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 library computer.highlights2; 5 library computer.highlights2;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element; 7 import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 9 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 } 584 }
585 585
586 @override 586 @override
587 Object visitFunctionTypeAlias(FunctionTypeAlias node) { 587 Object visitFunctionTypeAlias(FunctionTypeAlias node) {
588 computer._addRegion_token( 588 computer._addRegion_token(
589 node.typedefKeyword, HighlightRegionType.BUILT_IN); 589 node.typedefKeyword, HighlightRegionType.BUILT_IN);
590 return super.visitFunctionTypeAlias(node); 590 return super.visitFunctionTypeAlias(node);
591 } 591 }
592 592
593 @override 593 @override
594 Object visitGenericFunctionType(GenericFunctionType node) {
595 computer._addRegion_token(
596 node.functionKeyword, HighlightRegionType.KEYWORD);
597 return super.visitGenericFunctionType(node);
598 }
599
600 @override
601 Object visitGenericTypeAlias(GenericTypeAlias node) {
602 computer._addRegion_token(node.typedefKeyword, HighlightRegionType.KEYWORD);
603 return super.visitGenericTypeAlias(node);
604 }
605
606 @override
594 Object visitHideCombinator(HideCombinator node) { 607 Object visitHideCombinator(HideCombinator node) {
595 computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN); 608 computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN);
596 return super.visitHideCombinator(node); 609 return super.visitHideCombinator(node);
597 } 610 }
598 611
599 @override 612 @override
600 Object visitIfStatement(IfStatement node) { 613 Object visitIfStatement(IfStatement node) {
601 computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD); 614 computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
602 return super.visitIfStatement(node); 615 return super.visitIfStatement(node);
603 } 616 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 void _addRegions_functionBody(FunctionBody node) { 827 void _addRegions_functionBody(FunctionBody node) {
815 Token keyword = node.keyword; 828 Token keyword = node.keyword;
816 if (keyword != null) { 829 if (keyword != null) {
817 Token star = node.star; 830 Token star = node.star;
818 int offset = keyword.offset; 831 int offset = keyword.offset;
819 int end = star != null ? star.end : keyword.end; 832 int end = star != null ? star.end : keyword.end;
820 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); 833 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN);
821 } 834 }
822 } 835 }
823 } 836 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698