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

Multiple Aliases parsing and Go To Declarations #364

Merged
merged 7 commits into from Aug 4, 2016
Merged

Multiple Aliases parsing and Go To Declarations #364

merged 7 commits into from Aug 4, 2016

Conversation

KronicDeth
Copy link
Owner

Fixes #217

Changelog

Enhancements

  • Regenerate parser with GrammarKit 1.4.2

  • ElixirSdkRelease is now Comparable, so version checks can be done for tests to restrict them to Elixir 1.2+ for multiple alias support.

  • Resolve Multiple Aliases with unqualified Alias in tuples.

  • canonicalName borrows from the idea of PsiReference#canonicalText: an element can have both a Name (from getName), which is the literal name in the code, which can be renamed, and a Canonical Name, which is the name to refer to the element without need for imports or aliases. For this change, defimpl, defmodule, and defprotocol will show their full module Alias for their Canonical Name.

    This change addresses the use case of Go To Declaration that should
    resolved to a nested defmodule.

Bug Fixes

  • Add A.{B, C} to grammar with quoting to check consistence with Elixir 1.2. Ports elixir-lang/elixir#3666.
  • Use fullyQualifiedName instead of getName for resolvableName because fullyQualifiedName is needed so that qualified aliases inside of the { } of a multiple alias will not have a name as getName is null for those qualified aliases because the name from getName has to be a literal name that can be renamed and qualified names can't be renamed.

Includes the ability to quote multiple aliases, but no references yet.
Ports elixir-lang/elixir#3666.
canonicalName borrows from the idea of PsiReference#canonicalText: an
element can have both a Name (from getName), which is the literal name
in the code, which can be renamed, and a Canonical Name, which is the
name to refer to the element without need for imports or aliases.  For
this change, defimpl, defmodule, and defprotocol will show their full
module Alias for their Canonical name.

This change addresses the use case of Go To Declaration that should
resolved to a nested defmodule.
fullyQualifiedName is needed so that qualified aliases inside of the { }
of a multiple alias will have a name as getName is null for those
qualified aliases because the name from getName has to be a literal name
that can be renamed and qualified names can't be renamed.
@KronicDeth KronicDeth merged commit c968150 into master Aug 4, 2016
@KronicDeth KronicDeth deleted the 217 branch August 4, 2016 20:47
@KronicDeth KronicDeth added this to the v4.1.0 milestone Aug 4, 2016
KronicDeth added a commit that referenced this pull request Aug 5, 2016
KronicDeth referenced this pull request in elixir-lang/elixir Aug 6, 2016
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.

Add support for x.{y, z, w} expression
1 participant