Page 1 of 1

C ++ LSP - IlanguageClient -Connector nicht in Visual Studio 2022 geladen

Posted: 06 May 2025, 11:23
by Anonymous
Ich versuche, einen Sprachkunde mit IlanguageClient in C#

[*] zu implementieren, wenn ich das Projekt starte und eine CPP -Datei öffne, Nichts tritt in
"C/C++ Language Extension";

public IEnumerable ConfigurationSections => null;

public object InitializationOptions => null;

public IEnumerable FilesToWatch => null;

public bool ShowNotificationOnInitializeFailed => throw new NotImplementedException();

public event AsyncEventHandler StartAsync;
public event AsyncEventHandler StopAsync;

event AsyncEventHandler ILanguageClient.StartAsync
{
add
{
throw new NotImplementedException();
}

remove
{
throw new NotImplementedException();
}
}

event AsyncEventHandler ILanguageClient.StopAsync
{
add
{
throw new NotImplementedException();
}

remove
{
throw new NotImplementedException();
}
}

public async Task ActivateAsync(CancellationToken token)
{
await Task.Yield();

ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "C:\\my\\path\\to\\server\\bin\\clangd.exe";
info.Arguments = "";
info.RedirectStandardInput = true;
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
info.CreateNoWindow = true;

Process process = new Process();
process.StartInfo = info;

if (process.Start())
{
return new Connection(process.StandardOutput.BaseStream, process.StandardInput.BaseStream);
}

return null;
}

public async Task OnLoadedAsync()
{
await StartAsync.InvokeAsync(this, EventArgs.Empty);
}

public Task OnServerInitializeFailedAsync(Exception e)
{
return Task.CompletedTask;
}

public Task OnServerInitializedAsync()
{
return Task.CompletedTask;
}

public Task OnServerInitializeFailedAsync(ILanguageClientInitializationInfo initializationState)
{
throw new NotImplementedException();
}
}
}
[/code]