Tag Archives: eclipse

Eclipse 4.2, Lua and execution environments

One of the things that made me want to go and try eclipse again was this advertised Lua Development Toolkit, the LDT. (aka Koneki, have I mentioned how much I hate eclipse’s acronym+codename soup?) Apparently I could develop Lua scripts in eclipse, with syntax highlighting, debugging, documentation and all that good stuff.

So, I made a simple script. I didn’t get any help/luadoc. I did get syntax highlight, but I get that in vim too. Oh, and there’s no “run” configuration. Umm, that’s kinda important. I didn’t set up an “execution environment” because well, I just wanted to use the system lua. Seems that you actually must set up an execution environment so that it knows how to run things and do the luadoc. Except, it’s just some magical zip file. Which is not provided by default and has no documentation on what it should contain.

So yeah, good fucking luck actually using this advertised feature of the Lua Development Toolkit. Another excellent fucking release from eclipse. I try to like eclipse, I try to use it, but for fucks sake.

Eclipse 4.2 spell check and user dictionaries.

So, there’s this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=310237

Which is fine and all, I can switch to the c/c++ spelling check section. But this fails to address the massive fucking pile of fail this is. WHY ON EARTH IS THERE A SEPARATE SPELL CHECK SETTING FOR C/C++?!

I mean, why?! This is not like formatting and tabs where you might want different per language settings. But spell check settings based on whether I’m in C, python, java or lua?! HELL NO!

Eclipse 4.2 Juno and C projects detecting include paths

Eclipse moved from 3.7 right up to 4.2, and it includes Lua now as well, so I thought I’d have a quick go at trying it out on some C projects again. It was less than awesome, but well, that’s eclipse I guess.

I chose File->New->”Makefile project with existing sources”, and selected the path to my project. I can’t find a combined “clean and build” but I cleaned and built, and it all mostly sort of worked.

Except, it completely failed to recognise the -I and -L flags from my Makefile. Which are important. That’s why they’re there. So, it builds, but you can’t navigate to any of the libraries you’re using, and your screen is full of red errors about undefined fields.

Under Project Properties->C/C++ build->Discovery options, there’s an unchecked setting for “Automate discovery…” but checking it just produces a warning that this is deprecated, and to use, “Preprocessor include paths, macros, etc” Good fucking job eclipse. Why have an option that you’ve decided to remove.

So, Project Properties->C/C++ General->Preprocessor include paths… (What’s the difference between build and general? fuck knows, classic eclipse UI design) And then “CDT GCC Build Output Parser”

Now, I never would have actually found this, but they have this pattern that’s apparently meant to help it find the calls to GCC in the makefile output. The default is (gcc)|([gc]\+\+)|(clang)

Now, on linux, by default, “cc” is gcc. and if you don’t override the CC variable in your own makefile, it will be invoked as cc. Which eclipse then completely ignores. I know that it’s not a good idea to always assume that cc is gcc, but hey, if it detected nothing when I ran the build, perhaps it should offer some other alternatives? Perhaps it should try and run cc and look at it’s version? Perhaps it should follow the symlinks?

If you want to fix it, use this text instead (gcc)|([gc]\+\+)|(clang)|(cc)
Then do a clean, a build, then right click your project, chose index, and choose rebuild.

Presto. The eclipse way.

Early impressions with PyDev 2.2 and Eclipse 3.7

I’ve been happily using netbeans for C/C++ and python work, which works well enough to not really complain much. Mostly, I want IntelliJ for C code. I find eclipse big and clunky and awkward on the keyboard, and just generally a pain. No Eclipse, I do NOT want to have some sort of “workspace” I want you to just leave things where they are on the disk. Anyway, in Oracle’s infinite wisdom, they are continuing to destroy things that Sun built, and python support has been dropped in netbeans 7. A pity, as netbeans 7 added some nice debugging support for C/C++, and netbeans is much more tightly integrated than eclipse. Still a pale shadow of IntelliJ, but I digress.

So, I had to go and look for some alternative python editors. I’m currently trying out PyDev 2.2 with Eclipse 3.7. It mostly works ok too. It’s capable of running some unit tests, and has the basic highlighting and so on. However, it’s completion is not as good as I would like, nor think it should be. Take this for example.

def something(self):
    self.mylist = []
    # on this line, self.mylist. will give me the full builtin completion for lists
    self.otherlist = "blah blah".split()
    # split returns a list, but self.otherlist. has no completion here

It seems this can be worked around by “pre declaring” the type.

def something(self):
  self.somelist = []
  self.somelist = "blah blah".split()
  # self.somelist. produces full completion for list here....

This is…. odd?

Possibly related is that in python unit tests, I at least, normally use the self.assertEquals(left, right, msg) form, probably because I came from Java. However, self.assertEquals in PyDev doesn’t give me any completion guidance on the parameters at all. It turns out that in the implementation of python’s unittest, assertEquals is simply an alias for another function (assertEqual = assertEquals = failUnlessEqual) For whatever reason, this means that I get full completion and parameter help if I use the _real_ implementation, failUnlessEqual but no advice/help whatsoever if I use the assertEquals form.

