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

New Project From Existing Sources... #112

Merged
merged 19 commits into from
Apr 17, 2015

Conversation

KronicDeth
Copy link
Owner

Detect the mix.exs projects and automatically marks directories and libraries. _build and rel are marked excluded. lib is marked as sources. test is marked as test sources. The user is prompted to select the Elixir SDK based on the directory above bin/elixir and bin/mix, but the SDK isn't used for anything yet. Support of its selection was only completed in this PR because it was a requirement of defining a new ModuleType.

This implements part of #22 and resolves #79

Verification Steps

  • Prepare plugin for Deployment

Rich Platform support

  • Uninstall old Elixir plugin from IntelliJ IDEA
  • Restart
  • Install intellij-elixir.zip in IntelliJ IDEA
  • Restart
  • VERIFY Steps in README for Feature > Project > From Existing Directory work.
    • File > New > Project From Existing Sources...
    • Select the root directory of intellij_elixir.
    • Leave the default selection, "Create project from existing sources"
    • Click Next
    • Project name will be filled with the basename of the root directory. Customize it if you like.
    • Project location will be the root directory.
    • Click Next.
    • If you previously opened the directory in IntelliJ or another JetBrains IDE, you'll be prompted to overwrite the
      .idea directory. Click Yes.
    • You'll be prompted with a list of detected Elixir project roots to add to the project. Each root contains a
      mix.exs. Uncheck any project roots that you don't want added.
    • Click Next.
    • Select a Project SDK directory by clicking Configure.
    • VERIFY the plugin will automatically find the newest version of Elixir installed.
    • Click OK to accept the automatic SDK in the File Chooser
    • Click Configure to pick a custom SDK.
    • Manually select a different directory without bin/elixir in it.
    • VERIFY the directory is rejected
    • Manually select an older version of Elixir
    • VERIFY the directory is accepted.
    • Click Next after you select SDK name from the Project SDK list.
    • Click Finish on the framework page. (No framework detection is implemented yet for Elixir.)
    • Choose whether to open in a New Window or in This Window.
  • VERIFY _build and rel are marked Excluded
  • VERIFY lib is marked Sources
  • VERIFY test is marked Tests
  • VERIFY External Libraries shows the SDK and included libraries.
  • Open Project Settings
  • Click Libraries
  • VERIFY conform and exrm as listed.

Language Platform support

  • Uninstall old Elixir plugin from Rubymine
  • Restart
  • Install intellij-elixir.zip in Rubymine
  • Restart
  • VERIFY plugin does not crash

Detect mix projects when using New Project from Existing Sources by
their mix.exs.
Adds eex, elixir, ex_unit, iex, logger, and mix paths as library homes.
Mark lib as sources and test as test sources by making them both
DetectedSourceRoots of the ModuleDescriptor.
Mark _build from mix and rel from exrm as excluded.
projectStructureDetector is only available in IntelliJ, so make it's
definition optional so intellij-elixir remains compatible with all
JetBrains IDEs.
@KronicDeth KronicDeth self-assigned this Apr 17, 2015
@KronicDeth KronicDeth added this to the v1.1.0 milestone Apr 17, 2015
@KronicDeth
Copy link
Owner Author

Found bug when intellij-erlang is installed, it's detection of Erlang is winning over intellij-elixir's detection of Elixir. See #112 (comment)

@KronicDeth
Copy link
Owner Author

It doesn't appear when running the plugin in development mode from IntelliJ IDEA. The deployed zip may be messed up.

screen shot 2015-04-17 at 1 47 25 pm

@KronicDeth
Copy link
Owner Author

It's some difference between the deployment intellij-elixir.zip as if I uninstall intellij-erlang I get no types besides Content.

@KronicDeth
Copy link
Owner Author

Ok, so if I don't make the projectStructureDetector optional then the intellij-elixir.zip works. Waiting on email response from @ignatov to see if he knows what I'm doing wrong with the extension setup.

Optional depends on com.intellij.modules.java doesn't work with depends
on com.intellij.modules.lang.  I don't know why.
@KronicDeth KronicDeth merged commit 70c0cab into master Apr 17, 2015
KronicDeth added a commit that referenced this pull request Apr 17, 2015
@KronicDeth KronicDeth deleted the feature/22/existing-elixir-project branch April 17, 2015 20:23
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.

SDK path setup
1 participant