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
2 changes: 1 addition & 1 deletion src/requests/features.jl
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ function webview_html(md)
s = html(md)
if haskey(md.meta, :module)
mod = md.meta[:module]
newhref = string("julia-vscode", '/', mod)
newhref = vscode_cmd_uri("language-julia.findHelp"; searchTerm = mod)
s = replace(s, "<a href=\"@ref\"" => "<a href=\"$newhref\"")
end
s = replace(s, CODE_LANG_REGEX => annotate_highlight_js)
Expand Down
8 changes: 8 additions & 0 deletions src/utilities.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# VSCode specific
# ---------------

nodocuemnt_error(uri, data = nothing) =
return JSONRPC.JSONRPCError(-32099, "document $(uri) requested but not present in the JLS", data)

Expand All @@ -9,6 +12,11 @@ function mismatched_version_error(uri, doc, params, msg, data = nothing)
)
end

vscode_cmd_uri(cmd; cmdargs...) = string("command:", cmd, '?', URIParser.escape(JSON.json(cmdargs)))

# misc
# ----

function uri2filepath(uri::AbstractString)
parsed_uri = try
URIParser.URI(uri)
Expand Down