Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/protocol/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ mutable struct CancelParams
end
CancelParams(d::Dict) = CancelParams(d["id"])

const ProgressToken = Union{Int,String}
struct ProgressParams{T}
token::ProgressToken
token::Union{Int,String} # ProgressToken
value::T
end

Expand Down Expand Up @@ -148,11 +147,11 @@ end
##############################################################################
# Progress
struct WorkDoneProgressCreateParams <: Outbound
token::ProgressToken
token::Union{Int,String} # ProgressToken
end

@dict_readable struct WorkDoneProgressCancelParams
token::ProgressToken
token::Union{Int,String} # ProgressToken
end

struct WorkDoneProgressBegin <: Outbound
Expand Down Expand Up @@ -185,7 +184,7 @@ struct WorkDoneProgressEnd <: Outbound
end

struct WorkDoneProgressParams <: Outbound
workDoneToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
end

struct WorkDoneProgressOptions <: Outbound
Expand All @@ -196,5 +195,5 @@ end
# Partial

struct PartialResultParams <: Outbound
partialResultToken::Union{ProgressToken,Missing}
partialResultToken::Union{Int,String,Missing} # ProgressToken
end
16 changes: 8 additions & 8 deletions src/protocol/features.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ end

@dict_readable struct DocumentColorParams <: Outbound
textDocument::TextDocumentIdentifier
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

struct Color <: Outbound
Expand Down Expand Up @@ -196,7 +196,7 @@ end
@dict_readable struct RenameParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
newName::String
end

Expand Down Expand Up @@ -231,8 +231,8 @@ end

@dict_readable struct FoldingRangeParams <: Outbound
textDocument::TextDocumentIdentifier
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

struct FoldingRange <: Outbound
Expand Down Expand Up @@ -260,8 +260,8 @@ struct SelectionRangeRegistrationOptions <: Outbound
end

@dict_readable struct SelectionRangeParams <: Outbound
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
textDocument::TextDocumentIdentifier
positions::Vector{Position}
end
Expand Down Expand Up @@ -289,7 +289,7 @@ mutable struct ExecuteCommandRegistrationOptions <: Outbound
end

@dict_readable struct ExecuteCommandParams <: Outbound
workDoneToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
command::String
arguments::Union{Vector{Any},Missing}
end
Expand Down
20 changes: 10 additions & 10 deletions src/protocol/goto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ end
@dict_readable struct DeclarationParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

##############################################################################
Expand All @@ -40,8 +40,8 @@ end
@dict_readable struct DefinitionParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

##############################################################################
Expand All @@ -64,8 +64,8 @@ end
@dict_readable struct TypeDefinitionParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

##############################################################################
Expand All @@ -88,8 +88,8 @@ end
@dict_readable struct ImplementationParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

##############################################################################
Expand All @@ -114,7 +114,7 @@ end
@dict_readable struct ReferenceParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
context::ReferenceContext
end
4 changes: 2 additions & 2 deletions src/protocol/highlight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ end
@dict_readable struct DocumentHighlightParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

struct DocumentHighlight <: Outbound
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/hover.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end
@dict_readable struct HoverParams <: Outbound
textDocument::TextDocumentIdentifier
position::Position
workDoneToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
end

struct HoverOptions <: Outbound
Expand Down
4 changes: 2 additions & 2 deletions src/protocol/initialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct InitializeParams <: Outbound
capabilities::ClientCapabilities
trace::Union{String,Missing}
workspaceFolders::Union{Vector{WorkspaceFolder},Nothing,Missing}
workDoneToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
end

# Requires handwritten implementaiton to account for 3-part Unions
Expand All @@ -116,7 +116,7 @@ function InitializeParams(dict::Dict)
ClientCapabilities(dict["capabilities"]),
haskey(dict, "trace") ? String(dict["trace"]) : missing ,
!haskey(dict, "workspaceFolders") ? missing : dict["workspaceFolders"] === nothing ? nothing : WorkspaceFolder.(dict["workspaceFolders"]),
haskey(dict, "workDoneToken") ? ProgressToken(dict["workDoneToken"]) : missing)
haskey(dict, "workDoneToken") ? dict["workDoneToken"] : missing)
end
##############################################################################

Expand Down
2 changes: 1 addition & 1 deletion src/protocol/signature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ end
textDocument::TextDocumentIdentifier
position::Position
context::Union{SignatureHelpContext,Missing}
workDoneToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
end
8 changes: 4 additions & 4 deletions src/protocol/symbols.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ end

@dict_readable struct DocumentSymbolParams <: Outbound
textDocument::TextDocumentIdentifier
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

@dict_readable struct WorkspaceSymbolParams <: Outbound
query::String
workDoneToken::Union{ProgressToken,Missing}
partialResultToken::Union{ProgressToken,Missing}
workDoneToken::Union{Int,String,Missing} # ProgressToken
partialResultToken::Union{Int,String,Missing} # ProgressToken
end

struct SymbolInformation <: Outbound
Expand Down