You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been playing around with Dart's experimental support for macros and I have followed the steps described here but I have not been able to get the augmented code to show up.
I expected the augmented code to work and show up correctly.
Screenshots
This screenshot shows that the copyWith does not exist, even tho the macro adds it and I can run that code with dart run --enable-experiment=macros example/main.dart
Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.
**!! ⚠️ PLEASE REVIEW THIS REPORT FOR SENSITIVE INFORMATION BEFORE SHARING ⚠️ !!**
<details>
<summary><strong>Workspace Environment</strong></summary>
```text
Dart Code extension: 3.88.1
Flutter extension: 3.88.0 (not activated)
App: Visual Studio Code
App Host: desktop
Version: mac 1.89.1
Workspace type: Dart (LSP)
Dart (3.5.0-160.0.dev): /Users/wolfen/development/flutter/bin/cache/dart-sdk
Flutter (undefined): /Users/wolfen/development/flutter (No device)
Output from 'dart info'
/Users/wolfen/development/flutter/bin/cache/dart-sdk/bin/dart info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
Dart 3.5.0-160.0.dev (dev) (Wed May 15 17:06:58 2024 -0700) on "macos_arm64"
fwiw I'm also seeing the same thing. I was able to see things work correctly once or twice (e.g I could see the "go to augmentation" shortcut in vscode and the analyzer wasn't complaining) but lately I'm also experiencing the same issues as @wolfenrain using the exact same Dart version.
You're hitting dart-lang/sdk#55746 which has just been fixed. Currently the analysis server isn't running macros if they're imported from a file that exports them.
If you add src/ into your import in example/main.dart to import the file containing the macro directly then things will work:
Describe the bug
I have been playing around with Dart's experimental support for macros and I have followed the steps described here but I have not been able to get the augmented code to show up.
To Reproduce
dart pub get
example/main.dart
Expected behavior
I expected the augmented code to work and show up correctly.
Screenshots
This screenshot shows that the
copyWith
does not exist, even tho the macro adds it and I can run that code withdart run --enable-experiment=macros example/main.dart
Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (
F1
) to easily capture this information or provide it manually.Output from 'dart info'
/Users/wolfen/development/flutter/bin/cache/dart-sdk/bin/dart info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
Project info
Process info
The text was updated successfully, but these errors were encountered: