Skip to content

Commit 68b5f20

Browse files
committed
Rename JSONTransport to IOStreamTransport.
1 parent 69a3dea commit 68b5f20

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

libsolidity/lsp/Transport.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@
3030
using namespace std;
3131
using namespace solidity::lsp;
3232

33-
JSONTransport::JSONTransport(istream& _in, ostream& _out):
33+
IOStreamTransport::IOStreamTransport(istream& _in, ostream& _out):
3434
m_input{_in},
3535
m_output{_out}
3636
{
3737
}
3838

39-
JSONTransport::JSONTransport():
40-
JSONTransport(cin, cout)
39+
IOStreamTransport::IOStreamTransport():
40+
IOStreamTransport(cin, cout)
4141
{
4242
}
4343

44-
bool JSONTransport::closed() const noexcept
44+
bool IOStreamTransport::closed() const noexcept
4545
{
4646
return m_input.eof();
4747
}
4848

49-
optional<Json::Value> JSONTransport::receive()
49+
optional<Json::Value> IOStreamTransport::receive()
5050
{
5151
auto const headers = parseHeaders();
5252
if (!headers)
@@ -75,30 +75,30 @@ optional<Json::Value> JSONTransport::receive()
7575
return {move(jsonMessage)};
7676
}
7777

78-
void JSONTransport::notify(string _method, Json::Value _message)
78+
void IOStreamTransport::notify(string _method, Json::Value _message)
7979
{
8080
Json::Value json;
8181
json["method"] = move(_method);
8282
json["params"] = move(_message);
8383
send(move(json));
8484
}
8585

86-
void JSONTransport::reply(MessageID _id, Json::Value _message)
86+
void IOStreamTransport::reply(MessageID _id, Json::Value _message)
8787
{
8888
Json::Value json;
8989
json["result"] = move(_message);
9090
send(move(json), _id);
9191
}
9292

93-
void JSONTransport::error(MessageID _id, ErrorCode _code, string _message)
93+
void IOStreamTransport::error(MessageID _id, ErrorCode _code, string _message)
9494
{
9595
Json::Value json;
9696
json["error"]["code"] = static_cast<int>(_code);
9797
json["error"]["message"] = move(_message);
9898
send(move(json), _id);
9999
}
100100

101-
void JSONTransport::send(Json::Value _json, MessageID _id)
101+
void IOStreamTransport::send(Json::Value _json, MessageID _id)
102102
{
103103
solAssert(_json.isObject());
104104
_json["jsonrpc"] = "2.0";
@@ -114,7 +114,7 @@ void JSONTransport::send(Json::Value _json, MessageID _id)
114114
m_output.flush();
115115
}
116116

117-
optional<map<string, string>> JSONTransport::parseHeaders()
117+
optional<map<string, string>> IOStreamTransport::parseHeaders()
118118
{
119119
map<string, string> headers;
120120

libsolidity/lsp/Transport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ class Transport
6666
/**
6767
* LSP Transport using JSON-RPC over iostreams.
6868
*/
69-
class JSONTransport: public Transport
69+
class IOStreamTransport: public Transport
7070
{
7171
public:
7272
/// Constructs a standard stream transport layer.
7373
///
7474
/// @param _in for example std::cin (stdin)
7575
/// @param _out for example std::cout (stdout)
76-
JSONTransport(std::istream& _in, std::ostream& _out);
76+
IOStreamTransport(std::istream& _in, std::ostream& _out);
7777

7878
// Constructs a JSON transport using standard I/O streams.
79-
JSONTransport();
79+
IOStreamTransport();
8080

8181
bool closed() const noexcept override;
8282
std::optional<Json::Value> receive() override;

solc/CommandLineInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ void CommandLineInterface::handleAst()
896896

897897
void CommandLineInterface::serveLSP()
898898
{
899-
lsp::JSONTransport transport;
899+
lsp::IOStreamTransport transport;
900900
if (!lsp::LanguageServer{transport}.run())
901901
solThrow(CommandLineExecutionError, "LSP terminated abnormally.");
902902
}

0 commit comments

Comments
 (0)