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

Side by Side Diff: pkg/analysis_server/lib/src/edit/edit_domain.dart

Issue 2467153002: Fixes for formatting and complete completion stub. (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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/domain_completion.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library edit.domain; 5 library edit.domain;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; 9 import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
10 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; 10 import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 _newRefactoringManager(); 65 _newRefactoringManager();
66 } 66 }
67 67
68 Response format(Request request) { 68 Response format(Request request) {
69 EditFormatParams params = new EditFormatParams.fromRequest(request); 69 EditFormatParams params = new EditFormatParams.fromRequest(request);
70 String file = params.file; 70 String file = params.file;
71 71
72 String unformattedSource; 72 String unformattedSource;
73 try { 73 try {
74 Source source = server.resourceProvider.getFile(file).createSource(); 74 Source source = server.resourceProvider.getFile(file).createSource();
75 unformattedSource = server.overlayState.getContents(source); 75 if (server.options.enableNewAnalysisDriver) {
76 unformattedSource = server.fileContentOverlay[file];
77 } else {
78 unformattedSource = server.overlayState.getContents(source);
79 }
76 unformattedSource ??= source.contents.data; 80 unformattedSource ??= source.contents.data;
77 } catch (e) { 81 } catch (e) {
78 return new Response.formatInvalidFile(request); 82 return new Response.formatInvalidFile(request);
79 } 83 }
80 84
81 int start = params.selectionOffset; 85 int start = params.selectionOffset;
82 int length = params.selectionLength; 86 int length = params.selectionLength;
83 87
84 // No need to preserve 0,0 selection 88 // No need to preserve 0,0 selection
85 if (start == 0 && length == 0) { 89 if (start == 0 && length == 0) {
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 } 810 }
807 return new RefactoringStatus(); 811 return new RefactoringStatus();
808 } 812 }
809 } 813 }
810 814
811 /** 815 /**
812 * [_RefactoringManager] throws instances of this class internally to stop 816 * [_RefactoringManager] throws instances of this class internally to stop
813 * processing in a manager that was reset. 817 * processing in a manager that was reset.
814 */ 818 */
815 class _ResetError {} 819 class _ResetError {}
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/domain_completion.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698