GitHub Copilot: Deep Dive — Code Suggestions & Code Referencing

Welcome to today’s newsletter issue on GitHub Copilot! In this edition, we’ll explore how Copilot suggests code and how it tracks origins for suggestions that match public code.

What Are Code Suggestions?

Code suggestions are the real-time, AI-powered completions that Copilot offers as you type inside your IDE — such as VS Code, JetBrains, Visual Studio, Xcode, or even Vim/Neovim. Copilot analyzes your current code context and predicts what you’re likely to write next. It can:

  • Complete lines or entire blocks of code
  • Understand natural language prompts in comments and generate corresponding code
  • Offer multiple alternatives you can cycle through and accept or reject
  • Work across many languages and frameworks (e.g., Python, JavaScript, C#, Go, Ruby, TypeScript)

Example:

Article content

These inline suggestions help reduce boilerplate work and speed up development flow. Ghost text appears as you type — accept with a key (like Tab) or explore alternatives with your keyboard shortcuts.

What Is Code Referencing?

GitHub Copilot also includes a code referencing feature that gives visibility into where a suggested code snippet may originate from publicly available sources:

  • When an accepted inline suggestion matches publicly available code, Copilot can log URLs and license information for those matches (If you're using intellij you can check for Idea.log file)
  • This helps you review origin and licensing and decide how to proceed with the code you’ve accepted.
  • Matches are relatively rare (typically under 1% of suggestions), but when they happen, Copilot makes the attribution transparent.
  • Code referencing is supported in GitHub Copilot across IDEs and Copilot Chat.

Example:

Article content
No match found
Article content
Match found

This feature is especially valuable for developers, teams, and organizations concerned with software licensing and compliance.

Code Referencing for Copilot Chat:

If Copilot chat responses contain the code from the public GitHub repository, the references will be provided at the end of response.

Limitations:

  • The search index will be refreshed every few months - So the code from the public repositories which are deleted and the commits before the index was created won't be available until the next refresh
  • If code existed during indexing but was later deleted, the search index may still show it.

Stay tuned for the next articles.

To view or add a comment, sign in

More articles by Saimanikanta Kandela

  • GitHub Copilot coding agent - Introduction

    The GitHub Copilot Coding Agent is designed to act like an autonomous teammate inside your repository. Unlike…

  • GitHub Copilot Chat - Custom Instructions

    Copilot Chat’s default behavior is great out of the box — but every developer and team is unique. By customizing…

  • Prompting Frameworks That Actually Make AI Listen

    So today, we’re covering battle-tested prompting frameworks that turn “meh” responses into “damn, that’s good.” 1.

  • Spring Security

    Why you need spring security for your application? Let's say you have deployed your application on a server. Now your…

Others also viewed

Explore content categories