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

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

Issue 2992843002: Add more documentation for plugins (Closed)
Patch Set: Created 3 years, 4 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 # Providing Quick Assists 1 # Providing Quick Assists
2 2
3 A quick assist is used by clients to provide a set of possible changes to code 3 A quick assist is used by clients to provide a set of possible changes to code
4 that are based on the structure of the code. Quick assists are intended to help 4 that are based on the structure of the code. Quick assists are intended to help
5 users safely make local changes to code when those changes do not require any 5 users safely make local changes to code when those changes do not require any
6 user interaction. (Modifications that require interaction with users or that 6 user interaction. (Modifications that require interaction with users or that
7 touch multiple files are usually implemented as refactorings.) 7 touch multiple files are usually implemented as refactorings.)
8 8
9 For example, if the user has a function whose body consists of a single return 9 For example, if the user has a function whose body consists of a single return
10 statement in a block, server will provide an assist to convert the function body 10 statement in a block, server will provide an assist to convert the function body
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ``` 89 ```
90 90
91 Given a contributor like the one above, you can implement your plugin similar to 91 Given a contributor like the one above, you can implement your plugin similar to
92 the following: 92 the following:
93 93
94 ```dart 94 ```dart
95 class MyPlugin extends ServerPlugin with AssistsMixin, DartAssistsMixin { 95 class MyPlugin extends ServerPlugin with AssistsMixin, DartAssistsMixin {
96 // ... 96 // ...
97 97
98 @override 98 @override
99 List<AssistContributor> getAssistContributors( 99 List<AssistContributor> getAssistContributors(AnalysisDriver driver) {
100 covariant AnalysisDriver driver) {
101 return <AssistContributor>[new MyAssistContributor()]; 100 return <AssistContributor>[new MyAssistContributor()];
102 } 101 }
103 } 102 }
104 ``` 103 ```
105 104
106 [creatingEdits]: creating_edits.md 105 [creatingEdits]: creating_edits.md
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_plugin/doc/tutorial/completion.md » ('j') | pkg/analyzer_plugin/doc/tutorial/introduction.md » ('J')

Powered by Google App Engine
This is Rietveld 408576698