-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathconfiguration.jl
112 lines (86 loc) · 2.5 KB
/
configuration.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
@dict_readable struct WorkspaceFoldersChangeEvent
added::Vector{WorkspaceFolder}
removed::Vector{WorkspaceFolder}
end
@dict_readable struct DidChangeWorkspaceFoldersParams
event::WorkspaceFoldersChangeEvent
end
struct DidChangeConfigurationParams
settings::Any
function DidChangeConfigurationParams(d)
if d isa Dict && length(d) == 1 && haskey(d, "settings")
new(d["settings"])
else
new(d)
end
end
end
struct ConfigurationItem <: Outbound
scopeUri::Union{DocumentUri,Missing}
section::Union{String,Missing}
end
struct ConfigurationParams <: Outbound
items::Vector{ConfigurationItem}
end
##############################################################################
# File watching
const FileChangeType = Int
const FileChangeTypes = (Created = 1,
Changed = 2,
Deleted = 3)
const WatchKind = Int
const WatchKinds = (Create = 1,
Change = 2,
Delete = 4)
@dict_readable struct FileEvent
uri::DocumentUri
type::FileChangeType
end
@dict_readable struct DidChangeWatchedFilesParams
changes::Vector{FileEvent}
end
const Pattern = String
struct RelativePattern <: Outbound
baseUri::Union{WorkspaceFolder,URI}
pattern::Pattern
end
const GlobPattern = Union{Pattern,RelativePattern}
struct FileSystemWatcher <: Outbound
globPattern::GlobPattern
kind::Union{WatchKind,Missing}
end
struct DidChangeWatchedFilesRegistrationOptions <: Outbound
watchers::Vector{FileSystemWatcher}
end
##############################################################################
# Registration
struct Registration <: Outbound
id::String
method::String
registerOptions::Union{Any,Missing}
end
struct RegistrationParams <: Outbound
registrations::Vector{Registration}
end
struct TextDocumentRegistrationOptions <: Outbound
documentSelector::Union{DocumentSelector,Nothing}
end
struct TextDocumentChangeRegistrationOptions <: Outbound
documentSelector::DocumentSelector
syncKind::Int
end
struct TextDocumentSaveRegistrationOptions <: Outbound
documentSelector::DocumentSelector
includeText::Union{Bool,Missing}
end
struct Unregistration <: Outbound
id::String
method::String
end
struct UnregistrationParams <: Outbound
unregistrations::Vector{Unregistration}
end
struct StaticRegistrationOptions <: Outbound
id::Union{String,Missing}
end
##############################################################################