Define Erlang -moduledoc:
-moduledoc "Test: `12345`".
Similarly define Elixir @moduledoc:
@moduledoc "Test: `12345`"
Inspecting 12345 embedded code snippet gives the following highlight groups:
Erlang:
- @attribute.erlang links to Macro priority: 100 language: erlang
- @string.erlang links to String priority: 100 language: erlang
Elixir:
- @constant.elixir links to Constant priority: 100 language: elixir
- @comment.documentation.elixir links to Documentation priority: 100 language: elixir
- @constant.elixir links to Constant priority: 100 language: elixir
- @string.elixir links to String priority: 100 language: elixir
- @comment.documentation.elixir links to Documentation priority: 100 language: elixir
- @spell.markdown links to @spell priority: 100 language: markdown
- @markup.raw.markdown_inline links to Special priority: 100 language: markdown_inline
- @nospell.markdown_inline links to @nospell priority: 100 language: markdown_inline
Erlang moduledoc is highlighted as a plain Macro / String which has two consequences:
- Spell checking is not enabled as it doesn’t link to
@spell. - No syntax highlighting for the embedded code - everything is highlighted as a plain flat string.
Writing Erlang documentation under such restrictions is not easy.
I am using neovim with elp Version: 1.1.0+build-2025-11-04 installed with Mason more or less as described in the elp documentation. Additionally I am installing Erlang treesitter (it doesn’t help much in this case):
require("nvim-treesitter.configs").setup({
ensure_installed = {
"erlang"
...
Are there any options available that could fix/improve -moduledoc highlighting / spell checking?