-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from julia-vscode/static-dispatch
Add static message dispatch option
- Loading branch information
Showing
6 changed files
with
171 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export JSONRPCEndpoint, send_notification, send_request, send_success_response, send_error_response | ||
|
||
include("pipenames.jl") | ||
include("core.jl") | ||
include("typed.jl") | ||
include("interface_def.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function generate_pipe_name() | ||
if Sys.iswindows() | ||
return "\\\\.\\pipe\\jl-$(UUIDs.uuid4())" | ||
else | ||
return tempname() | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
using JSONRPC: @dict_readable, Outbound | ||
@testmodule TestStructs begin | ||
using JSONRPC: @dict_readable, Outbound | ||
|
||
@dict_readable struct Foo <: Outbound | ||
fieldA::Int | ||
fieldB::String | ||
fieldC::Union{Missing,String} | ||
fieldD::Union{String,Missing} | ||
end | ||
export Foo, Foo2 | ||
|
||
@dict_readable struct Foo2 <: Outbound | ||
fieldA::Union{Nothing,Int} | ||
fieldB::Vector{Int} | ||
end | ||
@dict_readable struct Foo <: Outbound | ||
fieldA::Int | ||
fieldB::String | ||
fieldC::Union{Missing,String} | ||
fieldD::Union{String,Missing} | ||
end | ||
|
||
@dict_readable struct Foo2 <: Outbound | ||
fieldA::Union{Nothing,Int} | ||
fieldB::Vector{Int} | ||
end | ||
|
||
Base.:(==)(a::Foo2,b::Foo2) = a.fieldA == b.fieldA && a.fieldB == b.fieldB | ||
Base.:(==)(a::Foo2,b::Foo2) = a.fieldA == b.fieldA && a.fieldB == b.fieldB | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters