Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dl, dt, dd tags in Erlang HTML docs #361

Closed
fhunleth opened this issue Jan 20, 2024 · 0 comments · Fixed by #362 or #363
Closed

Support dl, dt, dd tags in Erlang HTML docs #361

fhunleth opened this issue Jan 20, 2024 · 0 comments · Fixed by #362 or #363

Comments

@fhunleth
Copy link
Contributor

Here's the stack trace:

** (FunctionClauseError) no function clause matching in NextLS.HoverHelpers.to_markdown/2
    (next_ls 0.16.0) lib/next_ls/helpers/hover_helpers.ex:6: NextLS.HoverHelpers.to_markdown("application/erlang+html", [{:dl, [], [{:dt, [], [{:code, [], ["root"]}]}, {:dd, [], [{:p, [], ["The installation directory of Erlang/OTP, ", {:code, [], ["$ROOT"]}, ":"]}, {:pre, [], [{:code, [], ["2> init:get_argument(root).\n{ok,[[\"/usr/local/otp/releases/otp_beam_solaris8_r10b_patched\"]]}"]}]}]}, {:dt, [], [{:code, [], ["progname"]}]}, {:dd, [], [{:p, [], ["The name of the program which started Erlang:"]}, {:pre, [], [{:code, [], ["3> init:get_argument(progname).\n{ok,[[\"erl\"]]}"]}]}]}, {:dt, [], [{:a, [id: "home"], []}, {:code, [], ["home"]}]}, {:dd, [], [{:p, [], ["The home directory (on Unix, the value of $HOME):"]}, {:pre, [], [{:code, [], ["4> init:get_argument(home).\n{ok,[[\"/home/harry\"]]}"]}]}]}]}, {:p, [], ["Returns ", {:code, [], ["error"]}, " if no value is associated with ", {:code, [], ["Flag"]}, "."]}])
    (next_ls 0.16.0) lib/next_ls/helpers/hover_helpers.ex:9: NextLS.HoverHelpers.to_markdown/2
    (next_ls 0.16.0) lib/next_ls/helpers/hover_helpers.ex:34: NextLS.HoverHelpers.to_markdown/2
    (next_ls 0.16.0) lib/next_ls/helpers/hover_helpers.ex:9: NextLS.HoverHelpers.to_markdown/2
    (next_ls 0.16.0) lib/next_ls.ex:365: NextLS.handle_request/2
    (gen_lsp 0.7.1) lib/gen_lsp.ex:271: anonymous fn/2 in GenLSP.loop/3
    (telemetry 1.2.1) /private/tmp/cirrus-ci/working-dir/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
    (gen_lsp 0.7.1) lib/gen_lsp.ex:270: anonymous fn/6 in GenLSP.loop/3

To reproduce, call :init.get_argument(:boot) in an Elixir file and hover over it in VSCode.

mhanberg pushed a commit that referenced this issue Jan 21, 2024
This handles the conversion of the description list tag to Markdown.
Markdown doesn't support what can be done with the dl tag, but this
renders something legible for the few cases it's used.

Fixes #361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment