Skip to content

Commit

Permalink
Version 3.5.0-320.0.dev
Browse files Browse the repository at this point in the history
Merge 29d2913 into dev
  • Loading branch information
Dart CI committed Jul 1, 2024
2 parents 338c6d4 + 29d2913 commit 21c0874
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,13 @@ class InScopeCompletionPass extends SimpleAstVisitor<void> {

@override
void visitMethodInvocation(MethodInvocation node) {
var beginToken = node.beginToken;
if (offset <= beginToken.end && beginToken.isKeywordOrIdentifier) {
// The user is completing at the beginning of the expression, so let the
// parent node determine the right set of suggestions.
node.parent?.accept(this);
return;
}
var operator = node.operator;
if (operator == null) {
if (node.coversOffset(offset)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,37 @@ suggestions
''');
}

Future<void> test_afterComma_beforeMethodInvocation() async {
allowedIdentifiers = {'random'};
await computeSuggestions('''
class OC {
OC(int a, double b);
}
void f(int n) {
var random = Random();
var list = List<OC>.generate(n, (i) => OC(i, ^random.nextInt(n)));
}
''');

assertResponse(r'''
replacement
right: 6
suggestions
random
kind: localVariable
null
kind: keyword
false
kind: keyword
true
kind: keyword
const
kind: keyword
switch
kind: keyword
''');
}

Future<void> test_afterInt_beforeRightParen() async {
await computeSuggestions('''
void f() { print(42^); }
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 319
PRERELEASE 320
PRERELEASE_PATCH 0

0 comments on commit 21c0874

Please sign in to comment.