Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
/*
Recommended VS Code extensions for the LEAN engine
*/
"recommendations": [
"ms-dotnettools.csharp",
"ms-dotnettools.csdevkit",
"ms-vscode-remote.remote-containers",
"ms-python.python"
]
}
45 changes: 31 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
/*
VS Code Launch configurations for the LEAN engine

Launch:
Builds the project with dotnet 6 and then launches the program using coreclr; supports debugging.
In order to use this you need dotnet 6 on your system path, As well as the C# extension from the
marketplace.
Launch LEAN:
Builds the project and then launches the program using coreclr; supports debugging.
Requires the C# extension from the marketplace.

Run Tests:
Builds and runs tests with an optional filter prompt.

Attach to Python:
Will attempt to attach to LEAN running locally using DebugPy. Requires that the process is
actively running and config is set: "debugging": true, "debugging-method": "DebugPy",
Requires Python extension from the marketplace. Currently only works with algorithms in
Algorithm.Python directory. This is because we map that directory to our build directory
that contains the py file at runtime. If using another location change "localRoot" value
to the directory in use.
Requires Python extension from the marketplace.
*/

"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"name": "Launch LEAN",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
Expand All @@ -33,15 +31,34 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Run Tests",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "dotnet",
"args": [
"test",
"${workspaceFolder}/Tests/QuantConnect.Tests.csproj",
"--no-build",
"--filter",
"TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Attach to Python",
"type": "python",
"request": "attach",
"port": 5678,
"pathMappings":[{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}]
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}"
}
]
}
]
}
9 changes: 7 additions & 2 deletions .vscode/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ If you would like to mount any additional local files to your container, checkou

<h2>Option 3: Install Dependencies Locally</h2>

1. Install [.NET 9](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) for the project
1. Install [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) for the project

2. (Optional) Get [Python 3.11.11](https://www.python.org/downloads/release/python-31111/) for running Python algorithms
2. (Optional) Get [Python 3.11.14](https://www.python.org/downloads/release/python-31114/) for running Python algorithms
- Follow Python instructions [here](https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python#installing-python-311) for your platform

3. Get [Visual Studio Code](https://code.visualstudio.com/download)
- Get the Extension [C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) for C# Debugging
- Get the Extension [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) for the .NET Test Explorer and enhanced C# development
- Get the Extension [IntelliCode for C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscodeintellicode-csharp) for AI-assisted IntelliSense
- Get the Extension [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for Python Debugging

4. Get Lean into VS Code
Expand Down Expand Up @@ -107,6 +109,9 @@ In VS Code run build task (Ctrl+Shift+B or "Terminal" dropdown); there are a few
- __Build__ - basic build task, just builds Lean once
- __Rebuild__ - rebuild task, completely rebuilds the project. Use if having issues with debugging symbols being loaded for your algorithms.
- __Clean__ - deletes out all project build files
- __Test__ - runs the unit tests (requires building first)

**Note:** VS Code will prompt you to install the recommended extensions (C#, C# Dev Kit, Python) when you first open the workspace. You can also install them manually or via the `extensions.json` file.

<br />

Expand Down
25 changes: 23 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
{
"files.eol": "\n",
"files.exclude": {
"**/bin": true,
"**/obj": true,
"**/.git": true
},
"search.exclude": {
"**/bin": true,
"**/obj": true
},
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.enableEditorConfigSupport": true,
"dotnet.defaultSolution": "QuantConnect.Lean.sln",
"editor.formatOnSave": true,
"editor.rulers": [
150
],
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp",
"editor.tabSize": 4,
"editor.insertSpaces": true
},
"python.analysis.extraPaths": [
"/Lean/Algorithm.Python",
"/opt/miniconda3/lib/python3.8/site-packages"
"./Algorithm.Python",
"/opt/miniconda3/lib/python3.11/site-packages",
]
}
34 changes: 29 additions & 5 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
/*
VS Code Tasks for the LEAN engine
In order to use the build tasks you need msbuild on your system path.
In order to use the build tasks you need dotnet on your system path.
*/
"version": "2.0.0",
"tasks": [
Expand All @@ -11,11 +11,15 @@
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/QuantConnect.Lean.sln",
"/p:Configuration=Debug",
"/p:DebugType=portable",
"/p:WarningLevel=1"
],
"group": "build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent"
},
Expand All @@ -27,6 +31,7 @@
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/QuantConnect.Lean.sln",
"--no-incremental",
"/p:Configuration=Debug",
"/p:DebugType=portable",
Expand All @@ -44,24 +49,43 @@
"command": "dotnet",
"args": [
"clean",
"${workspaceFolder}/QuantConnect.Lean.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "test",
"type": "shell",
"command": "dotnet",
"args": [
"test",
"${workspaceFolder}/Tests/QuantConnect.Tests.csproj",
"--no-build"
],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always"
},
"problemMatcher": "$msCompile"
},
{
"label": "start research",
"type": "shell",
"dependsOn": ["build"],
"group": "build",
"isBackground": true,
"command" : "${workspaceFolder}/.vscode/launch_research.sh",
"args" : [
"command": "${workspaceFolder}/.vscode/launch_research.sh",
"args": [
"${workspaceFolder}/Launcher/bin/Debug"
],
"problemMatcher": "$msCompile"
}
]
}
}
Loading