Skip to content

Commit

Permalink
Add more diagnostic output
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Jan 7, 2025
1 parent ea26631 commit 5649aad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/requests/features.jl
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ function julia_getModuleAt_request(params::VersionedTextDocumentPositionParams,
return mismatched_version_error(uri, doc, params, "getModuleAt")
end
else
return nodocument_error(uri)
return nodocument_error(uri, "getModuleAt")
end
return "Main"
end
Expand All @@ -505,7 +505,7 @@ end

function julia_getDocAt_request(params::VersionedTextDocumentPositionParams, server::LanguageServerInstance, conn)
uri = params.textDocument.uri
hasdocument(server, uri) || return nodocument_error(uri)
hasdocument(server, uri) || return nodocument_error(uri, "getDocAt")

doc = getdocument(server, uri)
env = getenv(doc, server)
Expand Down
2 changes: 1 addition & 1 deletion src/requests/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function julia_getCurrentBlockRange_request(tdpp::VersionedTextDocumentPositionP
fallback = (Position(0, 0), Position(0, 0), tdpp.position)
uri = tdpp.textDocument.uri

hasdocument(server, uri) || return nodocument_error(uri)
hasdocument(server, uri) || return nodocument_error(uri, "getCurrentBlockRange")

doc = getdocument(server, uri)

Expand Down
4 changes: 2 additions & 2 deletions src/utilities.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# VSCode specific
# ---------------

function nodocument_error(uri, data=nothing)
function nodocument_error(uri, request_name, data=nothing)
return JSONRPC.JSONRPCError(
-33100,
"document $(uri) requested but not present in the JLS",
"document $(uri) requested but not present in the JLS for request $request_name",
data
)
end
Expand Down

0 comments on commit 5649aad

Please sign in to comment.