Building and Installing VS Code Extensions in Cursor
Source: Dev.to
While working with Cursor, I discovered a serious limitation: not every VS Code extension is available directly within Cursor’s marketplace. Since some extensions aren’t easily accessible or compatible through standard installation methods, you can build the extension from source and install it manually. I’ll use the pgFormatter extension as an example.
Cursor is built on the VS Code source code and uses the same extension packaging format (.vsix). However, some extensions:
- Are not listed in Cursor’s marketplace.
- Depend on APIs or versions that differ from Cursor.
Obtaining the Extension Source
- Clone or download the extension’s repository (usually from GitHub).
- The directory structure typically looks like this:
package.json
src/
tsconfig.json
vsc-extension-quickstart.md
- Open a terminal in the extension directory and install its dependencies:
npm install
Packaging the Extension
After the dependencies are installed, package the extension into a VSIX file using the VS Code Extension CLI:
npx vsce package
If the process succeeds, you’ll get a file similar to pgformatter-1.33.0.vsix.
Installing the VSIX in Cursor
Command Palette Installation
- Open Cursor.
- Open the Command Palette:
- macOS:
⌘ + Shift + P - Windows/Linux:
Ctrl + Shift + P
- Run Extensions: Install from VSIX…
- Select the generated
.vsixfile.
If the extension isn’t active immediately, reload the window:
Developer: Reload Window
Practical Considerations
- Security: Manually built extensions require you to verify the source code and its dependencies.
- Updates: Manually installed extensions won’t update automatically; repeat the build‑and‑install process for new releases.
- Compatibility: Because Cursor uses the same packaging model as VS Code, developers can compile and install extensions that aren’t available in Cursor’s marketplace.
By generating a VSIX file from the source and installing it manually, you can keep using important extensions like pgFormatter despite ecosystem differences.