Skip to content

Commit

Permalink
Version 3.5.0-224.0.dev
Browse files Browse the repository at this point in the history
Merge 476c404 into dev
  • Loading branch information
Dart CI committed Jun 5, 2024
2 parents dac7c04 + 476c404 commit 54fce96
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 49 deletions.
89 changes: 58 additions & 31 deletions pkg/analysis_server/doc/process/new_language_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,68 @@ Separate issues should be created for each of the items in the list.
The following is a list of the individual features that need to be considered.
The features are listed in alphabetical order.

- [ ] Call Hierarchy
- [ ] Closing Labels
- [ ] Call Hierarchy (an IDE feature where you can get a call hierarchy if you
click on a method)
- [ ] Closing Labels (an LSP feature allowing the IDE to show lightly grayed out
comments at the end of the last line of a multi-line invocation, to aid
the user in understanding what invocation is closed by a `)`)
- [ ] Code Completion
- [ ] Code Folding
- [ ] Document Symbols
- [ ] Document Colors
- [ ] Flutter Outline
- [ ] Document Colors (an LSP feature whereby a reference to a color in code can
be associated with a colored swatch and a color picker)
- [ ] Hovers
- [ ] Implemented Markers
- [ ] Inlay Hints
- [ ] Navigation - legacy
- [ ] Navigation - LSP Go to Definition
- [ ] Navigation - LSP Go to Type Definition
- [ ] Navigation - Go to Super
- [ ] Occurrences - legacy
- [ ] Occurrences - LSP Document Highlights
- Implemented/override markers (a legacy protocol feature, only available to
IntelliJ and Android Studio)
- [ ] Implemented Markers (allows navigation from a base class method to
methods that override it, or from a base class to classes that
extend/implement it)
- [ ] Override Markers (allows navigation from a method to the base class
method it overrides, or from a class to the class that it
extends/implements)
- [ ] Inlay Hints (an LSP feature allowing extra information to be displayed
using inline hints)
- Navigation
- [ ] Go to Definition (LSP feature)
- [ ] Go to Type Definition (LSP feature)
- [ ] Go to Super (LSP feature)
- [ ] Legacy protocol (for IntelliJ and Android Studio)
- Occurrences
- [ ] Legacy protocol (for IntelliJ and Android Studio)
- [ ] Document Highlights (LSP feature)
- [ ] Organize Imports
- [ ] Outline
- [ ] Overrides Markers
- [ ] Quick Assists
- [ ] Quick Fixes
- [ ] Refactorings - legacy
- [ ] Refactorings - self describing
- [ ] Search - Find References
- [ ] Search - Implementations - LSP
- [ ] Search - Member Declarations
- [ ] Search - Member References
- [ ] Search - Top-level Declarations
- [ ] Selection Range
- Outline
- [ ] Flutter Outline
- [ ] Legacy protocol, a.k.a. Document Symbols (for IntelliJ and Android
Studio)
- [ ] LSP feature
- Refactorings and quick assists/fixes (note that in addition to potentially
creating new refactorings and/or quick assists/fixes, part of the work
required to implement a new language feature includes evaluating each existing
refactoring and quick fix/assist to see whether it needs to be improved or
have test cases added to reflect the new feature).
- [ ] Legacy refactorings (for IntelliJ and Android Studio)
- [ ] LSP rename refactoring (note that LSP has a special protocol for
renames)
- [ ] LSP self-describing refactorings
- [ ] Quick Assists
- [ ] Quick Fixes
- Search
- [ ] Find References
- [ ] Implementations - LSP
- [ ] Member Declarations
- [ ] Member References
- [ ] Top-level Declarations
- [ ] Selection Range (an LSP feature allowing a selection to be expanded to
cover the range of an ancestor AST node)
- Syntax Highlighting
- [ ] Semantic Highlights
- [ ] LSP Semantic Tokens
- [ ] Signature Help
- [ ] Legacy protocol, a.k.a. Semantic Highlights (for IntelliJ and Android
Studio)
- [ ] Semantic Tokens (LSP feature)
- [ ] Signature Help (an LSP feature that tells the parameters and types needed
for an invocation)
- [ ] Snippets
- [ ] Sort Members
- [ ] Type Hierarchy - legacy
- [ ] Type Hierarchy - LSP
- [ ] Workspace Symbols
- Type Hierarchy
- [ ] Legacy protocol (for IntelliJ and Android Studio)
- [ ] LSP feature
- [ ] Workspace Symbols (LSP feature)
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#
# Stats:
# - 42 "needsEvaluation"
# - 346 "needsFix"
# - 405 "hasFix"
# - 345 "needsFix"
# - 406 "hasFix"
# - 516 "noFix"

AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
Expand Down Expand Up @@ -2590,9 +2590,7 @@ ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY:
ParserErrorCode.CONST_FACTORY:
status: hasFix
ParserErrorCode.CONST_METHOD:
status: needsFix
notes: |-
Remove the `const` keyword.
status: hasFix
ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE:
status: needsFix
notes: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
ParserErrorCode.CONST_FACTORY: [
RemoveConst.new,
],
ParserErrorCode.CONST_METHOD: [
RemoveConst.new,
],
ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION: [
ReplaceWithWildcard.new,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ mixin class A {}
''');
}

Future<void> test_constMethod() async {
await resolveTestCode('''
const void m() {}
''');
await assertHasFix('''
void m() {}
''');
}

Future<void> test_covariantTopLevelDeclaration_class() async {
await resolveTestCode(r'''
covariant class C {}
Expand Down
4 changes: 2 additions & 2 deletions pkg/analyzer/tool/messages/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ class _SyntacticErrorGenerator {
}

// Print the # of autogenerated ParserErrorCodes.
print('${cfeToAnalyzerErrorCodeTables.infoToAnalyzerCode.length} of '
'${messageToName.length} ParserErrorCodes generated.');
print('${messageToName.length} of '
'${cfeToAnalyzerErrorCodeTables.infoToAnalyzerCode.length} ParserErrorCodes generated.');

// List the ParserErrorCodes that could easily be auto generated
// but have not been already.
Expand Down
33 changes: 27 additions & 6 deletions pkg/front_end/test/coverage_suite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,12 @@ Future<void> _run(Directory coverageTmpDir, List<String> arguments) async {
}));
}

if (options.verbose) {
if (options.verbose || log != null) {
String result = pass ? "PASS" : "FAIL";
print("${testName}: ${result}");
if (log != null) {
print(" ${log.replaceAll('\n', '\n ')}");
}
}
}

Expand All @@ -393,6 +396,7 @@ Future<void> _run(Directory coverageTmpDir, List<String> arguments) async {
// TODO(jensj): More info here would be good.
addResult(coverageEntry.key.toString(), false, log: "Error");
} else {
StringBuffer sb = new StringBuffer();
int hitCount = coverageEntry.value.hitCount;
int missCount = coverageEntry.value.missCount;
double percent = (hitCount / (hitCount + missCount) * 100);
Expand All @@ -402,13 +406,24 @@ Future<void> _run(Directory coverageTmpDir, List<String> arguments) async {
int requireAtLeast =
(_expect[coverageEntry.key.toString()] ?? 0.0).floor();
bool pass = percent >= requireAtLeast;
String? log;
if (!pass) {
log = "${coverageEntry.value.visualization}\n\n"
"Expected at least $requireAtLeast%, got $percent% "
"($hitCount hits and $missCount misses).";
sb.write("${coverageEntry.value.visualization}");
sb.write("\n\nExpected at least $requireAtLeast%, got $percent% "
"($hitCount hits and $missCount misses).");
sb.write("\n\nTo re-run this test, run:");
var extraFlags = _assertsEnabled ? ' --enable-asserts' : '';
// It looks like coverage results vary slightly based on the number of
// tasks, so include a `--tasks=` argument in the repro instructions.
//
// TODO(paulberry): why do coverage results vary based on the number of
// tasks? (Note: possibly due to
// https://github.com/dart-lang/sdk/issues/42061)
sb.write(
"\n\n dart$extraFlags pkg/front_end/test/coverage_suite.dart "
"--tasks=${options.numberOfWorkers}");
}
addResult(coverageEntry.key.toString(), pass, log: log);
addResult(coverageEntry.key.toString(), pass,
log: sb.isEmpty ? null : sb.toString());
}
}

