Skip to content

Add placeholder code for required parameters #2123

Closed

Description

@jagdishjadeja

can we add @required code when user types a widget like icon property for IconButton
or add whole Builder function placeholder code for widgets like FutureBuilder or ListView.Builder ?
inserting @required parameters code will make life easier

Activity

  1. added this to the v3.7.0 milestone on Nov 27, 2019
  2. added
    in editorRelates to code editing or language features
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Nov 27, 2019
  3. added a commit that references this issue on Nov 27, 2019
    a6e6845
  4. DanTup commented on Nov 27, 2019

    @DanTup
    Member

    Because there are some behaviour changes, this feature will initially ship behind a flag (dart.previewNewCompletionPlaceholders) for the next release. It'll probably become default in the following release. Please try it out and let me know how it works for you (I'll be producing a beta build later today or tomorrow).

  5. jagdishjadeja commented on Nov 27, 2019

    @jagdishjadeja
    Author

    so when it is coming ?

  6. DanTup commented on Nov 28, 2019

    @DanTup
    Member

    @jagdishjadeja there's a beta build here:

    https://github.com/Dart-Code/Dart-Code/releases/tag/v3.7.0-beta.1

    You'll need to set "dart.previewNewCompletionPlaceholders": true in your settings to get the new behaviour. If you try it out, let me know how it goes!

  7. jagdishjadeja commented on Nov 28, 2019

    @jagdishjadeja
    Author

    @DanTup got errors

    28-11-2019 22:01:43 - Microsoft VSIX Installer
    28-11-2019 22:01:43 - -------------------------------------------
    28-11-2019 22:01:43 - vsixinstaller.exe version:
    28-11-2019 22:01:43 - 16.3.2099
    28-11-2019 22:01:43 - -------------------------------------------
    28-11-2019 22:01:43 - Command line parameters:
    28-11-2019 22:01:43 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\DROGON\Downloads\dart-code-3.7.0-beta.1.vsix
    28-11-2019 22:01:43 - -------------------------------------------
    28-11-2019 22:01:43 - Microsoft VSIX Installer
    28-11-2019 22:01:43 - -------------------------------------------
    28-11-2019 22:01:44 - Found setup instance 9f7728f8 but not in launchable state.
    28-11-2019 22:01:44 - Initializing Install...
    28-11-2019 22:01:45 - Microsoft.VisualStudio.ExtensionManager.InvalidExtensionManifestException: Element 'Identity' has invalid value for attribute 'Version' ---> System.FormatException: Input string was not in a correct format.
       at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
       at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent)
       at System.Version.TryParseVersion(String version, VersionResult& result)
       at System.Version.Parse(String input)
       at System.Version..ctor(String version)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.<>c.<ExtractManifestData>b__67_1(String s)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.VerifyStringValue[T](String value, ErrorInfo info, Func`2 selector, Boolean isRequired, Int32 maxLength, T defaultValue)
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
       --- End of inner exception stack trace ---
       at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.VerifyStringValue[T](String value, ErrorInfo info, Func`2 selector, Boolean isRequired, Int32 maxLength, T defaultValue)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ExtractManifestData(PackageManifest manifest)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ReadPackageManifest(XmlReader reader)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionImpl.ReadManifest(Stream manifestStream)
       at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl.ReadVSIXManifestFromPackage(Stream stream, CultureInfo preferredCulture)
       at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl..ctor(String path, CultureInfo preferredCulture)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath, CultureInfo preferredCulture)
       at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath)
       at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
       at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
       at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
       at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
       at VSIXInstaller.App.Initialize()
       at System.Threading.Tasks.Task`1.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()
    
    
  8. DanTup commented on Nov 28, 2019

    @DanTup
    Member

    @jagdishjadeja you can't just double-click on the vsix - that'll try to open it in Visual Studio (proper). I don't know why they made it this way, but they did :)

    On the link above there are some instructions for installing (and there are more detailed instructions here) :-)

  9. jagdishjadeja commented on Nov 28, 2019

    @jagdishjadeja
    Author

    not sure then whats thats usage

  10. DanTup commented on Nov 28, 2019

    @DanTup
    Member

    @jagdishjadeja I'm not sure I understand. There are instructions here for how to install the VSIX (you run the Extension: Install from VSIX command in VS Code, and then browse for the vsix file).

  11. jagdishjadeja commented on Nov 28, 2019

    @jagdishjadeja
    Author

    I have got it I was just wondering why they made extensions that way

  12. DanTup commented on Nov 28, 2019

    @DanTup
    Member

    I don't know - I guess it seemed like a convenient file format to use. Maybe in a future Visual Studio update it will learn what VS Code extensions look like and automatically delegate to VS Code (similar to how its version switcher works), I don't know. It's definitely annoying though - seems like everyone tries to install by double-clicking the first time (I did!) 😞

  13. jagdishjadeja commented on Nov 28, 2019

    @jagdishjadeja
    Author

    Can I get some instructions on how to use this feature?
    I have added "dart.previewNewCompletionPlaceholders": true,
    but feels like same things

  14. DanTup commented on Nov 28, 2019

    @DanTup
    Member

    Did you click the Reload button after installing the extension? If you click Extensions on the side bar, do you see the 3.7.0-beta version?

    If it's working, you should get placeholders for @required arguments (see screenshots in the release notes at https://dartcode.org/releases/v3-7/#preview-placeholders-for-required-arguments).

  15. jagdishjadeja commented on Nov 28, 2019

    @jagdishjadeja
    Author

    yes working checking out new feature

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 featuresis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions