Closed my4ng closed 1 year ago
Elixir formatter does not care if no parens or parens version is used. While https://hexdocs.pm/elixir/typespecs.html seems to prefer parens form, the source code of elixir itself prefers no parens. We treat it as a stylistic choice to prefer no parens for builtin types.
Regarding the syntax highlighting, there are no specific rules for typespecs (https://github.com/elixir-lsp/vscode-elixir-ls/issues/311). Parens form gets highlighted as function call (entity.name.function-call.elixir source.elixir), no parens as variable (source.elixir).
Environment
Troubleshooting
.elixir_ls
directory, then restart your editorDetails
As described in the title, the
@spec
annotation suggestion is missing parentheses after each built-in type, and hence they are not properly syntax highlighted, unlike custom defined types which do include the parentheses. I am new to elixir, so I am not sure if there's any rule regarding the consistency.Example:
Custom type
Builtin type