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

Annotate module attributes #223

Merged
merged 10 commits into from Dec 26, 2015
Merged

Annotate module attributes #223

merged 10 commits into from Dec 26, 2015

Conversation

KronicDeth
Copy link
Owner

Resolves #132

module attribute

Changelog

  • Enhancements
    • Documentation module attributes (@doc, @moduledoc, and @typedoc) are annotated as "Documentation Module Attributes" while all other module attributes are annotated as "Module Attributes".
    • The string or heredoc argument to a documentation module attribute (@doc, @moduledoc, and @typedoc is annotated as "Documentation Text"
    • Function names passed to @callback, @macrocallback or @specification are annotated as "Specification".
    • Variables/calls in the parameters and return of @callback, @macrocallback, @specification are annotated as "Type".
    • Parameters of @opaque, @type, @typep names are annotated as "Type Parameter"
    • Keyword keys from the when clause of @callback, @macrocallback or @spec definitions and their usage are annotated as "Type Parameters"
    • @doc false, @moduledoc false, and @typedoc false will annotate the false with a weak warning: "Will make documented invisible to the documentation extraction tools like ExDoc.".

Use `CodeInsightColors.ANNOTATION_NAME_ATTRIBUTES` to match color used
for "ERL_ATTRIBUTE" in intellij-erlang.
"Documentation Module Attributes" inherits from DOC_COMMENT_TAG to match
intellj-elixir using DOC_COMMENT_TAG for @doc.
The heredoc or line after `@doc`, `@moduledoc`, or `@typedoc` will be
highlighted as Documentation Text, which defaults to
DOC_COMMENT_TAG_VALUE.
The `@callback` will be highlighted as a "Module Attributes" while the
name of the function itself will be highlighted as "Callbacks".
spec is a "Module Attribute".  Function name is "Specification".
"Callback" now inherits from "Specification" since @callback uses the
@SPEC format.
In @type, @TypeP, and @opaque, arguments to the type name are Type
Parameters that can be filled in later when the type is used.  The type
parameters appear in the definition of the type.  For @SPEC and
@callback, since the argument slots are already used for just the types
of the parameters, the type parameters are supplied as keyword keys in a
when clause.
@KronicDeth KronicDeth self-assigned this Dec 25, 2015
@KronicDeth KronicDeth added this to the v1.3.0 milestone Dec 25, 2015
@KronicDeth KronicDeth merged commit 2061f08 into master Dec 26, 2015
KronicDeth added a commit that referenced this pull request Dec 26, 2015
KronicDeth added a commit that referenced this pull request Dec 26, 2015
@KronicDeth KronicDeth deleted the feature/module-attributes branch January 1, 2016 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant