Tuesday, April 1, 2025

How to work with Github Copilot in VC Code

Hello Everyone, 

AI will take away our jobs! No, it will not. We need to understand its benefits and take it as a helping hand. Think about it, when you have a task and this requires you to create many objects, work on some basic assigment things but also requires a lot of logic, would you want to concentrate on the logic, do this repitative stuff, manually write basic code or rather let the AI do that tedious task?

Of course, it will not give you advanced-level stuff, but it is pretty cool and also gives you answers based on your objects and fields. 

Now, let's see how we can achieve it!


1. Install in VS Code

  1. Open VS Code and go to the Extensions tab 

  2. Search for "GitHub Copilot" and install the official extension.


  3. Search for "Copilot Chat" and install the official extension.



  4. Sign in with your GitHub account (free trial).

2. Enable and Configure Copilot

  • Open VS Code settings (Ctrl + ,) and search for "Copilot".

  • Adjust preferences like code suggestions, inline completions, and file types where Copilot should assist.

3. Start Coding with Copilot

  • Begin typing, and Copilot will suggest code completions automatically.

  • Accept a suggestion using Tab or see alternative suggestions with Ctrl + Space.

  • To trigger Copilot manually, press Ctrl + Enter.

4. Use Copilot for Comments & Functions

  • Write a comment describing a function (e.g., // Function to calculate tax), and Copilot will suggest the full function.

  • For more detailed suggestions, start typing the function name, and Copilot will complete it.

One annoying thing that I found is that it suggests code too often, which is not always correct. But you can always set the preference as mentioned in Point 2.

Example: This field exists in other tables for me and not in Sales Header, but it still gives me the intellisence. So ya, do not trust it blindly. 


If you have tried it and have more ideas let's discuss!

Reach out to me if you have any questions or suggestions. 

Check out other blogs, if you haven't already. 

Kindly suggest what else you want me to blog about. Keep following and supporting!

You can also email me at jyotsnaoberainav@gmail.com

Also, visit my website JONAV if you are looking for NAV/D365BC Training and/or Services!

Thank you! 

No comments:

Post a Comment