{"id":19963,"date":"2023-05-10T08:38:44","date_gmt":"2023-05-10T16:38:44","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/powershell\/?p=19963"},"modified":"2023-05-10T08:39:21","modified_gmt":"2023-05-10T16:39:21","slug":"completion-predictor-version-0-1-1-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/completion-predictor-version-0-1-1-release\/","title":{"rendered":"Completion Predictor v0.1.1 Release"},"content":{"rendered":"<p><!-- markdownlint-disable MD041 --><\/p>\n<p>We&#8217;ve recently released a new version of the <strong>Completion Predictor<\/strong>! We&#8217;ve been highlighting\nthis predictor when showing off some of the new improvements in the\n<a href=\"https:\/\/devblogs.microsoft.com\/powershell\/tag\/psreadline\/\"><strong>PSReadLine 2.3.x betas<\/strong><\/a> and wanted to share some of the awesome things you can do with this\npredictor.<\/p>\n<h2>Completion Predictor v0.1.1<\/h2>\n<p>If you are unfamiliar with the Completion Predictor, this is a plugin in predictor that we released\nlast year that provides tab completion to help give prediction results. This means it can work for\nhelping fill out parameters of cmdlets and properties and methods of objects. The Version 0.1.1\nrelease contains some experience improvements and some new completion capabilities.<\/p>\n<h2>Installing Completion Predictor v0.1.1<\/h2>\n<p>First and foremost, how can you get this predictor? The release is available from the\n<a href=\"https:\/\/www.powershellgallery.com\/packages\/CompletionPredictor\/0.1.0\">PowerShell Gallery<\/a>.<\/p>\n<p>Use the following command to install <strong>CompletionPredictor<\/strong> using <strong>PowerShellGet<\/strong> v2.x:<\/p>\n<pre><code class=\"language-powershell\">Install-Module -Name CompletionPredictor<\/code><\/pre>\n<p>If you are using <strong>PowerShellGet<\/strong> v3, you can use the following command:<\/p>\n<pre><code class=\"language-powershell\">Install-PSResource -Name CompletionPredictor<\/code><\/pre>\n<h2>Argument Completion Improvements<\/h2>\n<h3>cd and dir<\/h3>\n<p>Using tab completion we&#8217;re able to give predictions on the next folders you may want to navigate to\nwith <code>cd<\/code> or view the contents of with <code>dir<\/code>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2023\/05\/cddirCompletionPredictor.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-19968\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2023\/05\/cddirCompletionPredictor.gif\" alt=\"Screenshot showing cd and dir argument completion.\" width=\"2208\" height=\"1118\" \/><\/a><\/p>\n<h3>git<\/h3>\n<p>Another argument completion improvement was with <code>git<\/code>. These are improvements that we&#8217;ve found\nworks best for our workflow but may help with your <code>git<\/code> workflow as well!<\/p>\n<h4>Merging branches<\/h4>\n<p>Completion Predictor is able to look at remote and local branches available to accelerate your flow\nwhen using <code>git merge<\/code>. Here is an example of it working.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2023\/05\/git-merge.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-19970\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2023\/05\/git-merge.gif\" alt=\"Screenshot showing git merge prediction completion.\" width=\"818\" height=\"595\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h4>Checking out and deleting branches<\/h4>\n<p>Similarly, to the merge behavior, the completion predictor is now able to give predictions on what\nbranch you may want to use when checking out or deleting branches. This only works with the\nsubcommands <code>git checkout<\/code> and <code>git branch -D<\/code>. The predictor intentionally doesn&#8217;t include the\ncurrent branch you are in when giving results.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2023\/05\/gitcheckoutbranch.gif\"><img decoding=\"async\" class=\"alignnone wp-image-19969 size-full\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2023\/05\/gitcheckoutbranch.gif\" alt=\"Screenshot showing git branch -D prediction completion.\" width=\"1375\" height=\"758\" \/><\/a><\/p>\n<p>As I mentioned, we added these improvements to help with our specific <code>git<\/code> workflows. Typically, the\nrough flow we&#8217;ve is the following:<\/p>\n<ul>\n<li><code>git fetch --all -p<\/code> -&gt; to get the latest changes in that repo<\/li>\n<li><code>git merge<\/code> -&gt; sync the default branch<\/li>\n<li><code>git branch -D<\/code> -&gt; delete the old working branches that were already removed from the remote side<\/li>\n<li><code>git checkout<\/code> -&gt; checkout a new branch to work in<\/li>\n<li><code>git push<\/code> -&gt; push the new branch to remote to then create a PR<\/li>\n<\/ul>\n<p>This isn&#8217;t a blog post about how to best use <code>git<\/code>, so please refer to other online resources to\nlearn <code>git<\/code>. This is just the workflow we like to use that helped us create the <code>git<\/code> improvements\nto the Completion Predictor.<\/p>\n<h2>Feedback<\/h2>\n<p>You can find the rest of the changes in this release in the <a href=\"https:\/\/github.com\/PowerShell\/CompletionPredictor\/releases\/tag\/v0.1.1\">changelog<\/a> on the release page. We\nlove getting feedback on these predictors we make! The entire source code for this predictor is\navailable on <a href=\"https:\/\/github.com\/PowerShell\/CompletionPredictor\/\">GitHub<\/a> and can be a great starting point for making your own predictor! Please\nfeel free to open issues or PRs on the GitHub page for improvements that may work for you and\nothers! Enjoy!<\/p>\n<p>Steven Bucher and Dongbo Wang<\/p>\n<p>Completion Predictor and PSReadLine Maintainers<\/p>\n<p><!-- Link references --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We released a new version of the CompletionPredictor! This blog post highlights some of the new functionalities of it.<\/p>\n","protected":false},"author":98569,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3188,3168],"class_list":["post-19963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-predictors","tag-psreadline"],"acf":[],"blog_post_summary":"<p>We released a new version of the CompletionPredictor! This blog post highlights some of the new functionalities of it.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/98569"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=19963"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=19963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=19963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=19963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}