Skip to content

Stf/Stl Snippets now using /src/foundation/key.dart' & '/src/widgets/framework.dart' ? #3988

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
nicolasmol opened this issue May 23, 2022 · 1 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
Milestone

Comments

@nicolasmol
Copy link

Hi everyone.
It's hard for me to undestand it I made something wrong or if its coincidently occurs after upgradiing flutter.
But suddenlly, using snippetts "stl" or "stf' have changed and don't use anymore "import 'package:flutter/material.dart;" but theses instead
image

Obiously I paid attention to disable as many Vscode extension as possible to ensure that none interfers...
Does anyome have an idea if I messed up somewhere ?

@DanTup
Copy link
Member

DanTup commented May 23, 2022

You didn't mess up, and this did indeed start with the Flutter upgrade. Snippets are moving from the VS Code extension to the language server, and Flutter 3.0 was the first version that included them. The reason for this is to allow the snippets to adapt to language versions and new features (previously the snippet could not conditionally insert ? for nullable fields depending on your language version, nor user super initializers, because it was fixed for all versions).

The server snippets automatically add imports for new types that are referenced (the old snippets did not add imports), but unfortunately it references their source files directly. If you already have imports in the file, it should leave them off, but in a new file it's causing this problem.

There's an issue open tracking this at dart-lang/sdk#49081. I'll close this one in favour of that.

@DanTup DanTup added upstream in dart / flutter Needs changing in Dart or Flutter and removed is bug labels May 23, 2022
@DanTup DanTup closed this as completed May 23, 2022
@DanTup DanTup added this to the Requires SDK Release milestone Dec 5, 2022
@DanTup DanTup added is bug 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 and removed upstream in dart / flutter Needs changing in Dart or Flutter labels Dec 5, 2022
@DanTup DanTup modified the milestones: v3.58.0, Requires SDK Release Dec 18, 2022
@DanTup DanTup modified the milestones: Requires SDK Release, v3.64.0 May 2, 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