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

Unified Diff: pkg/analysis_server/lib/src/services/completion/completion_core.dart

Issue 2537513004: Read overlay content when computing completions (issue 27887) (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/completion/completion_core.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_core.dart b/pkg/analysis_server/lib/src/services/completion/completion_core.dart
index c43a144d0763dcf0e9c723b755ea96d8aa9ec86b..0a8b431e290e251d1ea9385f1b084efda267e844 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_core.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_core.dart
@@ -87,12 +87,12 @@ class CompletionRequestImpl implements CompletionRequest {
* that can be used to filter the suggestions on the server side.
*/
String get filterText {
- return context
- .getContents(source)
- .data
- .substring(replacementOffset, offset);
+ return sourceContents.substring(replacementOffset, offset);
}
+ @override
+ String get sourceContents => context.getContents(source)?.data;
+
/**
* Abort the current completion request.
*/

Powered by Google App Engine
This is Rietveld 408576698