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

Structure View #243

Merged
merged 39 commits into from
Feb 25, 2016
Merged

Structure View #243

merged 39 commits into from
Feb 25, 2016

Conversation

KronicDeth
Copy link
Owner

Resolved #97

Changelog

  • Enhancements
    • Structure View
      • Controls
        • Scroll to Source and Scroll From Source
        • Sorting
          • Runtime (functions) vs Compile (macros)
          • Visibility (public [def, macro, etc] vs private [defp, macrop and @typep])
          • Alphabetical
        • Show Used - injects structure from use Alias call's __using__'s quote into the call site Structure
      • Elements
        • Callbacks (@callback) show their name/arity and then a nest spec
        • CallDefinition groups together CallDefinitionClause of the same name/arity
        • CallDefinitionClause (def, defp, macro, and macrop) shows the head of each definition under the CallDefinition.
        • CallDefinitionSpecification (@spec) show the type specification for a CallDefinition
        • CallReference name: arity shows the name/arity for a defoverridable.
        • Delegation shows all the :append_first and :to options with the implied Function Delegation nested underneath
        • Exception (defexception) show the implicit struct and nest any callback functions, such as exception/1 or message/1.
        • Overridable defoverridable tracks overridable functions and is used to mark CallDefinitions are overrides.
        • Quote quote do end models quote blocks so they can be injected use Alias sites.
        • Use use Alias show use calls.

Detect `Kernel.defmodule/2` macro in files or nested in
Modules.

This commit involves a huge changes to how `Call` interface is
structured to allow general {module, function, arity} querying.  It
drops a few rules (or makes them private), so other code that depended
on those rule's interfaces had to change too.
Rename the old Function classes to FunctionClause.  Have a new Function
that has the name and arity of the function and has the FunctionClauses
as children.
An element for the defdelegate call itself with the `:append_first` and
`:to` shared options, then under that an element for each name in first
argument to defdelegate showing the fake implementation.
Use the regex matching so that new methods can be added more quickly.
If an `exception/1` or `message/1` override callback is in the method
after `defexception/1` is called, then those functions are grouped under
the Exception element in the Structure view.
* Fixed bug with ordering of clauses with `when` operations so that
`when/2` doesn't appear as the function name / arity.
* Icons now go: Compile/Run, Type, PackageLocal?, Visibility. defs
  are "Run, Function, Public" while defmacros are "Compile, Function,
  Public"
Use `CallDefinition` for `Function` and `Macro` and
`CallDefinitionClause` for `FunctionClause` and `MacroClause`.  Functions
and macros are differentiated by this `CallDefinition.Time`, which is
`RUN` for functions and `COMPILE` for macros.
Sort Compile (defmacro) before Run (def).  Sort by time before alpha.
Includes generic support for visibility on call definitions and call
definition clauses.
Quote calls are treated as anonymous Modules and any structure that can
occur in a Module before can now also appear in a quote or its
pseudo-Module.
So name/arity under defoverridable element.
Take all the CallReferences from Overridables and use them to make the
function CallDefinitions with the same {name, arity} as overridable.
@SPEC show up as sibling of call definition clauses because the mapping
of @SPEC to clause is not always one-to-one so it better to group
everything under the call definition.
NameArity gains anothere required flag, callback, that will add Callback
icon if true.
Protocol gets Anonymous,Overridden and so Implementation is changed from
just Anonymous to Anonymous,Overriding.
@KronicDeth KronicDeth added this to the v2.2.0 milestone Feb 24, 2016
Don't just override `#getSuitableClasses`, but also `#isSuitable`, so
that the class can be checked with `#is` static functions, which ensures
that clicking in the body of Call scrolls to the clause, which was not
the case previously because the inner most Call would be used.
@KronicDeth KronicDeth force-pushed the 97-structure-view-factory branch from c7acf42 to f693070 Compare February 25, 2016 03:13
@KronicDeth KronicDeth merged commit f693070 into master Feb 25, 2016
KronicDeth added a commit that referenced this pull request Feb 25, 2016
KronicDeth added a commit that referenced this pull request Feb 25, 2016
@KronicDeth KronicDeth mentioned this pull request Feb 25, 2016
@KronicDeth KronicDeth deleted the 97-structure-view-factory branch March 19, 2016 02:33
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.

1 participant