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

Support HTTP #1109

Closed
belav opened this issue Dec 31, 2023 · 1 comment · Fixed by #1236
Closed

Support HTTP #1109

belav opened this issue Dec 31, 2023 · 1 comment · Fixed by #1236

Comments

@belav
Copy link
Owner

belav commented Dec 31, 2023

0.27.2 is adding http support so that the extensions don't need to depend on sending data back and forth via stdin/stdout.

This issue is to get the extensions updated with opt-in support for it.

Rider and VS are started.
VSCode is not.

There needs to be a timeout when calling the server, this doesn't exist in any of them yet.
There needs to be some way to get logs, or have csharpier log what it is doing. To help troubleshoot issues.

@belav belav modified the milestones: 0.27.0, Planned - Extensions Dec 31, 2023
@belav belav changed the title Support GRPC Support HTTP Feb 23, 2024
@blahDL
Copy link

blahDL commented Apr 8, 2024

Have you considered using SignalR or similar to enable you to send messages from the server back to the client?

A SignalR hub like this could work for sending format requests to the server and log messages back to the client:

[Route("communication")]
public class CommunicationHub : Hub<ICommunicationHub>
{
	private readonly CSharpierServiceImplementation _service;

	public CommunicationHub(CSharpierServiceImplementation service)
	{
		_service = service;
	}

	public async Task<FormatFileResult> Format(FormatFileParameter formatFileDto, CancellationToken cancellationToken)
	{
		return await _service.FormatFile(formatFileDto, cancellationToken);
	}
}

public interface ICommunicationHub
{
	Task Log(string message);
}

Then you can create a logger that takes the hub (IHubContext<CommunicationHub, ICommunicationHub>) as a parameter in the constructor then writes the log messages to the client via await hub.Clients.All.Log("the log message")

This would also require changing the clients to connect to the SignalR hub instead of just sending POST requests, but it will allow you to send data in both directions

belav added a commit that referenced this issue Apr 12, 2024
* Rider changes needed to support #1191

* Update CSharpierProcessServer.java

* Always use server when version >= 28

* update readme

* Deal with deprecated warning

closes #1224

* Some cleanup + logging version

* bump version
@belav belav removed the area:rider label Apr 12, 2024
belav added a commit that referenced this issue Apr 12, 2024
the basics of #1109
belav added a commit that referenced this issue Apr 19, 2024
belav added a commit that referenced this issue Apr 19, 2024
belav added a commit that referenced this issue Apr 19, 2024
belav added a commit that referenced this issue Apr 19, 2024
belav added a commit that referenced this issue Apr 19, 2024
closes #1109
belav added a commit that referenced this issue Apr 19, 2024
closes #1109
belav added a commit that referenced this issue Apr 20, 2024
belav added a commit that referenced this issue Apr 20, 2024
belav added a commit that referenced this issue Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants