Skip to content

When extract locale variable, can't name with same name of parameter #4787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lsaudon opened this issue Oct 11, 2023 · 1 comment
Closed
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@lsaudon
Copy link

lsaudon commented Oct 11, 2023

Describe the bug
When extract locale variable, can't name with same name of parameter

To Reproduce
Steps to reproduce the behavior:

  1. With this code:
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(),
      ),
    );
  }
}
  1. Extract locale variable for AppBar()
  2. The variable is appBar2 or with prompt if I set appBar, I have this error The name 'appBar' is already used in the scope.

Expected behavior
I want name variable appBar

Please complete the following information:

  • Operating System and version: macOS 14.0
  • VS Code version: 1.83.0
  • Dart extension version: 3.74.0
  • Dart/Flutter SDK version: Dart 3.1.3/Fluttter 3.13.6
@lsaudon lsaudon added the is bug label Oct 11, 2023
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available labels Oct 11, 2023
@DanTup DanTup added this to the v3.76.0 milestone Oct 11, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 11, 2023
…argument names

Fixes Dart-Code/Dart-Code#4787

Change-Id: Idbd54e55599cf3cb34f504e4aad40018b70dfe78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330109
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Oct 11, 2023

Fixed by dart-lang/sdk@209483d.

The fix is in the Dart analysis server which is included in the SDK, so the fix will show up in a future SDK update rather than a Dart VS Code extension update.

@DanTup DanTup closed this as completed Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

2 participants