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
@bwilkerson for code generated by the server (for ex. snippets), should super parameters be used whenever supported, or only if the lint is also enabled?
I think it's reasonable for snippets to make use of any valid language feature that makes the generated code better.
I think that it's reasonable to not produce some style of code when there's a lint that prohibits it (that is, to allow lints to reduce the set of valid language features), but I don't think we want to require users to "enable" new language features before we start producing them in generated code. Or, at least, we don't want to require them to enable it again; they already had to opt in once by increasing the minimum SDK version.
It will only work for server-provided snippets, which are currently something you can turn on if on Flutter master using the dart.enableServerSnippets setting but will automatically be enabled when your SDK supports them in an upcoming release of the VS Code extension.
Reacted by Michael Goderbauer and Kristen McWilliam
@eseidelGoogle those snippets shipped in the extension cannot adopt to language versions, so updating them will result in errors for anyone on the current stable SDKs (which don't support super params). Those snippets are being phased out - newer Dart/Flutter SDKs (not the current stable version, but future versions) will get their snippets from the server, which can adopt to language versions (and lints).
We'll automatically switch to the server snippets when they're available (any version of Dart >= 2.17.0-258), so if you're using master you should already see super params in the snippets. If you're on stable, it'll happen automatically after the next stable release.
Those local snippets will likely be removed some time in the future when we drop support for old SDK versions (there's no planned timeline, but ultimately we'll require versions of the SDK that support LSP and DAP, and you'll need to use an older VS Code extension version if you really need to stick on a very old Dart/Flutter version), but in the meantime they will be left as-is (to be as compatible as possible).
On Mon, May 2, 2022 at 10:50 AM Danny Tuppeny ***@***.***> wrote:
@eseidelGoogle <https://github.com/eseidelGoogle> those snippets shipped
in the extension cannot adopt to language versions, so updating them will
result in errors for anyone on the current stable SDKs (which don't support
super params). Those snippets are being phased out - newer Dart/Flutter
SDKs (not the current stable version, but future versions) will get their
snippets from the server, which can adopt to language versions (and lints).
We'll automatically switch to the server snippets when they're available (any
version of Dart >= 2.17.0-258
<https://github.com/Dart-Code/Dart-Code/blob/master/src/shared/capabilities/dart.ts#L36>),
so if you're using master you should already see super params in the
snippets. If you're on stable, it'll happen automatically after the next
stable release.
Those local snippets will likely be removed some time in the future when
we drop support for old SDK versions (there's no planned timeline, but
ultimately we'll require versions of the SDK that support LSP and DAP, and
you'll need to use an older VS Code extension version if you really need to
stick on a very old Dart/Flutter version), but in the meantime they will be
left as-is (to be as compatible as possible).
(lmk if anything isn't clear!)
—
Reply to this email directly, view it on GitHub
<#3899 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2O7C2GKEV7C6FREWO2DJLVIAIVLANCNFSM5SHZM2UQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
Activity
DanTup commentedon Apr 1, 2022
@bwilkerson for code generated by the server (for ex. snippets), should super parameters be used whenever supported, or only if the lint is also enabled?
bwilkerson commentedon Apr 1, 2022
I think it's reasonable for snippets to make use of any valid language feature that makes the generated code better.
I think that it's reasonable to not produce some style of code when there's a lint that prohibits it (that is, to allow lints to reduce the set of valid language features), but I don't think we want to require users to "enable" new language features before we start producing them in generated code. Or, at least, we don't want to require them to enable it again; they already had to opt in once by increasing the minimum SDK version.
goderbauer commentedon Apr 1, 2022
+1 I think if the package has a lower SDK bound of at least 2.17.0-0 (indicating that super params are supported) the macros should use them.
DanTup commentedon Apr 5, 2022
Working on a change at https://dart-review.googlesource.com/c/sdk/+/240281/.
It will only work for server-provided snippets, which are currently something you can turn on if on Flutter
masterusing thedart.enableServerSnippetssetting but will automatically be enabled when your SDK supports them in an upcoming release of the VS Code extension.[analysis_server] Use super parameters in Flutter widget snippets
DanTup commentedon Apr 6, 2022
Landed in dart-lang/sdk@fa024be.
eseidelGoogle commentedon May 2, 2022
Re: snippets, do https://github.com/Dart-Code/Dart-Code/blob/master/snippets/flutter.json also need to change?
DanTup commentedon May 2, 2022
@eseidelGoogle those snippets shipped in the extension cannot adopt to language versions, so updating them will result in errors for anyone on the current stable SDKs (which don't support super params). Those snippets are being phased out - newer Dart/Flutter SDKs (not the current stable version, but future versions) will get their snippets from the server, which can adopt to language versions (and lints).
We'll automatically switch to the server snippets when they're available (any version of Dart >= 2.17.0-258), so if you're using
masteryou should already see super params in the snippets. If you're onstable, it'll happen automatically after the next stable release.Those local snippets will likely be removed some time in the future when we drop support for old SDK versions (there's no planned timeline, but ultimately we'll require versions of the SDK that support LSP and DAP, and you'll need to use an older VS Code extension version if you really need to stick on a very old Dart/Flutter version), but in the meantime they will be left as-is (to be as compatible as possible).
(lmk if anything isn't clear!)
eseidelGoogle commentedon May 2, 2022