This Visual Studio Code extension allows you to edit the Javascript of Hatch components. The Hatch web server is assumed to be running locally.
- Start a WebSocket server on port 3000
- Receive per-object Javascript and open it in a new editor
- Send changes to Hatch as you edit the content in VS Code
- Receive changes from Hatch as you edit the Javascript there
-
Install the extension
webedit-<version>.vsixin Visual Studio Code by following these steps:- Open the Extensions view by clicking on the square icon in the Sidebar on the left side of the window.
- Click on the three dots in the top right corner of the Extensions view and select "Install from VSIX..."
- Select the
.vsixfile you generated in the "Packaging" step below. Or - run the command
Extension: Install from VSIX...from the Command Palette (Ctrl+Shift+P) and select the.vsixfile you generated in the "Packaging" step below.
-
Run the command "Start Local Web Edit" from the Visual Studio Code Command Palette (Ctrl+Shift+P)
-
In Hatch (this , running on localhost, click on objects with Javascript to edit
- Visual Studio Code 1.60.0 or higher
- Hatch
This extension doesn't contribute any settings.
yarn install
yarn run compile
To package the extension as a .vsix file:
-
Ensure you have the
vsce(Visual Studio Code Extensions) tool installed globally:npm install -g vsce -
Navigate to the project directory in the terminal.
-
Run the following command to create the
.vsixfile:vsce package -
This will generate a file named
webedit-<version>.vsixin the project directory, where<version>is the version number specified in yourpackage.jsonfile. -
You can then install this
.vsixfile in Visual Studio Code by following the "Usage" instructions above.
- VSCode intellisense is a mixed blessing. It complains a lot and wants to autocomplete inappropriately.
- No @mention support.
- Files are presented as "unsaved" even though they are autosaved as they are changed.
- No way to initiate adding Javascript to an object from VSCode.
It works!