Skip to content

Commit ecc6bd5

Browse files
committed
Version 1.8.0-dev.3.0
svn merge -r 41388:41500 https://dart.googlecode.com/svn/branches/bleeding_edge trunk git-svn-id: http://dart.googlecode.com/svn/trunk@41515 260f80e4-7a28-3924-810f-c04153c831b5
2 parents f9e8847 + 7f4d5bb commit ecc6bd5

File tree

367 files changed

+51574
-23855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+51574
-23855
lines changed

pkg/analysis_server/doc/api.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,29 @@ <h2 class="domain"><a name="types">Types</a></h2>
21062106
in a completion suggestion.
21072107
</p>
21082108

2109-
<dl><dt class="value">ARGUMENT_LIST</dt><dt class="value">CLASS</dt><dt class="value">CLASS_ALIAS</dt><dt class="value">CONSTRUCTOR</dt><dt class="value">FIELD</dt><dt class="value">FUNCTION</dt><dt class="value">FUNCTION_TYPE_ALIAS</dt><dt class="value">GETTER</dt><dt class="value">IMPORT</dt><dt class="value">KEYWORD</dt><dt class="value">LABEL</dt><dt class="value">LIBRARY_PREFIX</dt><dt class="value">LOCAL_VARIABLE</dt><dt class="value">METHOD</dt><dt class="value">METHOD_NAME</dt><dt class="value">NAMED_ARGUMENT</dt><dt class="value">OPTIONAL_ARGUMENT</dt><dt class="value">PARAMETER</dt><dt class="value">SETTER</dt><dt class="value">TOP_LEVEL_VARIABLE</dt><dt class="value">TYPE_PARAMETER</dt></dl></dd><dt class="typeDefinition"><a name="type_Element">Element: object</a></dt><dd>
2109+
<dl><dt class="value">ARGUMENT_LIST</dt><dt class="value">IMPORT</dt><dt class="value">IDENTIFIER</dt><dd>
2110+
2111+
<p>
2112+
The element identifier should be inserted at the completion location.
2113+
For example "someMethod" in import 'myLib.dart' show someMethod; .
2114+
For suggestions of this kind, the element attribute is defined
2115+
and the completion field is the element's identifier.
2116+
</p>
2117+
</dd><dt class="value">INVOCATION</dt><dd>
2118+
2119+
<p>
2120+
The element is being invoked at the completion location.
2121+
For example, "someMethod" in x.someMethod(); .
2122+
For suggestions of this kind, the element attribute is defined
2123+
and the completion field is the element's identifier.
2124+
</p>
2125+
</dd><dt class="value">KEYWORD</dt><dd>
2126+
2127+
<p>
2128+
A keyword is being suggested.
2129+
For suggestions of this kind, the completion is the keyword.
2130+
</p>
2131+
</dd><dt class="value">NAMED_ARGUMENT</dt><dt class="value">OPTIONAL_ARGUMENT</dt><dt class="value">PARAMETER</dt></dl></dd><dt class="typeDefinition"><a name="type_Element">Element: object</a></dt><dd>
21102132
<p>
21112133
Information about an element (something that can be declared
21122134
in code).

pkg/analysis_server/lib/src/analysis_logger.dart

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ library analysis.logger;
66

77
import 'package:analyzer/src/generated/engine.dart';
88
import 'package:logging/logging.dart' as logging;
9+
import 'package:analyzer/src/generated/java_engine.dart';
910

