Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Crear una extensión para VS Code con TypeScript

Tiempo de lectura: 2 minutos

Hoy vamos a aprender cómo podemos generar una extensión para VS Code usando TypeScritp.

VS Code - Pexels
  1. Configura tu entorno de desarrollo para extensiones de VSCode:

Necesitarás Node.js y yo (Yeoman) para generar una extensión de VSCode.

Instala el generador para extensiones de VSCode:
npm install -g yo generator-code

Crea el esqueleto de la extensión:

  • Ejecuta el generador de extensiones:
    yo code
Visual Studio Code Extension Generator
  • Selecciona «New Extension (TypeScript)» y sigue las instrucciones para configurar los detalles.

Ahora elegimos unbundled

Seleccionar bundler para extension VS Code

Package manager, elegimos npm

Seleccionar package manager

Y esperamos a que se cree.

Modificar el archivo src/extension.ts con el código que quieras crear para tu extensión.

  1. Compila y prueba tu extensión:
  • Desde la carpeta raíz de tu extensión, abre la terminal e instala las dependencias con npm install.
  • Compila la extensión: npm run compile Luego, abre VSCode, presiona F5 para iniciar una nueva ventana de VSCode con tu extensión activada. Ahora, al abrir un archivo README.md, este debería abrirse automáticamente.
  1. Publica la extensión (opcional):
    Si quieres compartirla con otros usuarios, puedes publicarla en el marketplace de VSCode.
0

Deja un comentario