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

Side by Side Diff: pkg/analysis_server/lib/src/analysis_manager.dart

Issue 506433002: Finish modifying analysis server to make use of code generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analysis_server/src/channel.dart'; 9 import 'package:analysis_server/src/channel.dart';
10 import 'package:analysis_server/src/constants.dart';
11 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
12 11
13 /** 12 /**
14 * [AnalysisManager] is used to launch and manage an analysis server 13 * [AnalysisManager] is used to launch and manage an analysis server
15 * running in a separate process using either the [start] or [connect] methods. 14 * running in a separate process using either the [start] or [connect] methods.
16 */ 15 */
17 class AnalysisManager { 16 class AnalysisManager {
18 // TODO dynamically allocate port and/or allow client to specify port 17 // TODO dynamically allocate port and/or allow client to specify port
19 static const int PORT = 3333; 18 static const int PORT = 3333;
20 19
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 * 113 *
115 * Returns `true` if the signal is successfully sent and process terminates. 114 * Returns `true` if the signal is successfully sent and process terminates.
116 * Otherwise there was no attached process or the signal could not be sent, 115 * Otherwise there was no attached process or the signal could not be sent,
117 * usually meaning that the process is already dead. 116 * usually meaning that the process is already dead.
118 */ 117 */
119 Future<bool> stop() { 118 Future<bool> stop() {
120 if (process == null) { 119 if (process == null) {
121 return channel.close().then((_) => false); 120 return channel.close().then((_) => false);
122 } 121 }
123 return channel 122 return channel
124 .sendRequest(new Request('0', SERVER_SHUTDOWN)) 123 .sendRequest(new ServerShutdownParams().toRequest('0'))
125 .timeout(new Duration(seconds: 2), onTimeout: () { 124 .timeout(new Duration(seconds: 2), onTimeout: () {
126 print('Expected shutdown response'); 125 print('Expected shutdown response');
127 }) 126 })
128 .then((Response response) { 127 .then((Response response) {
129 return channel.close().then((_) => process.exitCode); 128 return channel.close().then((_) => process.exitCode);
130 }) 129 })
131 .timeout(new Duration(seconds: 2), onTimeout: () { 130 .timeout(new Duration(seconds: 2), onTimeout: () {
132 print('Expected server to shutdown'); 131 print('Expected server to shutdown');
133 process.kill(); 132 process.kill();
134 }) 133 })
135 .then((int result) { 134 .then((int result) {
136 if (result != null && result != 0) { 135 if (result != null && result != 0) {
137 exitCode = result; 136 exitCode = result;
138 } 137 }
139 return true; 138 return true;
140 }); 139 });
141 } 140 }
142 } 141 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698