Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4979a51

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Add information about existing imports to completion response.
This adds quite a lot of information though, because we send many strings. Before: 20686 characters. After: 55345 characters. Theoretically we could do better, and send information about existing imports only once as well, so when the user continues typing in a single file, without touching imports, we don't send any new data about imports (maybe just a confirmation that it is still the same). But I'm not sure if this is a worthwhile optimization. Actually, even included suggestion sets have similar property - they don't change for a given file, unless there are changes to other libraries which we might want to include. [email protected] Change-Id: I2f55e2dc85508849146aa39eb279beabaec937c0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103561 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent e43d81a commit 4979a51

File tree

15 files changed

+1851
-41
lines changed

15 files changed

+1851
-41
lines changed

pkg/analysis_server/doc/api.html

Lines changed: 98 additions & 3 deletions
Large diffs are not rendered by default.

pkg/analysis_server/lib/protocol/protocol_constants.dart

Lines changed: 6 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.26.1';
9+
const String PROTOCOL_VERSION = '1.27.0';
1010

1111
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
1212
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES_DIRECTORIES = 'directories';
@@ -116,6 +116,10 @@ const String COMPLETION_NOTIFICATION_AVAILABLE_SUGGESTIONS_CHANGED_LIBRARIES =
116116
'changedLibraries';
117117
const String COMPLETION_NOTIFICATION_AVAILABLE_SUGGESTIONS_REMOVED_LIBRARIES =
118118
'removedLibraries';
119+
const String COMPLETION_NOTIFICATION_EXISTING_IMPORTS =
120+
'completion.existingImports';
121+
const String COMPLETION_NOTIFICATION_EXISTING_IMPORTS_FILE = 'file';
122+
const String COMPLETION_NOTIFICATION_EXISTING_IMPORTS_IMPORTS = 'imports';
119123
const String COMPLETION_NOTIFICATION_RESULTS = 'completion.results';
120124
const String COMPLETION_NOTIFICATION_RESULTS_ID = 'id';
121125
const String COMPLETION_NOTIFICATION_RESULTS_INCLUDED_ELEMENT_KINDS =
@@ -126,6 +130,7 @@ const String
126130
const String COMPLETION_NOTIFICATION_RESULTS_INCLUDED_SUGGESTION_SETS =
127131
'includedSuggestionSets';
128132
const String COMPLETION_NOTIFICATION_RESULTS_IS_LAST = 'isLast';
133+
const String COMPLETION_NOTIFICATION_RESULTS_LIBRARY_FILE = 'libraryFile';
129134
const String COMPLETION_NOTIFICATION_RESULTS_REPLACEMENT_LENGTH =
130135
'replacementLength';
131136
const String COMPLETION_NOTIFICATION_RESULTS_REPLACEMENT_OFFSET =

0 commit comments

Comments
 (0)