Closed pushqrdx closed 5 years ago
First of all, please add tests so I can actually see how to use the system.
Regarding scanning assemblies, this is how it will go: Base .NET libraries get precompiled and cached somewhere before production. On the first time the extension is loaded with a .csproj files, all of those libraries are cached. Whenever a completion is required, vscode sends a request to the server to get it the list of references, or the extension methods of a type. (These requests also send in the .csproj path). If this is too slow we cache everything on the client instead. Whenever .csproj changes we update the cache.
This took way more time than I expected, This pr isn't finished as some of the changes need to be discussed.
Here's how the new code works:
Project.cs:
Note:
The reason i chose to use
NuGetPackageRoot
to find nuget packages is to avoid having to wait for project builds. Plus some users might have things likeFody
or simply chose not to copy the reference dll locally which would result in the server not being able to get completions for them.Note 2:
See Project.cs#90.
And here's how i imagine the server should act:
.csproj
file pathes.getAllCompletions
request might look like:Feel free to create unit tests for this as i only tested manually, too tired to write tests right now.