vscode-elixir-ls: Examples in @doc tags are no longer being rendered

Environment

  • Elixir & Erlang versions (elixir --version): Erlang/OTP 24 [erts-12.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:no-native-stack] Elixir 1.13.2 (compiled with Erlang/OTP 24)
  • VSCode ElixirLS version: 0.9.0
  • Operating System Version: linux 5.13.0-22-generic

Troubleshooting

  • Restart your editor (which will restart ElixirLS) sometimes fixes issues
  • Stop your editor, remove the entire .elixir_ls directory, then restart your editor

Description

Since a few weeks ago (possibly after Elixir and Phoenix updates to latest versions), the context tooltip no longer renders ANY iex> lines from within moduledocs. Yes, not even the stdlib!

If I were to un-tab the iex> lines, they begin to be treated as normal text, and are shown.

I have tested this on multiple projects, including a new mix project. All running inside the latest elixir Docker.

For reference, here is a textual copypaste of the docblock, in case I’ve made a typo:

  @doc """
  Marko `test`

  ## Example:

      iex> AggregateDataParser.parse_csv_file(nil)
      :ok

  ## Test2:
  Marko *test*.

  """
  def parse_csv_file(filename), do: filename |> File.stream!() |> parse_csv_stream
Screenshot 2022-02-14 at 13 02 32 Screenshot 2022-02-14 at 13 02 43

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 17

Most upvoted comments

Hi, It seems to be a problem (in vscode) only for ‘four spaces indented’ code blocks. I tried to write a comment to a ‘js’ function and I had the same problem:

/**
 *> hello()
 *
 *Hello world.
 *
 *## Example ('four spaces indented' code block)
 *
 *    iex> Ex.hello()
 *         :world
 *
 *## Example ('fenced' code block)
 *
 *```
 *    iex> Ex.hello()
 *         :world
 *```
**/
function hello() {
  console.log("Hello World!");
}

vscode-hover-help

Visual Studio Code seems to render only the ‘fenced’ code block. Could you confirm this too?

awesome same for me too!! Although … didn’t it used to have a different background color? To note it’s a code block? Maybe I’m imagining things. Anyhow I’m just happy I got them back 😃

Thanks @lukaszsamson I missed that issue 👍 I hope that they solve the problem, ‘Indented code blocks’ is a markdown spec!

@markomitranic Sorry if I sounded rude.

Yes, a very good idea, don’t you think you should perhaps add it to the roadmap in some way and then someone (perhaps even me) can actually make a PR?

There is no roadmap actually and the project is not very organised ATM. If you would like to contribute then please go ahead. I’d try with transforming the markdown here https://github.com/elixir-lsp/elixir-ls/blob/ba6252f4edb6909a6ce877834178ac7d0ff3f21d/apps/language_server/lib/language_server/providers/hover.ex#L32 But we need to make sure it doesn’t break rendering in other clients

We have 3 options @markomitranic :

  • report an issue to VSCode (this one looks related https://github.com/microsoft/vscode/issues/143081)
  • convince elixir community to format docs in a way that does not break VSCode rendering
  • hack and transform markdown returned by elixir EIP48 API so it renders in VSCode