Google says this is unhelpful.

  • “self.assertEquals python” returns 74300 results
  • “self.failUnlessEqual python” returns 35800 results

Update: this assertEquals vs failUnlessEqual is apparently only a problem for python < 2.7. Unfortunately debian stable (squeeze) at present still uses python 2.6 :( In more mundane items, I would _really_ like to know how to get IntelliJ's "ctrl-W" shortcut, for expanding a selection. (From the cursor in the middle of "karl" in the following line, 'self.wop = "this is karl in python".split()', pressing ctrl-w once would highlight 'karl', once more would select 'this is karl in python' (without the quotes), once more with the quotes, and then on to the entire rvalue, then the entire line. This stackoverflow post mentions a solution, but it doesn’t seem to work in PyDev windows, even after getting into the keymap and adding a “Select Enclosing Element” for the PyDev views (or the editor scope? the difference being?) it still doesn’t work.

Oh well, life goes on.

problems with webmethods developer/designer 8 (eclipse based)

So I’ve upgraded from v7 of webmethods developer (with the custom three column sort of view) over to v8 of webmethods designer (eclipse based)

Here are the stupid, annoying, weird things that I haven’t managed to fix (yet?)

  • Entire flows are marked in grey until you check them out for editing. I don’t want to edit it, but I want to be able benefit from having a colour screen. I also want to be able to separate disabled steps. Sure, the icons are still there, but it’s all grey.
    Which steps are active?

    Which steps are active?

  • Comments on a flow are now a single line property. They used to be a whole panel of free form text. Given how awkward it is to comment the “code” any other way, and given that this is the only place to put any overall comments on the whole flow, and given how crap the VCS integration is (at least in our setup?) this box is pretty important for staying sane. yes, you can use the “…” link to get into a box editor, and i’ll probably get used to this one, but it used to be a bit easier
  • No keyboard shortcut to expand the flow. And no config setting to always start expanded. Although right and left arrows will open and close, they only open/close a single level. That’s not good enough.
  • Pressing delete on the keyboard doesn’t work for flows/folders in the Package Navigator. It does work for flow steps. Even though right click “delete” shows Delete as being the keyboard shortcut
  • Enough for now. bleh.

eclipse 3.6 and maven archetypes with IAM/q4e

Ok, IAM for maven integrations fails the big one. It still uses the v1 archetype plugin in maven, so it completely and utterly fails to generate archetypes that are remotely recent.

Secondly, it only uses an internal list of archetypes, even if there’s more installed in your local ~/.m2 repository, and there’s no way of browsing on a remote repository, you have to type in all of it. (Intellij 9 also does this, but at least it can then do the generation steps!)

So, how about running archetype:generate from the command line, and then importing it into eclipse?

well, that kinda works. I made a new empty project, and chose to import a maven project. I pointed it at the base dir of my generated project, and it detected the two child modules, and with “experimental parents” enabled, it generated me 3 projects. Apparently that’s how eclipse works. kinda lame. My parent project has all the source of the inner projects.

This was using eclipse 3.6.1, and Eclipse IAM version

WebMethods Designer 8 with eclipse 3.6

SoftwareAG’s webmethods designer 8, the eclipse based replacement for “Developer” comes packaged into a rather old version of eclipse, 3.4. if you’d rather use it with, say, 3.6, here’s what you need to do…

Install it as it likes, then open up c:\softwareAG\eclipse\updates. This is the goodness :)

Start up your eclipse 3.6, and under “help->install new software” choose “add” then “archive” and find first of all, the com.softwareag.common.zip and install it. The feature should install happily there.

But, to install the DeveloperPlugins.zip, you need to do a bit of hackery.

Inside the zip, open up features/com.softwareag.is.feature_8.1.0.0000-0193.jar, and then open up com.softwareag.is.feature_8.1.0.0000-0193.jar (your version may differ, but it should be much the same)
Then, open up feature.xml and you’ll see the following list of requirements:

      <import feature="org.eclipse.gef" version="3.4.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.wst" version="3.0.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.jst" version="3.0.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.platform" version="3.4.2" match="greaterOrEqual"/>

Unfortunately, org.eclipse.wst and org.eclipse.jst don’t exist anymore, they’ve been broken up into smaller pieces, and renamed.

Remove those two lines from the requires list, and replace them with this:

      <import feature="org.eclipse.gef" version="3.4.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.wst.ws_core.feature" version="3.2.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.jst.web_core.feature" version="3.2.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.jst.enterprise_core.feature" version="3.2.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.jst.server_core.feature" version="3.2.0" match="greaterOrEqual"/>
      <import feature="org.eclipse.platform" version="3.4.2" match="greaterOrEqual"/>

Save your way all the way back out, and then use this zip as a software source as before, and the new feature should install just fine :)

You may not need all three jst.XXXX_core features, but this was enough to get it working for me.

oh, You’ll know you need this, if you get the following errors when you try and install from the original .zip files.

Ack, try and get back to the initial state where this didn't work to catch the whole error message to make googling easier.