Copy a sample

nRF Connect for VS Code

tags
nRF Connect for VS Code

Copy a sample

Copying a sample was already available as an option in previous versions of the extension, but has been revamped this release.

Instead of the old sample browser, samples are now presented in a filterable list, populated from all the modules in your SDK. From this menu, you can open the local folder in the file explorer, view the documentation for your version of the SDK or view the sample on GitHub.

You can also filter the samples based on available modules and supported boards.

Once you've found the sample you would like to start your project from, VS Code will copy the sample from the SDK and set up a basic Git repository around it.

Note that you need to have a local copy of the nRF Connect SDK to copy a sample.

Another change for this workflow is that the extension will copy any external directories that are referenced from the CMakeLists.txt file, which resolves a long standing issue with samples that share common code in a directory outside the sample itself, such as the HTTP Update samples for nRF9160. The external dependencies will be copied into the application source directory and any reference to them in the CMakeLists.txt file will be changed.