Prompt

How do I set up an inline code suggester for test code generation inside VS Code?

Artificial Intelligence / AI Developer Tools1 observationLast seen Jul 19, 2026

Latest observation

Jul 19, 2026OpenAI APIWeb search: off

To set up an inline code suggester for test code generation in VS Code, you generally have two good options:

  1. Use an AI coding extension that supports inline suggestions
  2. Build your own inline completion provider if you want a custom workflow

Option 1: Use an extension like GitHub Copilot

This is the easiest setup.

Steps

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Install:
    • GitHub Copilot
    • optionally GitHub Copilot Chat
  4. Sign in to GitHub and enable the extension
  5. Open a test file, such as:
    • *.test.js
    • *.spec.ts
    • test_*.py
  6. Start typing a test scaffold, and Copilot will suggest inline completions

Helpful settings

You can make sure inline suggestions are enabled:

{
  "editor.inlineSuggest.enabled": true
}

You can also ensure suggestions appear automatically:

{
  "editor.suggestOnTriggerCharacters": true,
  "editor.quickSuggestions": true
}

Option 2: Use an extension focused on test generation

Some extensions generate tests from existing code and may also offer inline suggestions or commands.

Examples:

  • Qodo (CodiumAI)
  • TestPilot-like test generation tools
  • Codeium
  • Tabnine

Typical setup:

  1. Install the extension from the Extensions marketplace
  2. Sign in or connect the service
  3. Open the source file
  4. Run the “Generate Tests” command or use inline completion if supported

Option 3: Build your own inline suggester

If you want custom inline suggestions specifically for test generation, you can create a VS Code extension using the Inline Completion API.

Basic idea

Your extension:

  • watches the current file
  • detects when the user is in a test file or requesting tests
  • returns an inline completion suggestion

Example extension API

Use registerInlineCompletionItemProvider in your extension:

import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {
  context.subscriptions.push(
    vscode.languages.registerInlineCompletionItemProvider(
      { pattern: '**/*.{test,spec}.{js,ts,py}' },
      {
        provideInlineCompletionItems(document, position) {
          const text = document.getText();

          // Example: suggest a test skeleton
          if (text.includes('function add')) {
            return [
              new vscode.InlineCompletionItem(
                'test("adds numbers correctly", () => {\n  expect(add(1, 2)).toBe(3);\n});',
                new vscode.Range(position, position)
              )
            ];
          }

          return [];
        }
      }
    )
  );
}

Enable inline suggestions in VS Code

Add this to your settings:

{
  "editor.inlineSuggest.enabled": true
}

Recommended setup for most people

If your goal is just to generate tests quickly inside VS Code, the best path is:

  • Install GitHub Copilot
  • Turn on editor.inlineSuggest.enabled
  • Use test file naming conventions like .test.ts, .spec.ts, etc.

If you want, I can also give you:

  • a step-by-step Copilot setup
  • a custom VS Code extension template for test inline suggestions
  • settings specifically for JavaScript, TypeScript, Python, or Java

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.