Skip to content

Commit d4b8e06

Browse files
lambdabaacommit-bot@chromium.org
authored andcommitted
Add the capability in analysis server protocol for clients to express
interest in receiving not yet imported code completions from specific packages and libraries. The design of this interaction aims to avoid forcing analysis server to send every public symbol from dependent packages at every completion. Instead, clients express interest in certain packages and/or libraries and analysis server will notify with the entire set of symbols for each of them only once. Then it is the client's responsibility to save these pre-computed completions in memory, and analysis server can instruct the client on how to union them with the base set of completion suggestions at code completion time. Bug: #35680 Change-Id: I42c6fddc5d8daa2b546daa81456c0992e3ef547d Reviewed-on: https://dart-review.googlesource.com/c/90125 Commit-Queue: Ari Aye <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 7a95930 commit d4b8e06

16 files changed

+4407
-321
lines changed

pkg/analysis_server/doc/api.html

Lines changed: 27 additions & 2 deletions
Large diffs are not rendered by default.

pkg/analysis_server/lib/protocol/protocol_constants.dart

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// To regenerate the file, use the script
77
// "pkg/analysis_server/tool/spec/generate_files".
88

9-
const String PROTOCOL_VERSION = '1.22.2';
9+
const String PROTOCOL_VERSION = '1.23.0';
1010

1111
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
1212
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES_DIRECTORIES = 'directories';
@@ -110,8 +110,18 @@ const String ANALYTICS_REQUEST_SEND_TIMING = 'analytics.sendTiming';
110110
const String ANALYTICS_REQUEST_SEND_TIMING_EVENT = 'event';
111111
const String ANALYTICS_REQUEST_SEND_TIMING_MILLIS = 'millis';
112112
const String ANALYTICS_RESPONSE_IS_ENABLED_ENABLED = 'enabled';
113+
const String COMPLETION_NOTIFICATION_AVAILABLE_SUGGESTIONS =
114+
'completion.availableSuggestions';
115+
const String COMPLETION_NOTIFICATION_AVAILABLE_SUGGESTIONS_CHANGED_LIBRARIES =
116+
'changedLibraries';
117+
const String COMPLETION_NOTIFICATION_AVAILABLE_SUGGESTIONS_REMOVED_LIBRARIES =
118+
'removedLibraries';
113119
const String COMPLETION_NOTIFICATION_RESULTS = 'completion.results';
114120
const String COMPLETION_NOTIFICATION_RESULTS_ID = 'id';
121+
const String COMPLETION_NOTIFICATION_RESULTS_INCLUDED_SUGGESTION_KINDS =
122+
'includedSuggestionKinds';
123+
const String COMPLETION_NOTIFICATION_RESULTS_INCLUDED_SUGGESTION_SETS =
124+
'includedSuggestionSets';
115125
const String COMPLETION_NOTIFICATION_RESULTS_IS_LAST = 'isLast';
116126
const String COMPLETION_NOTIFICATION_RESULTS_REPLACEMENT_LENGTH =
117127
'replacementLength';
@@ -121,7 +131,22 @@ const String COMPLETION_NOTIFICATION_RESULTS_RESULTS = 'results';
121131
const String COMPLETION_REQUEST_GET_SUGGESTIONS = 'completion.getSuggestions';
122132
const String COMPLETION_REQUEST_GET_SUGGESTIONS_FILE = 'file';
123133
const String COMPLETION_REQUEST_GET_SUGGESTIONS_OFFSET = 'offset';
134+
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS =
135+
'completion.getSuggestionDetails';
136+
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_FILE = 'file';
137+
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_ID = 'id';
138+
const String COMPLETION_REQUEST_GET_SUGGESTION_DETAILS_LABEL = 'label';
139+
const String COMPLETION_REQUEST_REGISTER_LIBRARY_PATHS =
140+
'completion.registerLibraryPaths';
141+
const String COMPLETION_REQUEST_REGISTER_LIBRARY_PATHS_PATHS = 'paths';
142+
const String COMPLETION_REQUEST_SET_SUBSCRIPTIONS =
143+
'completion.setSubscriptions';
144+
const String COMPLETION_REQUEST_SET_SUBSCRIPTIONS_SUBSCRIPTIONS =
145+
'subscriptions';
124146
const String COMPLETION_RESPONSE_GET_SUGGESTIONS_ID = 'id';
147+
const String COMPLETION_RESPONSE_GET_SUGGESTION_DETAILS_CHANGE = 'change';
148+
const String COMPLETION_RESPONSE_GET_SUGGESTION_DETAILS_COMPLETION =
149+
'completion';
125150
const String DIAGNOSTIC_REQUEST_GET_DIAGNOSTICS = 'diagnostic.getDiagnostics';
126151
const String DIAGNOSTIC_REQUEST_GET_SERVER_PORT = 'diagnostic.getServerPort';
127152
const String DIAGNOSTIC_RESPONSE_GET_DIAGNOSTICS_CONTEXTS = 'contexts';

0 commit comments

Comments
 (0)