Hi Everyone,

We recently rolled out Python Autocomplete for local Skylight development in VS Code and PyCharm. However, we’d still want our C# users to also experience Autocomplete, so today, we will go over how to have Autocomplete with C# Skylight algorithms.

First, if we haven’t done so already, we need to install Lean to our machine. For users that don’t, this can be as easy as git clone https://github.com/QuantConnect/Lean.git in the terminal, and this is sufficient for users who only wish to gain the Autocomplete features.

Now, we will go over the instructions for specific IDEs/Editors. 

Visual Studio:

  1. Open the Lean repository in Visual Studio

  2. Right-click the Algorithm.CSharp folder, then choose “Add”->”Add Existing Item”, then navigate to where the synced Skylight folder is (it usually looks like “C:\Users\user\QuantConnect\QC Name”) and choose the folder of the algorithm you’d like to edit

  3. Choose the .cs files and click the triangle near the “Add” button, then select the “Add as Link” option. What this does is essentially allow us to have access to the Lean classes and methods while editing a file from a different folder

  4. When finished coding, save the file and right-click the Skylight tool bar icon and choose “Sync”, and after a few seconds, the changes will be reflected in the cloud

VS Code:

  1. Open the Lean project using VSCode

  2. Install a Symbolic Linking extension (for reference, I use autolink by Archal)

  3. Follow the steps for the Symbolic Linking extension, and then go to File->Open File, then select the .cs files in the Skylight algorithm folder (it usually looks like “C:\Users\user\QuantConnect\QC Name”) that you’d like to edit. Note: if you are using autolink like I did, then simply opening the .cs files automatically creates the Symbolic Link for you

  4. When finished coding, save the file and right-click the Skylight tool bar icon and choose “Sync”, and after a few seconds, the changes will be reflected in the cloud

Rider:

  1. Open the Lean project inside Rider

  2. Right click the “Algorithm.CSharp” folder, hover “Add”, then select the “Add Existing Item” option, which will prompt you to choose a file

  3. Head over to where the synced Skylight folder is (it usually looks like “C:\Users\user\QuantConnect\QC Name”) and choose the folder of the project you’d like to edit

  4. Choose the .cs files you’d like to edit, then select the “Add Links” option when prompted

  5. Then hit ok for every file chosen

Best,
Shile Wen