P
💻DeveloppementAdvancedAll AIs

Prompt to Create a VS Code Extension with AI

This prompt guides AI to create a complete VS Code extension, from project initialization to Marketplace publishing, covering architecture, tests and API integration.

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

Tu es un développeur expert en extensions VS Code et en TypeScript. Je veux créer une extension VS Code qui [DESCRIPTION_FONCTIONNALITE]. L'extension cible les développeurs qui travaillent avec [LANGAGE_OU_TECHNOLOGIE].

Guide-moi étape par étape pour :

  1. Initialisation du projet : génère la structure complète du projet avec Yeoman (yo code), le package.json avec les champs contributes appropriés (commandes, menus, keybindings, vues), et le tsconfig.json optimisé.

  2. Architecture de l'extension : propose une architecture modulaire avec :

    • Le point d'entrée (extension.ts) avec activate/deactivate
    • Les commandes enregistrées via vscode.commands.registerCommand
    • Les providers nécessaires (TreeDataProvider, CompletionItemProvider, CodeActionProvider, etc.)
    • La gestion de la configuration utilisateur via WorkspaceConfiguration
  3. Intégration de l'API VS Code : montre comment utiliser :

    • L'API de l'éditeur (TextEditor, TextDocument, Selection, Range)
    • Le système de diagnostics (DiagnosticCollection)
    • Les WebviewPanel si une interface graphique est nécessaire
    • Le système de stockage (ExtensionContext.globalState / workspaceState)
  4. Fonctionnalité principale : implémente la logique métier de [DESCRIPTION_FONCTIONNALITE] avec du code TypeScript complet et commenté.

  5. Tests : écris des tests unitaires avec le framework de test VS Code (@vscode/test-electron) couvrant les cas nominaux et les cas limites.

  6. Publication : fournis les étapes pour publier sur le VS Code Marketplace avec vsce, incluant le README.md, le CHANGELOG.md et les badges.

Pour chaque fichier généré, indique le chemin relatif exact dans le projet. Assure-toi que le code est compatible avec la dernière version de l'API VS Code et suit les bonnes pratiques officielles de Microsoft.

Personalize this prompt with Léa

Answer 3 questions and Léa tailors the prompt to your situation.

Why this prompt works

<p>This prompt is designed to provide complete guidance for creating a VS Code extension. By specifying the <strong>desired feature</strong> and <strong>target language or technology</strong>, you get a tailored guide covering every development stage. The AI generates ready-to-use TypeScript code following official Microsoft conventions.</p><p>The prompt structure follows the real lifecycle of an extension: initialization with the Yeoman generator, modular architecture with proper VS Code patterns (providers, commands, configuration), business logic implementation, then tests and publishing. Each section explicitly requests <strong>complete, commented code</strong> with file paths, which avoids overly abstract responses.</p><p>To maximize result quality, be specific in describing your feature. For example, instead of saying "a linter", specify "a linter that checks BEM naming conventions in CSS files and offers quick fixes". The more detailed your description, the more relevant and directly usable the generated code will be.</p>

Use Cases

Create an intelligent snippet manager that suggests code excerpts based on contextDevelop an integrated code review tool that analyzes quality with custom rulesBuild a sidebar panel displaying API documentation directly in the editor

Expected Output

A structured step-by-step guide containing the complete project structure, TypeScript code for each source file with relative paths, configuration files (package.json, tsconfig.json), working unit tests and Marketplace publishing instructions.

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • LéaAI

    Astuce : remplacez [DESCRIPTION_FONCTIONNALITE] par une fonctionnalité précise (ex: "surbrillance des variables inutilisées"). Pour les WebviewPanel, préférez le framework Svelte intégré aux extensions modernes. Définissez un ActivationEvents minimal (ex: `onCommand:extension.myCommand`) pour éviter un démarrage inutile.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

💻DeveloppementBeginnerAll AIs

Implement responsive navigation

Build accessible navbars

0182
💻DeveloppementIntermediateAll AIs

Perplexity Prompt to Generate a Database Schema

Perplexity stands out from other AI tools by its ability to combine real-time web search with structured content generation. For designing database schemas, this dual capability is particularly valuable: Perplexity can analyze current best practices in modeling, draw inspiration from existing schemas in open source projects, and produce a result that respects modern conventions of your target DBMS. Unlike a classic LLM that relies solely on its training data, Perplexity can verify specific data types for PostgreSQL 16, MySQL 8, or SQLite, and ensure the generated syntax is up-to-date. Whether you are starting a project from scratch or refactoring an existing database, a well-structured prompt will allow you to obtain a complete schema with tables, relationships, indexes, and constraints, ready to execute. The approach involves precisely describing your business domain, entities, and management rules so that Perplexity produces a normalized, performant, and maintainable schema.

0122
💻DeveloppementIntermediateAll AIs

Midjourney Prompt for Creating a REST API

Midjourney, renowned for its AI-powered image generation capabilities, can play an unexpected yet strategic role in creating a REST API. While Midjourney doesn't generate code directly, it excels at visualizing software architectures, endpoint schemas, data flow diagrams, and API documentation interface mockups. Before coding a REST API, the visual design phase is crucial: it helps clarify resource structure, entity relationships, authentication flows, and expected responses. By using precise prompts in Midjourney, you can generate professional architectural diagrams, visual database schemas, illustrations for your Swagger or OpenAPI documentation, and graphical representations of your endpoints. These visuals then serve as communication aids for your development team, stakeholders, or technical documentation. This hybrid approach between visual design and backend development allows you to design clearer, better-documented, and more maintainable REST APIs. Discover how to craft your Midjourney prompts to transform your REST API design process.

0120
💻DeveloppementIntermediateAll AIs

DALL-E Prompt to Generate Python Code

DALL-E, OpenAI's image generation model, offers a unique visual approach to representing Python code as images. Although DALL-E is not a programming tool per se, it excels at creating visuals depicting code snippets, software architecture diagrams, infographics explaining Python concepts, or stylized screenshots of development environments. This capability proves particularly useful for educational content creators, programming instructors, tutorial authors, and developers looking to illustrate their blog posts or presentations. By crafting precise prompts describing the desired type of Python code, the visual style, the simulated development environment, and the expected level of detail, you can obtain realistic and aesthetic code images. Whether for a Python snippet displayed in a dark terminal, a visually generated UML diagram, or an infographic illustrating an algorithm, DALL-E transforms your textual descriptions into striking visual representations that capture attention and facilitate the understanding of programming concepts.

0125