1011
/**
1112
* Instances of the class [AnalysisLogger] translate from the analysis engine's
@@ -18,22 +19,30 @@ class AnalysisLogger implements Logger {
1819
final logging.Logger baseLogger = new logging.Logger('analysis.server');
1920

2021
@override
21-
void logError(String message) {
22-
baseLogger.severe(message);
22+
void logError(String message, [CaughtException exception]) {
23+
if (exception == null) {
24+
baseLogger.severe(message);
25+
} else {
26+
baseLogger.severe(message, exception.exception, exception.stackTrace);
27+
}
2328
}
2429

2530
@override
26-
void logError2(String message, Exception exception) {
31+
void logError2(String message, Object exception) {
2732
baseLogger.severe(message, exception);
2833
}
2934

3035
@override
31-
void logInformation(String message) {
32-
baseLogger.info(message);
36+
void logInformation(String message, [CaughtException exception]) {
37+
if (exception == null) {
38+
baseLogger.info(message);
39+
} else {
40+
baseLogger.info(message, exception.exception, exception.stackTrace);
41+
}
3342
}
3443

3544
@override
36-
void logInformation2(String message, Exception exception) {
45+
void logInformation2(String message, Object exception) {
3746
baseLogger.info(message, exception);
3847
}
3948
}

pkg/analysis_server/lib/src/analysis_server.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,9 @@ class AnalysisServer {
435435
channel.sendResponse(exception.response);
436436
return;
437437
} catch (exception, stackTrace) {
438-
RequestError error =
439-
new RequestError(RequestErrorCode.SERVER_ERROR, exception);
438+
RequestError error = new RequestError(
439+
RequestErrorCode.SERVER_ERROR,
440+
exception.toString());
440441
if (stackTrace != null) {
441442
error.stackTrace = stackTrace.toString();
442443
}

pkg/analysis_server/lib/src/channel/byte_stream_channel.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ class ByteStreamServerChannel implements ServerCommunicationChannel {
8080

8181
@override
8282
void close() {
83-
if (!_closed.isCompleted) {
84-
_closed.complete();
85-
}
83+
output.flush().then((_) {
84+
if (!_closed.isCompleted) {
85+
_closed.complete();
86+
}
87+
});
8688
}
8789

8890
@override

pkg/analysis_server/lib/src/computer/computer_navigation.dart

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,29 +163,25 @@ class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor {
163163
Element element = node.staticElement;
164164
ConstructorName constructorName = node.constructorName;
165165
if (element != null && constructorName != null) {
166-
ClassElement classElement = element.enclosingElement;
166+
// if a synthetic constructor, navigate to the class
167167
if (element.isSynthetic) {
168+
ClassElement classElement = element.enclosingElement;
168169
element = classElement;
169-
computer._addRegion_nodeStart_nodeStart(
170-
node,
171-
node.argumentList,
170+
}
171+
// "new ", excluding last character
172+
computer._addRegion_nodeStart_nodeStart(
173+
node,
174+
constructorName.type,
175+
element,
176+
excludeLastChar: true);
177+
// "ClassName<TypeA, TypeB>"
178+
_safelyVisit(constructorName.type);
179+
// optional ".name"
180+
if (constructorName.period != null) {
181+
computer._addRegion_tokenStart_nodeEnd(
182+
constructorName.period,
183+
constructorName,
172184
element);
173-
} else {
174-
// "new ", excluding last character
175-
computer._addRegion_nodeStart_nodeStart(
176-
node,
177-
constructorName.type,
178-
element,
179-
excludeLastChar: true);
180-
// "ClassName"
181-
computer._addRegionForNode(constructorName.type, classElement);
182-
// optional ".name"
183-
if (constructorName.period != null) {
184-
computer._addRegion_tokenStart_nodeEnd(
185-
constructorName.period,
186-
constructorName,
187-
element);
188-
}
189185
}
190186
}
191187
_safelyVisit(node.argumentList);

pkg/analysis_server/lib/src/context_manager.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,23 @@ abstract class ContextManager {
239239
List<Resource> children = folder.getChildren();
240240
for (Resource child in children) {
241241
String path = child.path;
242-
// ignore if wasn't previously excluded
243-
bool wasExcluded =
244-
_isExcludedBy(oldExcludedPaths, path) &&
245-
!_isExcludedBy(excludedPaths, path);
246-
if (!wasExcluded) {
247-
continue;
248-
}
249242
// add files, recurse into folders
250243
if (child is File) {
251-
if (_shouldFileBeAnalyzed(child)) {
252-
Source source = child.createSource();
253-
changeSet.addedSource(source);
254-
info.sources[path] = source;
244+
// ignore if should not be analyzed at all
245+
if (!_shouldFileBeAnalyzed(child)) {
246+
continue;
255247
}
248+
// ignore if was not excluded
249+
bool wasExcluded =
250+
_isExcludedBy(oldExcludedPaths, path) &&
251+
!_isExcludedBy(excludedPaths, path);
252+
if (!wasExcluded) {
253+
continue;
254+
}
255+
// do add the file
256+
Source source = child.createSource();
257+
changeSet.addedSource(source);
258+
info.sources[path] = source;
256259
} else if (child is Folder) {
257260
if (child.shortName == PACKAGES_NAME) {
258261
continue;

pkg/analysis_server/lib/src/generated_protocol.dart

Lines changed: 25 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5561,71 +5561,48 @@ class CompletionSuggestion implements HasToJson {
55615561
*
55625562
* enum {
55635563
* ARGUMENT_LIST
5564-
* CLASS
5565-
* CLASS_ALIAS
5566-
* CONSTRUCTOR
5567-
* FIELD
5568-
* FUNCTION
5569-
* FUNCTION_TYPE_ALIAS
5570-
* GETTER
55715564
* IMPORT
5565+
* IDENTIFIER
5566+
* INVOCATION
55725567
* KEYWORD
5573-
* LABEL
5574-
* LIBRARY_PREFIX
5575-
* LOCAL_VARIABLE
5576-
* METHOD
5577-
* METHOD_NAME
55785568
* NAMED_ARGUMENT
55795569
* OPTIONAL_ARGUMENT
55805570
* PARAMETER
5581-
* SETTER
5582-
* TOP_LEVEL_VARIABLE
5583-
* TYPE_PARAMETER
55845571
* }
55855572
*/
55865573
class CompletionSuggestionKind implements Enum {
55875574
static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
55885575

5589-
static const CLASS = const CompletionSuggestionKind._("CLASS");
5590-
5591-
static const CLASS_ALIAS = const CompletionSuggestionKind._("CLASS_ALIAS");
5592-
5593-
static const CONSTRUCTOR = const CompletionSuggestionKind._("CONSTRUCTOR");
5594-
5595-
static const FIELD = const CompletionSuggestionKind._("FIELD");
5596-
5597-
static const FUNCTION = const CompletionSuggestionKind._("FUNCTION");
5598-
5599-
static const FUNCTION_TYPE_ALIAS = const CompletionSuggestionKind._("FUNCTION_TYPE_ALIAS");
5600-
5601-
static const GETTER = const CompletionSuggestionKind._("GETTER");
5602-
56035576
static const IMPORT = const CompletionSuggestionKind._("IMPORT");
56045577

5605-
static const KEYWORD = const CompletionSuggestionKind._("KEYWORD");
5606-
5607-
static const LABEL = const CompletionSuggestionKind._("LABEL");
5608-
5609-
static const LIBRARY_PREFIX = const CompletionSuggestionKind._("LIBRARY_PREFIX");
5610-
5611-
static const LOCAL_VARIABLE = const CompletionSuggestionKind._("LOCAL_VARIABLE");
5578+
/**
5579+
* The element identifier should be inserted at the completion location. For
5580+
* example "someMethod" in import 'myLib.dart' show someMethod; . For
5581+
* suggestions of this kind, the element attribute is defined and the
5582+
* completion field is the element's identifier.
5583+
*/
5584+
static const IDENTIFIER = const CompletionSuggestionKind._("IDENTIFIER");
56125585

5613-
static const METHOD = const CompletionSuggestionKind._("METHOD");
5586+
/**
5587+
* The element is being invoked at the completion location. For example,
5588+
* "someMethod" in x.someMethod(); . For suggestions of this kind, the
5589+
* element attribute is defined and the completion field is the element's
5590+
* identifier.
5591+
*/
5592+
static const INVOCATION = const CompletionSuggestionKind._("INVOCATION");
56145593

5615-
static const METHOD_NAME = const CompletionSuggestionKind._("METHOD_NAME");
5594+
/**
5595+
* A keyword is being suggested. For suggestions of this kind, the completion
5596+
* is the keyword.
5597+
*/
5598+
static const KEYWORD = const CompletionSuggestionKind._("KEYWORD");
56165599

56175600
static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT");
56185601

56195602
static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
56205603

56215604
static const PARAMETER = const CompletionSuggestionKind._("PARAMETER");
56225605

5623-
static const SETTER = const CompletionSuggestionKind._("SETTER");
5624-
5625-
static const TOP_LEVEL_VARIABLE = const CompletionSuggestionKind._("TOP_LEVEL_VARIABLE");
5626-
5627-
static const TYPE_PARAMETER = const CompletionSuggestionKind._("TYPE_PARAMETER");
5628-
56295606
final String name;
56305607

56315608
const CompletionSuggestionKind._(this.name);
@@ -5634,46 +5611,20 @@ class CompletionSuggestionKind implements Enum {
56345611
switch (name) {
56355612
case "ARGUMENT_LIST":
56365613
return ARGUMENT_LIST;
5637-
case "CLASS":
5638-
return CLASS;
5639-
case "CLASS_ALIAS":
5640-
return CLASS_ALIAS;
5641-
case "CONSTRUCTOR":
5642-
return CONSTRUCTOR;
5643-
case "FIELD":
5644-
return FIELD;
5645-
case "FUNCTION":
5646-
return FUNCTION;
5647-
case "FUNCTION_TYPE_ALIAS":
5648-
return FUNCTION_TYPE_ALIAS;
5649-
case "GETTER":
5650-
return GETTER;
56515614
case "IMPORT":
56525615
return IMPORT;
5616+
case "IDENTIFIER":
5617+
return IDENTIFIER;
5618+
case "INVOCATION":
5619+
return INVOCATION;
56535620
case "KEYWORD":
56545621
return KEYWORD;
5655-
case "LABEL":
5656-
return LABEL;
5657-
case "LIBRARY_PREFIX":
5658-
return LIBRARY_PREFIX;
5659-
case "LOCAL_VARIABLE":
5660-
return LOCAL_VARIABLE;
5661-
case "METHOD":
5662-
return METHOD;
5663-
case "METHOD_NAME":
5664-
return METHOD_NAME;
56655622
case "NAMED_ARGUMENT":
56665623
return NAMED_ARGUMENT;
56675624
case "OPTIONAL_ARGUMENT":
56685625
return OPTIONAL_ARGUMENT;
56695626
case "PARAMETER":
56705627
return PARAMETER;
5671-
case "SETTER":
5672-
return SETTER;
5673-
case "TOP_LEVEL_VARIABLE":
5674-
return TOP_LEVEL_VARIABLE;
5675-
case "TYPE_PARAMETER":
5676-
return TYPE_PARAMETER;
56775628
}
56785629
throw new Exception('Illegal enum value: $name');
56795630
}

0 commit comments

Comments
 (0)