Visual Studio Code (VS Code) は Microsoft が提供する無料・オープンソースのコードエディタです。豊富な拡張機能によって C/C++・C#・Python など多様な言語に対応し、Git 統合・デバッガ・タスクランナーなどの機能を持ちます。軽量でありながら IDE に近い機能を持つため、クロスプラットフォーム開発に広く使われています。
このリポジトリの開発環境として VS Code を使用することで、C ソースコードのインテリセンス (補完・定義ジャンプ)、デバッグ、makefile タスクの実行、Git 操作をひとつのエディタで行えます。Windows 環境では Start-VSCode-With-Env.ps1 スクリプトが MinGW / VSBT の環境変数を設定した状態で VS Code を起動するため、ターミナルから直接 gcc や make コマンドを利用できます。
.vscode/ ディレクトリに settings.json・tasks.json・launch.json・c_cpp_properties.json を配置することで、チームで共通の開発環境設定を共有できます。
tasks.json の設定リファレンスlaunch.json の設定VS Code のタスク設定例 (.vscode/tasks.json):
{
"version": "2.0.0",
"tasks": [
{
"label": "make all",
"type": "shell",
"command": "make",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always"
}
},
{
"label": "make clean",
"type": "shell",
"command": "make clean"
}
]
}C/C++ インテリセンス設定 (.vscode/c_cpp_properties.json):
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/prod/calc/include",
"${workspaceFolder}/testfw/include"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11"
}
],
"version": 4
}Windows での VS Code 起動 (環境変数設定込み):
.\Start-VSCode-With-Env.ps1${workspaceFolder} などの変数説明