VSCode Setup For macOS
This guide may be incomplete. Please suggest changes as needed.
Install Mono
Quantum requires .NET Framework to build. For macOS you must install Mono if you are not using Visual Studio.
Once installed you be able to use the msbuild
command.
$ which msbuild
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild
Workspace Setup
Workspaces
Create one workspace for quantum_unity
and one for quantum_code
. Extensions expect the .sln
file to be in the root of each workspace.
Build
Once created, in your quantum_code
workspace, open the command palette and select Tasks: Configure Default Build Task > Create tasks.json file from template > MSBuild.
This will be added to your tasks.json
:
JSON
{
"label": "build",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/t:build"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
I set reveal
to always
so I know when the build completes
You can now build the project with the "Tasks: Run Build Task" command (⌘+shift+B). This will build both the quantum.code
and quantum.state
projects.
To create separate build tasks for each project, make two copies of this task. Change the label
of the first to "build state"
and replace "/t:build"
with "/t:quantum_state"
. The second set to "build systems"
and "/t:quantum_systems"
. Note that the argument here is the name of each .csproj
file, but with the .
replaced (as it's an invalid character).
Note that after building quantum.state
the changes are not always seen is VSCode. Use the command Restart Omnisharp
to load the changes.
Extensions
C# for Visual Studio Code
Provides basic C# language support (intellisense etc).
VS Code .csproj
Manages .csproj
file. Source files must be added to the project file to be included by the build. This extension prompts to add new files when opened.
By default .cs
and .qtn
files are added as Content
. Add the following to your workspace config to correct this:
JSON
"csproj.itemType": {
".cs": "Compile",
".qtn": "None",
"*": "Content"
}
Optionally add the following to auto-remove deleted files:
JSON
"csproj.silentDeletion": true
Also adds the following commands:
- csproj: Include in Project
- csproj: Remove from Project
vscode-solution-explorer
fernandoescolar.vscode-solution-explorer
Adds a helpful solution view to your explorer (similar to Visual Studio).
Back to top