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:
Open the Lean repository in Visual Studio
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
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
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:
Open the Lean project using VSCode
Install a Symbolic Linking extension (for reference, I use autolink by Archal)
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
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:
Open the Lean project inside Rider
Right click the “Algorithm.CSharp” folder, hover “Add”, then select the “Add Existing Item” option, which will prompt you to choose a file
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
Choose the .cs files you’d like to edit, then select the “Add Links” option when prompted
Then hit ok for every file chosen
Best,
Shile Wen