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

Side by Side Diff: pkg/analysis_server/lib/src/computer/computer_highlights.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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/computer/computer_highlights2.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.highlights; 5 library computer.highlights;
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/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 493 }
494 494
495 @override 495 @override
496 Object visitFunctionTypeAlias(FunctionTypeAlias node) { 496 Object visitFunctionTypeAlias(FunctionTypeAlias node) {
497 computer._addRegion_token( 497 computer._addRegion_token(
498 node.typedefKeyword, HighlightRegionType.BUILT_IN); 498 node.typedefKeyword, HighlightRegionType.BUILT_IN);
499 return super.visitFunctionTypeAlias(node); 499 return super.visitFunctionTypeAlias(node);
500 } 500 }
501 501
502 @override 502 @override
503 Object visitGenericFunctionType(GenericFunctionType node) {
504 computer._addRegion_token(
505 node.functionKeyword, HighlightRegionType.KEYWORD);
506 return super.visitGenericFunctionType(node);
507 }
508
509 @override
510 Object visitGenericTypeAlias(GenericTypeAlias node) {
511 computer._addRegion_token(node.typedefKeyword, HighlightRegionType.KEYWORD);
512 return super.visitGenericTypeAlias(node);
513 }
514
515 @override
503 Object visitHideCombinator(HideCombinator node) { 516 Object visitHideCombinator(HideCombinator node) {
504 computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN); 517 computer._addRegion_token(node.keyword, HighlightRegionType.BUILT_IN);
505 return super.visitHideCombinator(node); 518 return super.visitHideCombinator(node);
506 } 519 }
507 520
508 @override 521 @override
509 Object visitIfStatement(IfStatement node) { 522 Object visitIfStatement(IfStatement node) {
510 computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD); 523 computer._addRegion_token(node.ifKeyword, HighlightRegionType.KEYWORD);
511 return super.visitIfStatement(node); 524 return super.visitIfStatement(node);
512 } 525 }
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 void _addRegions_functionBody(FunctionBody node) { 730 void _addRegions_functionBody(FunctionBody node) {
718 Token keyword = node.keyword; 731 Token keyword = node.keyword;
719 if (keyword != null) { 732 if (keyword != null) {
720 Token star = node.star; 733 Token star = node.star;
721 int offset = keyword.offset; 734 int offset = keyword.offset;
722 int end = star != null ? star.end : keyword.end; 735 int end = star != null ? star.end : keyword.end;
723 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN); 736 computer._addRegion(offset, end - offset, HighlightRegionType.BUILT_IN);
724 } 737 }
725 } 738 }
726 } 739 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/computer/computer_highlights2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698