Skip to content

Commit d90e538

Browse files
committed
Fix extra doc link for missing versions
1 parent c41ac0f commit d90e538

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

apps/language_server/lib/language_server/markdown_utils.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,14 @@ defmodule ElixirLS.LanguageServer.MarkdownUtils do
368368
end
369369

370370
if app_vsn do
371-
{app, _vsn} = app_vsn
371+
app =
372+
case app_vsn do
373+
{app, _vsn} ->
374+
app
375+
376+
app when is_atom(app) or is_binary(app) ->
377+
app
378+
end
372379

373380
if app in @all_otp_apps and @erlang_ex_doc? do
374381
# TODO not sure hos the docs will handle versions app/vsn does not work as of June 2024

apps/language_server/test/markdown_utils_test.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ defmodule ElixirLS.LanguageServer.MarkdownUtilsTest do
293293
) == "[Up and running](http://example.com/foo.md)"
294294
end
295295

296+
test "extra page unknown app" do
297+
assert MarkdownUtils.transform_ex_doc_links(
298+
"[Up](e:unknown_app:foo.md)"
299+
) == "[Up](https://hexdocs.pm/unknown_app/foo.html)"
300+
end
301+
296302
if System.otp_release() |> String.to_integer() >= 27 do
297303
test "erlang extra page" do
298304
assert MarkdownUtils.transform_ex_doc_links(

0 commit comments

Comments
 (0)