Creating an Extension
Create a new extension project and become familiar with its structure.
Last updated
Create a new extension project and become familiar with its structure.
Last updated
Before creating an extension make sure the following requirements are met.
You have 16.10 or higher installed.
You have installed.
CodeEdit makes it easy to create a new extension project using the Extensions menu. To get started choose Extensions > New Extension…, which will open a Save dialog prompting you to select a location for your project.
Every extension project is created with the default file and folder structure shown below.
assets/ contains all images used by the extension, which will be bundled with the extension and accessible at runtime. Every extension should also include an icon.png
file to be displayed in the CodeEdit UI and extension store.
node_modules/ contains the project dependencies. Its contents should not be manually altered. Instead, to add a dependency use package.json
and npm.
src/ contains the project source files in JavaScript (.js, .jsx) or TypeScript (.ts, .tsx) format.
.gitignore includes a list of files and folders to be ignored by Git version control. See the Git documentation for more information.
CHANGELOG.md includes information about changes made in each version of the extension. This file should be written in Markdown and will be displayed in the extension store alongside details included in README.md
when the extension is published.
package-lock.json is a file generated by npm containing detailed information about the dependencies used, such as the exact version of a package that is installed. Do not manually alter this file
name
Yes
The extension identifier.
displayName
Yes
Human readable extension name.
description
Yes
A single sentence describing the extension.
icon
Yes
An icon for the extension. See our icon specifications.
author
Yes
The username of who built the extension.
categories
Yes
The categories that apply to this extension. See a list of our extension categories.
commands
Yes
An array of commands that are offered by this extension. See Command Properties.
contributors
No
A list of usernames of contributors of this extension.
keywords
No
Keywords that apply to this extension.
preferences
No
An array of preferences that are offered by this extension. See Preferences Properties.
src/index.js serves as the main entrypoint for the extension. See the section below to learn more.
package.json is a manifest file that with metadata about the extension. It is also used to add extension dependencies. See the section below to learn more.
The package.json
extension manifest file is a superset of the npm package.json
file so only a single file is required to configure your extension. Please refer to the for more information.
The index.js
file serves as the main entrypoint for the extension. It should export two methods, activate
and deactivate
. The activate
method is called only once when the specified in extension.json
has occurred.