-
Notifications
You must be signed in to change notification settings - Fork 12
Editors
There are many different editors you could use with your container. This document will describe suggested setup steps and tips for handling this with your Docker environment.
Using the Remote Containers Extension will attach your editor to the Docker container so the editor can use our specific compiler and debugger for Intellisense, auto-complete, jump-to-definition even if you don't have a C++ compiler installed natively.
This should fix errors such as:
- include errors detected for
#include "gtest/gtest.h"
- unexpected errors appear in editor but no errors when compiling in Docker
Start the csci104 container in the background:
ch start csci104
Install the VSCode Remote Containers Extension. You can do this by following
this
link
and selecting Install. Or, you can search for this in VSCode by searching for
the extension id: ms-vscode-remote.remote-containers
Open the Remote Explorer tab in VSCode on the left sidebar. Select "Containers" from the top-level dropdown. You should see a container running: usccsci104/docker:20.04
. If you see a folder /work
, click the folder icon. Otherwise, right click and select "Attach to Container". This will open a new VSCode window and may take some time to load.
If you are prompted to give a filepath, use the path: /work
Finally, you should make sure that you install C++ extensions in your container
if you don't already have these extensions locally. A highly rated one would be:
ms-vscode.cpptools
You should be all setup now! Try opening your homework and any Google Tests. Any
#include
errors should be gone now and you should have some autocompletion and
go-to-definition functionality.
CLion is made by JetBrains and is an incredible editor with great static analysis and refactoring capabilities.
As a college student, you are qualified for an educational licenese of JetBrains IDEs. With this, you can install and use CLion. Follow this link to # for the license.