csharp-language-server-protocol icon indicating copy to clipboard operation
csharp-language-server-protocol copied to clipboard

Retrieve project main class / class path

Open adminy opened this issue 2 years ago • 1 comments

In a java language server there are plugins that allow extra functions like vscode.java.resolveMainClass and vscode.java.resolveClasspath commands. Is there a similar one for C#?

adminy avatar May 03 '23 19:05 adminy

This is a long shot seeing as how I don't know what those Java functions are doing, but could you perhaps be looking for IServiceProvider.GetService()? We use it do so something like:

WorkspaceService workspaceService = languageServer.Services.GetService<WorkspaceService>();

It resolves the instance of the "service" / class given the type, as long as it was previously registered.

andyleejordan avatar May 03 '23 20:05 andyleejordan