11

I just installed the EclipseFP plugin into my Eclipse setup (on Windows 7 32bit, if that matters), following the instructions. Then I followed the directions in the Eclipse help docs to create a Hello World project successfully.

However, I'm fairly certain something is wrong, though I cannot figure out what. First of all, there's no syntax highlighting, even if I explicitly open files with the Haskell Editor. Secondly, hitting run launches the GHCi console in the Console tab. This is actually fairly useful, but does not sound right, since it doesn't run the file, only compile and load it. Additionally, the Outline view is empty, even when I open a moderately large Haskell file.

Last but not least, the project initially reported there was no Haskell implementation configured. I went into the preferences (though this is not described as being necessary anywhere) and manually added a GHC implementation, pointed to the bin directory of my Haskell Platform installation. As best I can tell, however, this has had no effect.

2 Answers 2

19

EclipseFP appears to no longer be actively maintained; use at your own risk.


After a lot of great help from the developers of EclipseFP on their mailing list, I put together a set of instructions for installing the current (2.0.2) version of EclipseFP. You can read my email but below are the instructions - it's long, but not as hard as it looks, and the result is quite nice:

  1. Install GHC/GHCi - but you've done that already, right?
  2. Install Eclipse 3.5+ If you haven't already got Eclipse (why not?!) download it - either the IDE for Java Developers if you're inclined to use it with Java as well, or just Eclipse Classic if not. "Installation" consists simply of extracting the eclipse folder somewhere and launching the eclipse executable, there is nothing to actually install. It prompts you to select a workspace, your user folder or your documents folder are good choices if you don't have a preference.
  3. Install the EclipseFP plugin In Eclipse go to Help > Install New Software and paste http://eclipsefp.sf.net/updates into the Work with: field - hit enter. In the box below "Functional Programming" should show up after a few moments, cancel and retry it if it doesn't. Expand "Functional Programming" and check the 2.x.x Haskell Support plugin. Follow the rest of the steps, and EclipseFP will be installed, and will prompt you to restart Eclipse.
  4. Update Cabal While you're waiting, launch a command prompt window (type cmd in the start bar on Win Vista/7) or terminal and enter 'cabal update'. This will update the packages Haskell needs in order to let EclipseFP work.
  5. Configure EclipseFP Go to Window > Preferences and expand the Haskell section. Click on "Haskell Implementations" and click "Add". Enter a reasonable name (I called it "Haskell Platform") and then browse to the bin directory of your GHC installation, which on Windows is something like "C:\Program Files\Haskell Platform\2010.2.0.0\bin". It will populate the Version and Library folder items below, click Ok. Click OK to save these preferences, then open the preferences window again. Go to "Scion and Cabal" and click "Autodetect" on the right. It should add an item to the list of Installed Cabal implementations, but if it does not, click add, give it a name like "Cabal" and give it the path to the Cabal executable, which on Windows is something like "C:\Program Files\Haskell Platform\2010.2.0.0\lib\extralibs\bin\cabal.exe". Hit OK, and click Rebuild on the right to tell EclipseFP to build the "Scion server" which handles the syntax highlighting and file parsing. Optionally under Editor check "Show line numbers" and uncheck "Show print margin", I think it makes the editor pane look better. Then hit OK to exit preferences.
  6. Build the Scion Server In theory, upon exiting the preferences window, EclipseFP will start doing a lot of work to build the Scion server. If it does not, simply exit and restart Eclipse, and when it's restarted it will start building. With any luck, this will run for a few minutes and then be done, however you may run into some trouble due to the finicky nature of Haskell's/Cabal's versioning system. If it fails, try running "cabal update" again, or running something like "cabal install network-2.3" where network-2.3 is a package the build script reported wasn't right. Once the Scion server is built, we're basically all set. Restart Eclipse one more time for good measure.
  7. Create a Haskell Project Switch to the Haskell perspective if this hasn't happened already - top right corner, click the Open Perspective icon, click Other if you don't see Haskell in the list, and select Haskell from the popup. Now go to File > New > Haskel Project (or Project and then select Haskell Project) and create a project. To create your first Haskell file, right click on the src flolder in the project and select New > Haskell Module. This creates a Haskell file, you can do whatever you want with it. To run the file, click the Run button (green circle, white triangle) near the top. This will launch a basic GHCi terminal in the Console tab below with the prompt "Prelude>" if the file has errors, or "MODULENAME>" if it compiled successfully. You can use this like the external GHCi terminal to run commands like :t, or to make function calls of the module.
  8. Configure How The File Runs One last thing which will make your life easier is to tell EclipseFP to automatically reload the file when it's saved, and to run a function (for instance "main") after the file is reloaded. To do this, click on the down arrow next to the run button, and select "Run Configurations". Click on the configuration on the left of the file you want, then click on the Automation tab. Check "Reload packages on save" if you don't want to have to type ":r" all day, and type a function name like "main" and check "Rerun command after reload" to run a command automatically.
4
  • @dimo - I just had "Could not locate the executable to launch" on run and I set the GHCI and I set the run configuration to "Haskell Application" and working directory as my project folder. It still does that on WIndows. On Ubuntu it did that at first and then I closed Eclipse and opened it and made a new project and it magically worked. But on Windows I am f*cked. Feb 11, 2016 at 2:45
  • I'd guess you missed a step. Did you install Cabal and build the Scion server? If you followed all the steps here and it's not working, I'd suggest starting a new thread on the EclipseFP mailing list and linking to this post.
    – dimo414
    Feb 11, 2016 at 11:56
  • In step 4, you said "while you are waiting"; does it refer to step 3? i.e. does it mean step 4 can be carried out while step 3 is in progress?
    – user477799
    Jul 6, 2016 at 19:30
  • @FleetCommand yes, cabal can be updated while EclipseFP is being installed - it's only needed once you try to run the plugin.
    – dimo414
    Jul 6, 2016 at 22:42
1

EclipseFP Plugin is not maintained since 2015-05-14 and does not seem to work with recent versions of Eclipse.

2
  • @David, if you look carefully you will see the other answer duplicated mine. The note at the top was added after I posted my answer. Without that note it was misleading and caused me to spend considerable time trying to get it to work before releasing it simply does not work anymore.
    – Kaveh
    Jul 10, 2016 at 16:13
  • Oh, I didn't spot the edit. Sorry.
    – DavidPostill
    Jul 10, 2016 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .