Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve project main class / class path #968

Open
adminy opened this issue May 3, 2023 · 1 comment
Open

Retrieve project main class / class path #968

adminy opened this issue May 3, 2023 · 1 comment

Comments

@adminy
Copy link

adminy commented May 3, 2023

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#?

@andyleejordan
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants