Back

C# autocomplete with Skylight?

Is there a recommended procedure for getting C# autocomplete working while using Skylight?  Ultimately, I would like to use VSCode with Skylight. Is this just a matter of building LEAN locally and adding the assemblies to some library path in VSCode?

Thanks!

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hey RJJ,

You're absolute correct! You can use autocomplete locally by installing and building Lean locally. Skylight can be used with any editor, including VSCode. It will sync your project files in the cloud with changes made locally.

Best
Rahul

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Just replying here for posterity. I finally got it working but it was a bit of a struggle. The problem is that the LEAN project is set up to have all the algo source in a specific folder. And Skylight is set up so that all synced code is in a specific folder... and those aren't the same folders.

So, in order to have autocomplete in the Skylight project folder, you need to create a .csproj file there that will add the correct references from LEAN build folder. I started with QuantConnect.Algorithm.CSharp.csproj and modified all the paths to point to the correct LEAN directory. This way I can create a new Skylight project and just drop the .csproj file in there and autocomplete will work.

It would be nice to have this process officially documented somewhere.

0

Hi RJJ,

I was wondering, is your setup still working fine? I did something similar and successfully got the intellisense autocomplete working, but unfortunately Skylight is now having issues with syncing the project. It doesn't seem to like the project related files generated by Visual Studio. 

For example, these are the lines relevant taken from my log file:
 

2020-09-09T03:49:20.549Z ERROR:: FileSync.UploadFileToCloud(): Failed to upload new file: packages.config in project: 5466880 File extension is not valid.
2020-09-09T03:49:20.549Z ERROR:: FileSync.UploadLocalProject(): Failed to upload file for project: C:\Users\leagu\QuantConnect\Brett Young\Optimized horizontal atmospheric scrubbers, File extension is not valid.
2020-09-09T03:49:20.561Z ERROR:: FileSync.UploadFileToCloud(): Failed to upload new file: obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache in project: 5466880 File extension is not valid.
2020-09-09T03:49:20.571Z ERROR:: FileSync.UploadFileToCloud(): Failed to upload new file: app.config in project: 5466880 File extension is not valid.
2020-09-09T03:49:20.576Z TRACE:: FileSync.UploadFileToCloud(): Updated file: Research.ipynb
2020-09-09T03:49:20.580Z TRACE:: FileSync.UploadFileToCloud(): Updated file: Main.cs


This would not be a problem if the other files were updated correctly as the cloud only really needs the .cs files; but unfortunately they are also not updated/synced. For example, in this case even though it says "Updated file: Main.cs", the file is not synced between the web and my local machine. It seems that the errors destroy the whole syncing process.

Did you also encounter this problem?
 

0

Hi RJJ,

 

We have notified the engineer team about documenting the procedure for C# autocomplete in Skylight. We’ll update the community when we have a solution.

 

Best,

Gahl Goziker

0

Just replying here for posterity. I found an alternative way to get this working. 

Using the Lean .sln file (clone github repo) with Visual Studio you can create links to the files contained within the local Skylight project folders, so you can work with them in the same project. I only included the .cs files, to do this add the following to the QuantConnect.Algorithm.CSharp.csproj (but be sure to change User in the path):

<ItemGroup>
<Compile Include="C:\Users\User\QuantConnect\User\**\*.cs*">
<Link>SkyLightProjects\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Compile>


No compiling/building is done locally and everything is synced with Skylight so it's very easy and quick to do backtests online. I really like this setup. 

I later found out about the .qcignore file inside the local Skylight folder, which can probably be used to solve the problems mentioned for the setup described in my previous comment (approach of having .csproj file in each local project folder).

I prefer this new way over the other  Perhaps flaws will become apparent as I start to use it more.
In the meantime while a official solution is yet to be documented, this setup works great for me.

0

Hi Brett,

I haven't experienced the problems you've mentioned previously. It seems to sync fine for me. On a new Skylight project I just drop my modified .csproj file in and all is good. I had no idea about the .gcignore though. Good to know!

Your new approach also makes sense. So you basically open the LEAN workspace and then work on the Skylight files in there, correct?

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed