| Index: pkg/analysis_server/lib/src/edit/edit_domain.dart
|
| diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
|
| index c0323a442e28d1f050e60f3ef16bab71d8810bd0..7e1a9883219b4ab1d2d70456620de87957e4116f 100644
|
| --- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
|
| +++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
|
| @@ -69,23 +69,15 @@ class EditDomainHandler implements RequestHandler {
|
| EditFormatParams params = new EditFormatParams.fromRequest(request);
|
| String file = params.file;
|
|
|
| - ContextSourcePair contextSource = server.getContextSourcePair(file);
|
| -
|
| - engine.AnalysisContext context = contextSource.context;
|
| - if (context == null) {
|
| - return new Response.formatInvalidFile(request);
|
| - }
|
| -
|
| - Source source = contextSource.source;
|
| - engine.TimestampedData<String> contents;
|
| + String unformattedSource;
|
| try {
|
| - contents = context.getContents(source);
|
| + Source source = server.resourceProvider.getFile(file).createSource();
|
| + unformattedSource = server.overlayState.getContents(source);
|
| + unformattedSource ??= source.contents.data;
|
| } catch (e) {
|
| return new Response.formatInvalidFile(request);
|
| }
|
|
|
| - String unformattedSource = contents.data;
|
| -
|
| int start = params.selectionOffset;
|
| int length = params.selectionLength;
|
|
|
|
|