This is the extension for VSCode that enables Meadow apps to be build, debugged and deployed to a Meadow device.
- Change to pick up the fact ProjLab is now part of NoLink in Meadow.CLI
- Add extra check to re-enable the runtime, if it isn't enabled after deployment.
- Fix for VSCode on Windows so that debugging works again.
- Supported Operating Systems
- Using the Extension
- Building the Extension and Contributing
- Debugging just the TypeScript Extension
- License
- Support
We tested this extension on the following operating systems:
- Windows
- macOS
- Linux (Ubuntu)
- In VSCode go to the Extensions tab (macOS: Cmd+Shift+X. Others: Ctrl+Shift+X)
- In the search bar type
VSCode Tools for Meadow
. It should be the 1st extension in the list. - Click it the
Install
button on the bottom right of the listed item. - The extension should now be installed.
It should look similar to this:
- Download the alpha/beta extension (.vsix file) from our latest GitHub CI.
- In VSCode go to the Extensions tab (macOS:
Cmd+Shift+X
. Others:Ctrl+Shift+X
) - click the
...
menu and choose Install from VSIX.... - Pick the file you downloaded to install.
In a terminal:
-
Run
dotnet new install WildernessLabs.Meadow.Template
-
Create and/or navigate into a directory with the name of your new app (ie:
MeadowApp1
). -
Run
dotnet new Meadow
Alternatively, you can also specify the folder where your new project will go directly by appending the
--output
parameter.dotnet new Meadow --output MyNewMeadowApp
- Ensure your Meadow board is plugged in, and up to date.
- Open your new app's folder in VSCode.
- Any attached devices should appear in the Run and Debug list
- Choose Run -> Start Debugging (short-cut:
F5
) (Your code will automagically be built first). - If you have move than 1 Meadow device attached, you will be prompted to pick a serial port/device to deploy to. If you have only have 1 Meadow device attached it will use that automagically.
- Watch the output in the Terminal and Debug Console tabs, as your app is deployed!
- You will be able to set breakpoints and debug your Meadow App.
You may need to add a global.json
file to your project's directory to tell it to use .NET 6.0:
"sdk": {
"version": "6.0.413",
"allowPrerelease": false,
"rollForward": "latestMinor"
}
You can refresh the list of attached devices by using the following short-cut on:
- macOS use:
Cmd+Alt+Shift+R
- Other platforms use:
Ctrl+Alt+Shift+R
or search for the select device command by pressing Ctrl+Shift+P
and typing "Meadow" when prompted
You can toggle the project's build configuration, using the Toggle Build Configuraton
button on the bottom status bar, to toggle between Debug and Release builds:
You can also use the following short-cut on:
- macOS use:
Cmd+Alt+Shift+T
- Other platforms use:
Ctrl+Alt+Shift+T
- Install NPM
Then run the following commands on the command line, once NPM is installed
npm i -g @vscode/vsce
npm i -g @vscode/debugprotocol
npm install -g webpack
npm install -D ts-loader
npm i typescript --save-dev
- .NET (Mono on macOS, .NET 6.x on Windows/Linux)
With all the listed pre-requisites installed, run npm i
to ensure all of the packages are installed and up to date for the project.
- Be sure to checkout this repo with submodules:
git clone --recurse-submodules git@github.com:WildernessLabs/VSCode_Meadow_Extension.git
- Meadow.CLI repo must be cloned adjacent to this checkout.
The extension has 2 parts. There is a client, which is written in TypeScript and a server which is writtne in C#.
- Open the extension folder VSCode.
- Got to Run and Debug (macOS:
Cmd+Shift+D
. Others:Ctrl+Shift+D
)
You can choose the Debug Extension + Server
option in the debug menu in VSCode to debug both parts at the same time.
This will launch the server process in debug listening mode.
You will be able to set breakpoints in the host instance of VSCode and debug the TypeScript extension.
This does not allow you to debug the arbitrary commands sent to the vscode-meadow.exe process from the extension for things like getting a list of devices. This will only allow you to debug the code path of a VSCode instance starting a Deploy/Debug session.
- Choose
Debug Extension
from the Debug menu in VSCode and run it. - Open a meadow project in the new instance of VSCode which now includes the extension.
You can set breakpoints in the host instance of VSCode and debug the TypeScript.
To produce a VSIX for the VSCode extension:
- Open a Terminal Window in the extension folder
- Run the following command (we recommend building with
--pre-release
flag when buiding locally, to avoid confusion when installed into VSCode)vsce package --pre-release
Copyright 2023, Wilderness Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Having trouble building/running these projects?
- File an issue with a repro case to investigate, and/or
- Join our public Slack, where we have an awesome community helping, sharing and building amazing things using Meadow.