Skip to content

Commit f7083eb

Browse files
authored
Merge pull request #1004 from fredrikekre/fe/rootUri
Fix error if rootUri is not passed correctly.
2 parents db22ddf + fd5d2a6 commit f7083eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/protocol/initialize.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ function InitializeParams(dict::Dict)
111111
InitializeParams(dict["processId"],
112112
haskey(dict, "clientInfo") ? InfoParams(dict["clientInfo"]) : missing,
113113
!haskey(dict, "rootPath") ? missing : dict["rootPath"] === nothing ? nothing : DocumentUri(dict["rootPath"]),
114-
dict["rootUri"] === nothing ? nothing : DocumentUri(dict["rootUri"]),
114+
# LS specification says this key should always exist, but neovim 0.5.1 doesn't seem to
115+
# send it (seems fixed in neovim 0.6). For now, just assume it might not exist here.
116+
(rootUri = get(dict, "rootUri", nothing); rootUri === nothing) ? nothing : DocumentUri(rootUri),
115117
get(dict, "initializationOptions", missing),
116118
ClientCapabilities(dict["capabilities"]),
117119
haskey(dict, "trace") ? String(dict["trace"]) : missing ,

0 commit comments

Comments
 (0)