Skip to content
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

Add placeholder code for required parameters #2123

Closed
jagdishjadeja opened this issue Nov 23, 2019 · 12 comments
Closed

Add placeholder code for required parameters #2123

jagdishjadeja opened this issue Nov 23, 2019 · 12 comments
Labels
in editor Relates to code editing or language features is enhancement
Milestone

Comments

@jagdishjadeja
Copy link

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

@DanTup
Copy link
Member

DanTup commented Nov 27, 2019

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).

@jagdishjadeja
Copy link
Author

so when it is coming ?

@DanTup
Copy link
Member

DanTup commented Nov 28, 2019

@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!

@jagdishjadeja
Copy link
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()

@DanTup
Copy link
Member

DanTup commented Nov 28, 2019

@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) :-)

@jagdishjadeja
Copy link
Author

not sure then whats thats usage

@DanTup
Copy link
Member

DanTup commented Nov 28, 2019

@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).

@jagdishjadeja
Copy link
Author

jagdishjadeja commented Nov 28, 2019

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

@DanTup
Copy link
Member

DanTup commented Nov 28, 2019

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!) 😞

@jagdishjadeja
Copy link
Author

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

@DanTup
Copy link
Member

DanTup commented Nov 28, 2019

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).

@jagdishjadeja
Copy link
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
Labels
in editor Relates to code editing or language features is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants