Comments (1)
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
from csharpier.
Related Issues (20)
- CSharpier Rider plugin mangles UTF-8 characters when running on save HOT 2
- csharpier does not respect editorconfig specific c# rules HOT 2
- Expose IncludeGenerated in CodeFormatterOptions HOT 1
- not support " = []" HOT 5
- Request for support of custom file extensions to scan/fix HOT 1
- [rider] warning about deprecated function HOT 2
- Extensions should show information when file can't be formatted because it doesn't compile.
- charpier do not repect `#pragma warning disable format`
- Third party .editorconfig leading to: Error Failure parsing editorconfig files HOT 1
- Smarter EditorConfig parsing
- dotnet-csharpier process never closes HOT 2
- Umlaute or Currency symbols are not preserved HOT 1
- CSharpier process failed to start (VSCode extension v1.7.0) HOT 2
- Pipe to `dotnet csharpier` fails HOT 5
- Extensions - log when there is a syntax error so csharpier can't format.
- csharpier server and ipv6 HOT 2
- Usings order HOT 3
- Inconsistent formatting HOT 2
- How can I make CSharpier work with Visual Studio? HOT 30
- Comment between attributes violates SA1515 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csharpier.