<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GitHub Copilot &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/github-copilot/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Tue, 05 Sep 2023 16:33:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>GitHub Copilot &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>GitHub Copilot: 10+ Ways to Increase Productivity</title>
		<link>https://myshittycode.com/2023/09/02/github-copilot-10-plus-ways-to-increase-productivity/</link>
					<comments>https://myshittycode.com/2023/09/02/github-copilot-10-plus-ways-to-increase-productivity/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Sat, 02 Sep 2023 16:08:18 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Development Tools]]></category>
		<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[GitHub Copilot]]></category>
		<category><![CDATA[VS Code]]></category>
		<guid isPermaLink="false">https://myshittycode.com/?p=2432</guid>

					<description><![CDATA[<p>What is GitHub Copilot GitHub Copilot is dubbed &#8220;an AI pair programmer&#8221; to help us write code faster, using a generative AI model developed through a collaboration between GitHub, OpenAI, and Microsoft Azure AI. These days, there are nothing short of AI-powered tools that can do similar things in this space. For example, Tabnine, Google&#8217;s [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2023/09/02/github-copilot-10-plus-ways-to-increase-productivity/">GitHub Copilot: 10+ Ways to Increase Productivity</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#what-is-git-hub-copilot">What is GitHub Copilot</a></li><li><a href="#prerequisites">Prerequisites</a></li><li><a href="#tips-tricks">Tips &amp; Tricks</a><ul><li><a href="#type-descriptive-code">Type Descriptive Code</a></li><li><a href="#type-comments-first">Type Comments First</a></li><li><a href="#view-multiple-suggestions">View Multiple Suggestions</a></li><li><a href="#generate-test-cases">Generate Test Cases</a></li><li><a href="#internationalization">Internationalization</a></li><li><a href="#generate-realistic-test-data">Generate Realistic Test Data</a></li><li><a href="#learn-id-es-shortcut-keys">Learn IDE&#8217;s Shortcut Keys</a></li><li><a href="#converse-with-q-and-a">Converse with &#8220;q: &#8221; and &#8220;a: &#8221; </a></li><li><a href="#fix-bug">Fix Bug</a></li><li><a href="#list-steps">List Steps</a></li><li><a href="#explain-code">Explain Code</a></li><li><a href="#translate-codebase-to-another-programming-language">Translate Codebase to Another Programming Language</a></li></ul></li><li><a href="#copilot-labs-settings">Copilot Labs Settings</a><ul><li><a href="#show-brushes-lenses">Show Brushes Lenses</a></li><li><a href="#show-test-generation-lenses">Show Test Generation Lenses</a></li></ul></li><li><a href="#what-else">What Else</a></li></ul></nav></div>



<h2 class="wp-block-heading" id="what-is-git-hub-copilot">What is GitHub Copilot</h2>



<p>GitHub Copilot is dubbed &#8220;an AI pair programmer&#8221; to help us write code faster, using a generative AI model developed through a collaboration between GitHub, OpenAI, and Microsoft Azure AI.</p>



<p>These days, there are nothing short of AI-powered tools that can do similar things in this space. For example, <a href="https://www.tabnine.com/" target="_blank" rel="noopener">Tabnine</a>, <a href="https://cloud.google.com/blog/products/application-development/introducing-duet-ai-for-developers" target="_blank" rel="noopener">Google&#8217;s Duet AI</a>, <a href="https://arxiv.org/abs/2305.12050" target="_blank" rel="noopener">Meta&#8217;s CodeCompose</a> (currently used internally at Meta), and <a href="https://about.fb.com/news/2023/08/code-llama-ai-for-coding/#:~:text=Code%20Llama%20is%20a%20code,Llama%20features%20enhanced%20coding%20capabilities." target="_blank" rel="noopener">Code Llama</a>.</p>



<h2 class="wp-block-heading" id="prerequisites">Prerequisites</h2>



<p>You need to <a href="https://github.com/features/copilot#pricing" target="_blank" rel="noopener">obtain a paid license</a> before you can use GitHub Copilot.</p>



<p>Then, install the <strong>GitHub Copilot</strong> extension in your favorite IDE. In this post, I&#8217;m using VS Code because GitHub also created <strong>the GitHub Copilot Labs</strong> extension that is not available in JetBrains IDEs (e.g., IntelliJ, PyCharm, etc.).</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://myshittycode.com/wp-content/uploads/2023/09/extensions.png?x45560" alt="github copilot" class="wp-image-2450" style="width:640px" width="640" srcset="https://myshittycode.com/wp-content/uploads/2023/09/extensions.png 1062w, https://myshittycode.com/wp-content/uploads/2023/09/extensions-300x101.png 300w, https://myshittycode.com/wp-content/uploads/2023/09/extensions-1024x343.png 1024w, https://myshittycode.com/wp-content/uploads/2023/09/extensions-768x257.png 768w" sizes="(max-width: 1062px) 100vw, 1062px" /></figure>



<h2 class="wp-block-heading" id="tips-tricks">Tips &amp; Tricks</h2>



<p>Below is a compilation of cool tricks you can do with GitHub Copilot using VS Code.</p>



<h3 class="wp-block-heading" id="type-descriptive-code">Type Descriptive Code</h3>



<p>The easiest way to get started is to continue with your typical coding. If you type descriptive variables or function names, GitHub Copilot can provide better code suggestions. </p>



<p>You can also cycle through the inline suggestions using <a href="https://docs.github.com/en/copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment?tool=vscode" target="_blank" rel="noopener">shortcut keys</a> in your favorite IDE.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/by-descriptive-code.gif?x45560" alt="" class="wp-image-2434"/></figure>



<h3 class="wp-block-heading" id="type-comments-first">Type Comments First</h3>



<p>The challenge of typing very descriptive variables or function names is they get very lengthy, and you risk having your favorite code format tool complaining about the line length. </p>



<p>So, it helps to write them as comments first before you write your code. You can comment above the function you want to create or even at the top of the file.</p>



<p>The most significant advantage of this approach is if your multline comments are clear and precise, it sets proper guardrails for GitHub Copilot to provide better code suggestions based on the context you define (i.e., less hallucination).</p>



<figure class="wp-block-image size-full"><img decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/by-comments.gif?x45560" alt="" class="wp-image-2433"/></figure>



<h3 class="wp-block-heading" id="view-multiple-suggestions">View Multiple Suggestions</h3>



<p>Sometimes, you want to browse all suggestions all at once. </p>



<p>In that case, identify the shortcut key listed under <strong>github.copilot.generate</strong> first.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="594" src="https://myshittycode.com/wp-content/uploads/2023/09/open-completions-panel-1024x594.png?x45560" alt="" class="wp-image-2497" srcset="https://myshittycode.com/wp-content/uploads/2023/09/open-completions-panel-1024x594.png 1024w, https://myshittycode.com/wp-content/uploads/2023/09/open-completions-panel-300x174.png 300w, https://myshittycode.com/wp-content/uploads/2023/09/open-completions-panel-768x446.png 768w, https://myshittycode.com/wp-content/uploads/2023/09/open-completions-panel-1536x891.png 1536w, https://myshittycode.com/wp-content/uploads/2023/09/open-completions-panel.png 1858w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Then, type the comment and press the shortcut key in the next new line to open up the suggestions in a new tab. You can browse the suggestions and accept the one you like.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1072" height="708" src="https://myshittycode.com/wp-content/uploads/2023/09/show-all-suggestions.gif?x45560" alt="" class="wp-image-2496"/></figure>



<h3 class="wp-block-heading" id="generate-test-cases">Generate Test Cases</h3>



<p>One of the best uses of GitHub Copilot is the ability to create test cases, especially if your function has excellent documentation. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/generate-test-single.gif?x45560" alt="" class="wp-image-2439"/></figure>



<p>Here&#8217;s another example where you want to generate multiple assertions.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/generate-test-multiple-assertions.gif?x45560" alt="" class="wp-image-2438"/></figure>



<p>Perhaps you don&#8217;t want to lump multiple assertions into one test case because if one of the assertions fails, the entire test case fails.</p>



<p>In this example, I&#8217;m using the <a href="https://docs.pytest.org/" target="_blank" rel="noopener">pytest</a> framework, which has a decorator that allows the parameterization of the test function&#8217;s argument(s). To refactor the existing test case, GitHub Copilot Labs&#8217; custom brush converts a single test case into 5 test cases.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1130" height="656" src="https://myshittycode.com/wp-content/uploads/2023/09/lab-brush-custom-parameterize-1.gif?x45560" alt="" class="wp-image-2442" style="object-fit:cover"/></figure>



<h3 class="wp-block-heading" id="internationalization">Internationalization</h3>



<p>If you are building an app that users worldwide will use and want to serve the text based on regions, you can easily convert the text to different spoken languages.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/context-recognition.gif?x45560" alt="" class="wp-image-2435"/></figure>



<p>A faster way to perform language conversion is to use GitHub Copilot Labs&#8217; custom brush to convert multiple lines simultaneously.</p>



<h3 class="wp-block-heading" id="generate-realistic-test-data"><figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1106" height="348" class="wp-image-2440" style="object-fit:cover" src="https://myshittycode.com/wp-content/uploads/2023/09/lab-brush-custom-i18n.gif?x45560" alt=""></figure>Generate Realistic Test Data</h3>



<p>Sometimes, you want to generate realistic data for your program or test cases.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/data-generation-1.gif?x45560" alt="" class="wp-image-2436"/></figure>



<p>You can also define the preferred data structure.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/data-generation-2.gif?x45560" alt="" class="wp-image-2437"/></figure>



<p>Perhaps you want to know what world leaders like to eat. As you can see, GitHub Copilot can determine the country leaders and associate the dishes relevant to that country.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/data-generation-3.gif?x45560" alt="" class="wp-image-2456"/></figure>



<h3 class="wp-block-heading" id="learn-id-es-shortcut-keys">Learn IDE&#8217;s Shortcut Keys</h3>



<p>I have used IntelliJ IDEA as my primary IDE for almost 20 years. My brain is fully wired with that particular IDE&#8217;s shortcut keys. To my disappointment, GitHub doesn&#8217;t create the <strong>GitHub Copilot Labs</strong> extension for JetBrains products.</p>



<p>To challenge myself, I want to learn similar shortcut keys for VS Code. While I can search the web for it, the easiest way is to do it directly in the code editor so that it doesn&#8217;t take my attention away during code development.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="200" src="https://myshittycode.com/wp-content/uploads/2023/09/search-engine-vscode-shortcuts.gif?x45560" alt="" class="wp-image-2449"/></figure>



<h3 class="wp-block-heading" id="converse-with-q-and-a">Converse with &#8220;q: &#8221; and &#8220;a: &#8221; </h3>



<p> You can ask GitHub Copilot anything using the <strong>q:</strong> and <strong>a:</strong> construct, even though it&#8217;s unrelated to your codebase.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="200" src="https://myshittycode.com/wp-content/uploads/2023/09/q-a-search-engine.gif?x45560" alt="" class="wp-image-2448"/></figure>



<p>You can use the same construct to ask GitHub Copilot to explain the codebase.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/q-a-explain.gif?x45560" alt="" class="wp-image-2447"/></figure>



<p>You can even argue with GitHub Copilot and defend Chuck Norris&#8217; honor!</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/q-a-converse.gif?x45560" alt="" class="wp-image-2469"/></figure>



<h3 class="wp-block-heading" id="fix-bug">Fix Bug</h3>



<p>You can attempt to fix unobvious bugs. This feature is far from perfect., but it&#8217;s worth trying out.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1168" height="586" src="https://myshittycode.com/wp-content/uploads/2023/09/lab-brush-fix-bug.gif?x45560" alt="" class="wp-image-2443" style="object-fit:cover"/></figure>



<h3 class="wp-block-heading" id="list-steps">List Steps</h3>



<p>Perhaps you inherited a project from a previous team and struggled to understand the written code. In this case, you can list the steps in the codebase.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1246" height="590" src="https://myshittycode.com/wp-content/uploads/2023/09/lab-brush-list-steps.gif?x45560" alt="" class="wp-image-2444" style="object-fit:cover"/></figure>



<h3 class="wp-block-heading" id="explain-code">Explain Code</h3>



<p>Maybe you don&#8217;t want to clutter the existing codebase with unnecessary comments because you don&#8217;t own the codebase. In this case, you can use GitHub Copilot to explain the code instead.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1246" height="590" src="https://myshittycode.com/wp-content/uploads/2023/09/lab-explain.gif?x45560" alt="" class="wp-image-2445" style="object-fit:cover"/></figure>



<h3 class="wp-block-heading" id="translate-codebase-to-another-programming-language">Translate Codebase to Another Programming Language</h3>



<p>You can also translate a block of highlighted code to another programming language.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1246" height="590" src="https://myshittycode.com/wp-content/uploads/2023/09/lab-translate.gif?x45560" alt="" class="wp-image-2446" style="object-fit:cover"/></figure>



<h2 class="wp-block-heading" id="copilot-labs-settings">Copilot Labs Settings</h2>



<p>If you often use the Copilot Labs features, there are 2 settings worth enabling to provide quick access to them.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="394" src="https://myshittycode.com/wp-content/uploads/2023/09/copilot-lab-settings-1024x394.png?x45560" alt="" class="wp-image-2491" srcset="https://myshittycode.com/wp-content/uploads/2023/09/copilot-lab-settings-1024x394.png 1024w, https://myshittycode.com/wp-content/uploads/2023/09/copilot-lab-settings-300x115.png 300w, https://myshittycode.com/wp-content/uploads/2023/09/copilot-lab-settings-768x296.png 768w, https://myshittycode.com/wp-content/uploads/2023/09/copilot-lab-settings-1536x591.png 1536w, https://myshittycode.com/wp-content/uploads/2023/09/copilot-lab-settings.png 1798w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading" id="show-brushes-lenses">Show Brushes Lenses</h3>



<p>When enabled, all brush functions (fix bug, list steps, custom, etc.) are made available when you move your cursor within the function or highlight the code.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="640" height="480" src="https://myshittycode.com/wp-content/uploads/2023/09/labs-settings-brush.gif?x45560" alt="" class="wp-image-2492"/></figure>



<h3 class="wp-block-heading" id="show-test-generation-lenses">Show Test Generation Lenses</h3>



<p>When enabled, it displays &#8220;Suggest test&#8221; on the function that quickly brings you to the Copilot Labs&#8217; Test Generation section.</p>



<p>Please note the Copilot Labs&#8217; Test Generation currently works with Javascript and Typescript (as of 2023-09-03).</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1104" height="772" src="https://myshittycode.com/wp-content/uploads/2023/09/labs-settings-test-generation.gif?x45560" alt="" class="wp-image-2493"/></figure>



<h2 class="wp-block-heading" id="what-else">What Else</h2>



<p>Do you know other cool tricks that are not listed here? If so, drop your comments below. I&#8217;m interested to learn from you.</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2023/09/02/github-copilot-10-plus-ways-to-increase-productivity/">GitHub Copilot: 10+ Ways to Increase Productivity</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2023/09/02/github-copilot-10-plus-ways-to-increase-productivity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2432</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 52/73 queries in 0.096 seconds using Disk

Served from: myshittycode.com @ 2026-03-02 12:06:53 by W3 Total Cache
-->