improve setup
this merge request introduces the possibility to edit codes from a visual studio code instance hosted inside the container. this provides users with a tailored integrated development environment for this repository, similar to code expert providing both runtime and code editor.
example of editor in the browser, hosted locally. linter warnings are shown inline. build commands can be invoked from the terminal.
features/advantages
- comfortable graphical file system navigation
- c/c++ syntax highlighting
- built-in, preconfigured clang-tidy that shows warnings in-line. the linter is configured identically to the one used by the cmake build process to avoid inconsistencies
- opening new terminals directly from within the code editor (instead of attaching a new terminal to the running docker container via command line) to build or execute programs
- most users have experience with visual studio code
- built-in graphical cmake toolset (untested)
- requirements to use the codes for this course reduce to: docker + browser (not even a text editor or file browser is required). only git (intentionally) remains as tool required on the host OS
usage
(from Docker/readme.md) Run the shortcut vscode
. In a browser on your host OS, open http://localhost:8081
. You can now edit the NumCSE code in a full-feature Visual Studio Code IDE in the browser with all necessary extensions preinstalled and the correct workspace configured. You can run clang-tidy on a file manually by opening the command palette and executing Clang-Tidy: Lint File
.
alternative usage
Using Visual Studio Code locally (i.e. on your host OS), install the Dev Containers extension with (ID ms-vscode-remote.remote-containers
). Use docker to launch/enter the NumCSE development container. Then in Visual Studio Code use the command Dev Containers: Attach to Running Container
, select this container and make sure to open the provided workspace in the Docker
directory. When asked to confirm installation of the recommended extensions for this workspace (in the container), confirm. The extensions are important to benefit from a full-feature IDE. You may have to repeat this process after the container is destroyed.