Skip to content

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

Closed

Description

@nicolasmol

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 ?

Activity

  1. DanTup commented on May 23, 2022

    @DanTup
    Member

    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.

  2. added this to the Requires SDK Release milestone on Dec 5, 2022
  3. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    and removed on Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions