Skip to content

Commit cbbf34d

Browse files
author
Dart CI
committed
Version 3.8.0-212.0.dev
Merge 4551003 into dev
2 parents 49ed19f + 4551003 commit cbbf34d

File tree

182 files changed

+909
-860
lines changed

Some content is hidden

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

182 files changed

+909
-860
lines changed

pkg/_fe_analyzer_shared/test/flow_analysis/reachability/data/unreachable_via_never.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void nonNullAssert(Null Function() f) {
5050
}
5151

5252
void nullAwareAccess(Null Function() f, Object? Function() g) {
53-
f()?.extensionMethod(/*unreachable*/ 1);
53+
f()?./*analyzer.unreachable*/extensionMethod(/*unreachable*/ 1);
5454
g()?.extensionMethod(2);
5555
}
5656

pkg/analysis_server/benchmark/integration/input_converter.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'operation.dart';
1919

2020
/// Common input converter superclass for sharing implementation.
2121
abstract class CommonInputConverter extends Converter<String, Operation?> {
22-
static final ERROR_PREFIX = 'Server responded with an error: ';
22+
static const _errorPrefix = 'Server responded with an error: ';
2323
final Logger logger = Logger('InstrumentationInputConverter');
2424
final Set<String> eventsSeen = <String>{};
2525

@@ -172,8 +172,8 @@ abstract class CommonInputConverter extends Converter<String, Operation?> {
172172
var result = exception;
173173
if (exception is UnimplementedError) {
174174
var message = exception.message;
175-
if (message!.startsWith(ERROR_PREFIX)) {
176-
result = json.decode(message.substring(ERROR_PREFIX.length));
175+
if (message!.startsWith(_errorPrefix)) {
176+
result = json.decode(message.substring(_errorPrefix.length));
177177
}
178178
}
179179
processResponseResult(id, result);

pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import 'package:logging/logging.dart';
1111
import 'input_converter.dart';
1212
import 'operation.dart';
1313

14-
final int COLON = ':'.codeUnitAt(0);
15-
1614
/// [InstrumentationInputConverter] converts an instrumentation stream
1715
/// into a series of operations to be sent to the analysis server.
1816
class InstrumentationInputConverter extends CommonInputConverter {
17+
static final _colon = ':'.codeUnitAt(0);
18+
1919
final Set<String> codesSeen = <String>{};
2020

2121
/// [readBuffer] holds the contents of the file being read from disk
@@ -109,10 +109,10 @@ class InstrumentationInputConverter extends CommonInputConverter {
109109
var sb = StringBuffer();
110110
while (index < line.length) {
111111
var code = line.codeUnitAt(index);
112-
if (code == COLON) {
112+
if (code == _colon) {
113113
// Embedded colons are doubled
114114
var next = index + 1;
115-
if (next < line.length && line.codeUnitAt(next) == COLON) {
115+
if (next < line.length && line.codeUnitAt(next) == _colon) {
116116
sb.write(':');
117117
++index;
118118
} else {

pkg/analysis_server/benchmark/integration/log_file_input_converter.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,31 @@ import 'package:logging/logging.dart';
1010
import 'input_converter.dart';
1111
import 'operation.dart';
1212

13-
const CONNECTED_MSG_FRAGMENT = ' <= {"event":"server.connected"';
14-
const RECEIVED_FRAGMENT = ' <= {';
15-
const SENT_FRAGMENT = ' => {';
16-
final int NINE = '9'.codeUnitAt(0);
17-
final int ZERO = '0'.codeUnitAt(0);
18-
1913
/// [LogFileInputConverter] converts a log file stream
2014
/// into a series of operations to be sent to the analysis server.
2115
class LogFileInputConverter extends CommonInputConverter {
16+
static const _connectedMsgFragment = ' <= {"event":"server.connected"';
17+
static const _receivedFragment = ' <= {';
18+
static const _sentFragment = ' => {';
19+
20+
static final _nine = '9'.codeUnitAt(0);
21+
static final _zero = '0'.codeUnitAt(0);
22+
2223
LogFileInputConverter(super.tmpSrcDirPath, super.srcPathMap);
2324

2425
@override
2526
Operation? convert(String line) {
2627
try {
2728
var timeStampString = _parseTimeStamp(line);
2829
var data = line.substring(timeStampString.length);
29-
if (data.startsWith(RECEIVED_FRAGMENT)) {
30+
if (data.startsWith(_receivedFragment)) {
3031
var jsonData = asMap(json.decode(data.substring(4)));
3132
if (jsonData.containsKey('event')) {
3233
return convertNotification(jsonData);
3334
} else {
3435
return convertResponse(jsonData);
3536
}
36-
} else if (data.startsWith(SENT_FRAGMENT)) {
37+
} else if (data.startsWith(_sentFragment)) {
3738
var jsonData = asMap(json.decode(data.substring(4)));
3839
if (jsonData.containsKey('method')) {
3940
return convertRequest(jsonData);
@@ -56,9 +57,9 @@ class LogFileInputConverter extends CommonInputConverter {
5657
static bool isFormat(String line) {
5758
var timeStampString = _parseTimeStamp(line);
5859
var start = timeStampString.length;
59-
var end = start + CONNECTED_MSG_FRAGMENT.length;
60+
var end = start + _connectedMsgFragment.length;
6061
return (10 < start && end < line.length) &&
61-
line.substring(start, end) == CONNECTED_MSG_FRAGMENT;
62+
line.substring(start, end) == _connectedMsgFragment;
6263
}
6364

6465
/// Parse the given line and return the millisecond timestamp or `null`
@@ -67,7 +68,7 @@ class LogFileInputConverter extends CommonInputConverter {
6768
var index = 0;
6869
while (index < line.length) {
6970
var code = line.codeUnitAt(index);
70-
if (code < ZERO || NINE < code) {
71+
if (code < _zero || _nine < code) {
7172
return line.substring(0, index);
7273
}
7374
++index;

pkg/analysis_server/lib/protocol/protocol.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,6 @@ abstract class RequestOrResponse {
291291
///
292292
/// Clients may not extend, implement or mix-in this class.
293293
class Response extends RequestOrResponse {
294-
/// The [Response] instance that is returned when a real [Response] cannot
295-
/// be provided at the moment.
296-
static final Response DELAYED_RESPONSE = Response('DELAYED_RESPONSE');
297-
298294
/// The name of the JSON attribute containing the id of the request for which
299295
/// this is a response.
300296
static const String ID = 'id';

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// Many functions here are mostly camelcase, with an occasional underscore to
6+
// separate phrases.
7+
// ignore_for_file: non_constant_identifier_names
8+
59
import 'dart:math' as math;
610

711
import 'package:_fe_analyzer_shared/src/parser/quote.dart'

pkg/analysis_server/lib/src/lsp/handlers/custom/editable_arguments/handler_editable_arguments.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class EditableArgumentsHandler
4242
MessageInfo message,
4343
CancellationToken token,
4444
) async {
45+
if (!isDartDocument(params.textDocument)) {
46+
return success(null);
47+
}
48+
4549
var textDocument = params.textDocument;
4650
var position = params.position;
4751

pkg/analysis_server/lib/src/protocol_server.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// Many functions here are mostly camelcase, with an occasional underscore to
6+
// separate phrases.
7+
// ignore_for_file: non_constant_identifier_names
8+
59
import 'package:analysis_server/plugin/protocol/protocol_dart.dart';
610
import 'package:analysis_server/protocol/protocol_generated.dart';
711
import 'package:analysis_server/src/computer/computer_color.dart';

pkg/analysis_server/lib/src/services/completion/dart/identifier_helper.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class IdentifierHelper {
6060
return;
6161
}
6262
for (var childElement in state.libraryElement.children2) {
63-
if (childElement.name3 == candidateName) {
64-
// Don't suggest a name that's already declared in the library.
65-
return;
63+
if (childElement.name3 == candidateName) {
64+
// Don't suggest a name that's already declared in the library.
65+
return;
6666
}
6767
}
6868
var matcherScore = state.matcher.score(candidateName);

pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// Many functions here are mostly camelcase, with an occasional underscore to
6+
// separate phrases.
7+
// ignore_for_file: non_constant_identifier_names
8+
59
import 'dart:math';
610

711
import 'package:analysis_server/src/protocol_server.dart' hide Element;
@@ -129,7 +133,7 @@ class StatementCompletionKind {
129133

130134
/// The computer for Dart statement completions.
131135
class StatementCompletionProcessor {
132-
static final NO_COMPLETION = StatementCompletion(
136+
static final _noCompletion = StatementCompletion(
133137
DartStatementCompletion.NO_COMPLETION,
134138
SourceChange('', edits: []),
135139
);
@@ -167,13 +171,13 @@ class StatementCompletionProcessor {
167171
Future<StatementCompletion> compute() async {
168172
var node = _selectedNode();
169173
if (node == null) {
170-
return NO_COMPLETION;
174+
return _noCompletion;
171175
}
172176
node = node.thisOrAncestorMatching(
173177
(n) => n is Statement || _isNonStatementDeclaration(n),
174178
);
175179
if (node == null) {
176-
return _complete_simpleEnter() ? completion! : NO_COMPLETION;
180+
return _complete_simpleEnter() ? completion! : _noCompletion;
177181
}
178182
if (node is Block) {
179183
if (node.statements.isNotEmpty) {
@@ -227,7 +231,7 @@ class StatementCompletionProcessor {
227231
if (_complete_simpleEnter()) {
228232
return completion!;
229233
}
230-
return NO_COMPLETION;
234+
return _noCompletion;
231235
}
232236

233237
void _addInsertEdit(int offset, String text) {

0 commit comments

Comments
 (0)