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

Side by Side Diff: pkg/analyzer_plugin/doc/tutorial/highlights.md

Issue 3006703002: Add plugin support for occurrences (and fix typo) (Closed)
Patch Set: Created 3 years, 3 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/analyzer_plugin/doc/tutorial/occurrences.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Providing Highlighting Information 1 # Providing Highlighting Information
2 2
3 Highlighting information is used by clients to help users identify different 3 Highlighting information is used by clients to help users identify different
4 syntactic and semantic regions of their code. 4 syntactic and semantic regions of their code.
5 5
6 Syntactic highlighting is highlighting that is based completely on the syntax of 6 Syntactic highlighting is highlighting that is based completely on the syntax of
7 the code. For example, editors will often provide unique colors for comments, 7 the code. For example, editors will often provide unique colors for comments,
8 string literals, and numeric literals. 8 string literals, and numeric literals.
9 9
10 Semantic highlighting is highlighting that is based on semantic information. For 10 Semantic highlighting is highlighting that is based on semantic information. For
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 } 62 }
63 } 63 }
64 64
65 class HighlightsVisitor extends RecursiveAstVisitor { 65 class HighlightsVisitor extends RecursiveAstVisitor {
66 final HighlightsCollector collector; 66 final HighlightsCollector collector;
67 67
68 HighlightsVisitor(this.collector); 68 HighlightsVisitor(this.collector);
69 69
70 @override 70 @override
71 void visitSimpleIdentifier(ClassDeclaration node) { 71 void visitSimpleIdentifier(SimpleIdentifier node) {
72 // ... 72 // ...
73 } 73 }
74 } 74 }
75 ``` 75 ```
76 76
77 Given a contributor like the one above, you can implement your plugin similar to 77 Given a contributor like the one above, you can implement your plugin similar to
78 the following: 78 the following:
79 79
80 ```dart 80 ```dart
81 class MyPlugin extends ServerPlugin with HighlightsMixin, DartHighlightsMixin { 81 class MyPlugin extends ServerPlugin with HighlightsMixin, DartHighlightsMixin {
82 // ... 82 // ...
83 83
84 @override 84 @override
85 List<HighlightsContributor> getHighlightsContributors(String path) { 85 List<HighlightsContributor> getHighlightsContributors(String path) {
86 return <HighlightsContributor>[new MyHighlightsContributor()]; 86 return <HighlightsContributor>[new MyHighlightsContributor()];
87 } 87 }
88 } 88 }
89 ``` 89 ```
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_plugin/doc/tutorial/occurrences.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698