Expand Down Expand Up @@ -507,3 +522,9 @@ class Options {
);
}
}

final bool _assertsEnabled = () {
bool assertsEnabled = false;
assert(assertsEnabled = true);
return assertsEnabled;
}();
7 changes: 5 additions & 2 deletions runtime/vm/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -6070,8 +6070,6 @@ class PcDescriptors : public Object {
// Verify (assert) assumptions about pc descriptors in debug mode.
void Verify(const Function& function) const;

static void PrintHeaderString();

void PrintToJSONObject(JSONObject* jsobj, bool ref) const;

// We would have a VisitPointers function here to traverse the
Expand Down Expand Up @@ -10842,22 +10840,27 @@ class Array : public Instance {

template <std::memory_order order = std::memory_order_relaxed>
ObjectPtr At(intptr_t index) const {
ASSERT((0 <= index) && (index < Length()));
return untag()->element<order>(index);
}
template <std::memory_order order = std::memory_order_relaxed>
void SetAt(intptr_t index, const Object& value) const {
ASSERT((0 <= index) && (index < Length()));
untag()->set_element<order>(index, value.ptr());
}
template <std::memory_order order = std::memory_order_relaxed>
void SetAt(intptr_t index, const Object& value, Thread* thread) const {
ASSERT((0 <= index) && (index < Length()));
untag()->set_element<order>(index, value.ptr(), thread);
}

// Access to the array with acquire release semantics.
ObjectPtr AtAcquire(intptr_t index) const {
ASSERT((0 <= index) && (index < Length()));
return untag()->element<std::memory_order_acquire>(index);
}
void SetAtRelease(intptr_t index, const Object& value) const {
ASSERT((0 <= index) && (index < Length()));
untag()->set_element<std::memory_order_release>(index, value.ptr());
}

Expand Down
4 changes: 4 additions & 0 deletions third_party/pkg/dap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.0

- Add `showToUser` field to `DebugAdapterException` to specify which errors should be shown to users.

## 1.2.0

- Added `DartInitializeRequestArguments`, a subclass of `InitializeRequestArguments` that supports a custom flag `supportsDartUris` for informing the debug adapter that the client supports using URIs in places that might usually be file paths (such as `stackTraceRequest`). Setting this flag indicates that the client supports `file:` URIs _and also_ any custom-scheme URIs whose content can be provided by the analysis server from the matching Dart SDK.
Expand Down
9 changes: 8 additions & 1 deletion third_party/pkg/dap/lib/src/exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
class DebugAdapterException implements Exception {
final String message;

DebugAdapterException(this.message);
/// Whether or not to show the error to the user as a notification.
final bool showToUser;

DebugAdapterException(this.message, {this.showToUser = false});

@override
String toString() => 'DebugAdapterException: $message';
Expand Down Expand Up @@ -37,12 +40,16 @@ class DebugAdapterInvalidArgumentException implements DebugAdapterException {
final Type actualType;
final Object? actualValue;

@override
final bool showToUser;

DebugAdapterInvalidArgumentException({
required this.requestName,
required this.argumentName,
required this.expectedType,
required this.actualType,
required this.actualValue,
this.showToUser = false,
});

@override
Expand Down
2 changes: 1 addition & 1 deletion third_party/pkg/dap/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dap
version: 1.2.0
version: 1.3.0
description: >-
A package of classes that are generated from the DAP specifications along with
their generating code.
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 5
PATCH 0
PRERELEASE 223
PRERELEASE 224
PRERELEASE_PATCH 0

0 comments on commit 54fce96

Please sign in to comment.