Archive for the ‘eclipse’ Category

Why Eclipse Equinox P2 Update Manager is not good enough for me yet

Friday, May 16th, 2008

As you all know in Eclipse 3.4 there is a new Update Manager (more correctly - Plug-in Manager) which is intended to be better.

The update managing side of it is an improvement indeed. But the first thing raised my alertness is there is no place to point where do I want my selected plug-ins to be installed. Well, I thought it’s just a default selection and manually downloaded the plug-ins and dropped them into the famous dropins directory (of course with keeping directory structure). And then after restarting eclipse I discovered that there is no such a thing like hierarchy of plug-ins and plug-in locations at all. That’s too bad.

Now, let’s say you installed all the plug-ins. Then if you want to update them, you don’t have a overall progress bar. And this is a network connection related progress. Isn’t it stupid?

Another glitch: My wireless connection to my neighbor’s hub suddenly aborted. So what does it do? It shows me an error dialog behind the modal dialog of progress information. I’m not even mentioning that there is no retry/ignore options.

Now they say: you can replace the new p2 with the good old Update Manager. But for that you must restore several configuration files from 3.3.2. I understand, this is my stupid mistake that I first completely destroyed my previous installation (I can allow it to myself at home), but it’s still annoying.

Working with Eclipse on two displays - Picture

Tuesday, April 1st, 2008

As I mentioned previously, recently I started to work on two monitors. Here comes the picture (sorry for the bad quality):

Working with Eclipse on two displays

Saturday, March 22nd, 2008

Several days ago I was given an additional monitor, and the question of “how to arrange Eclipse view on two displays” was raised. After several tests I made the conclusion that the best way is to stay with my default preferred arrangement, with single difference - to detach and move all the non-editor views to the secondary screen. It frees up editor area and at the same time does not require re-adopting new layout.

The bad news is Eclipse rejects to start up when UltraMon is running.

Java Code Structure and Dependencies Analysis Tools for Eclipse

Friday, February 1st, 2008

One of my first assignments at the new company (remember, I left Zend previous week), was analysing existing projects structure. Which means distribution of classes into packages, package dependencies, libraries usage etc.

The results, I would say, were far from being perfect, but I can bet, most of large (and especially proprietary) projects would look similar or even worse. But this is not what I was going to say.

What I am going to say, is for this purpose I evaluated several analysis tools and I want to share my opinion about them.

Here they are (in order of evaluation).

1. Eclipse Metrics(1) (CPL)

Pros: Runs fast, provides tangle detector.

Cons: Dependencies graph is not usable with large projects. No text output of dependencies is available.

2. Eclipse Metrics(2) (CPL)

Pros: no.

Cons: Does not analyze dependencies.

2. JDepend

Pros: Nice and simple UI, fast analysis.

Cons: Provides neither graph nor detailed dependency cycles information, doesn’t provide links to source.

3. eDepend (Commercial)

Pros: Fully featured graphic dependency analyzer, allows filtering on dependency kind

Cons: Commercial, creates disproportedly wide graphs for large projects that are hard to maintain, very slow analyzing and graph creation, doesn’t provide info on elements which depend on selected element.

4. stan4j (Free Beta)

Pros: Fully featured graphic dependency analyzer, very cute GEF based UI, cycles and tangles visualizer, very convenient eclipse integration, report/graphics export ability.

Cons: Does not provide recursive dependency paths on selected elements, does not provide inter-package class dependencies information, non graphical views improvement is suggested.

Conclusion

In the end, in order to perform my task I’ve mostly used stan4j, sometimes switched to eDepend and once or twice times executed JDepend - each of them has its specific advantages.

Zend Studio for Eclipse Release & cetera

Tuesday, January 22nd, 2008

Dear diary,

I have 2 news for you today.

  1. Today we successfully released Zend Studio for Eclipse. My contribution to it, beyond PDT commitments, is Sebastian Bergmann’s PHPUnit testing framework integration plug-in, File Network support, Organize Includes and other parts of Refactoring engine, Code Coverage browser… well, it seems that’s it. Maybe several additional, but minor things. Enjoy, guys. This is really a great (and some say - the best) PHP IDE.
  2. Occasionally, these are my last days at Zend Technologies. Since next week I’m starting at Nielsen Online (BuzzMetrics) to do text-mining. If you ask why, the answer is simple - I got bored of Zend, where I spent last 6.5 years of my life, and wanted to do something really new and exciting. I hope it will work :) For now I’m planning to stay an Eclipse committer and continue to help my brothers at Zend to move on.

Source

PDT Resource Containers Include Paths

Sunday, December 16th, 2007

Last week I have been working on extending of Include Path Libraries management in PDT and Zend Studio for Eclipse (Neon). The change won’t be released either in PDT 1.0.2 or in Zend Studio for Eclipse GA, but in the next ones (since it changed almost every aspect of products’ functionality).

The change’s idea is very trivial - until now you had the project’s root as a unchangeable default include path and ability to attach another project roots as additional include paths (variable and library functionality is not changed, except several minor bug fixes). And the point is to make the default visible and removable and to allow addition of specific folders both under same project and other PHP projects. Seems simple, huh? Well, it’s not so much.

The main change is very quick indeed - just replace IProject references with IContainer ones, handle properties serialization etc. and you are there. However when you think a bit about the model (classes, functions, constants) it comes that element beyond the specified folders should be invisible from within the project. Thus it was a need to implement a project’s model filtered wrapper, which efficiently cuts the unneeded elements from the model. Also include path order is relevant from now, which affects debugger execution. That’s about all the changes which affect PDT.

However, when Zend Studio for Eclipse comes to a picture, it becomes even more complicated. First of all, you have File Network in it, which is a graph of all PHP files connected by include/require statements. Second you have Organize Includes, Refactoring Move/Rename of file/folder and at last - include content assist (code completion). All of these should respect the change in configuration and also reflect the configuration change in reasonable time.

This time I won’t go deep into implementation, because it’s less interesting by itself and limit myself with just a brief demo:

Demo Thumbnail

Grouped Completion (Content Assist) in PDT

Sunday, November 25th, 2007

Last Wednesday I was working on grouping of code completion (content assist) options. It’s now only exists in CVS and will be (hopefully) released with the build after the next one (the current is already finalized).

Overview

The main point of the feature is collapsing of multiple same-prefixed options into groups, instead of showing a long list of the options. For example if your application is based on Zend Framework or PEAR, most of library’s classes start with “Zend_” or “PEAR_”, and this is what you will get as a completion option. In addition, the grouped list doesn’t show common prefix if an user already typed it.

(Demo)

In general it’s applied to all the types of elements (classes, functions/methods, variables and constants) in all the possible contexts (general completion, doc blocks, new/instanceof etc.). The feature is disabled by default can can be found at:
Preferences->PHP->Editor->Code Assist->Group Completion Options

The logic of the grouping is very similar to completion of files in include statements in Zend Neon and is quite simple:

  1. If there are several options which share common prefix AND there are additional elements which do NOT have this prefix, the sibling elements are collapsed to groups with “…” suffix.
  2. After completion of a group, completion pops up immediately again to show elements with the typed prefix.
  3. If typed prefix has common prefix with proposed elements/groups, it’s collapsed with “…” prefix.

How it works

First, all the types of code completion options are created by objects which extend an abstract CompletionProposalGroup (View Source). The class’ work is to receive an array of CodeData’s and return an array of ICompletionOption’s. This is why the feature’s code is mostly aggregated in this class.
So, instead of just creating a completion option for each element, we should first create a tree of all elements, based on elements’ name chunks separated by “_”, then go over the tree and extract only the relevant elements and groups, and then create chopped completion options for groups and elements. And now in details -

Creating Tree of Elements

CompletionProposalGroup.buildCompletionTree()

Luckily, Eclipse platform provides two base components which made the implementation relatively simple. It’s IPath/Path couple, which provide a comfortable solution for handling abstract OS-like paths, and ElementTree, which is a recursive tree data structure which gives access to it’s nodes based on IPaths.
The first action item here is to create a path from element’s name – it’s done by replacing all delimiters with slashes and providing the result string to Path’s constructor. Then it’s time to recursively create the element – if the parent path is not in the tree, we’ll add it with null data attached (these nodes will represent element groups in the future). After the parents exist, we are adding the element itself to the tree with CodeData object attached.

Extracting relevant Elements and Groups

CompletionProposalGroup.treeRecursiveCreateElement()

In order to get the relevant elements and groups according to 3 rules mentioned above, we basically need to recursively get children of a tree node starting from the root. However if there are no children for current node or the node has sibling(s) - we don’t want to continue deeper inside, and just return the current node. As a result, we get list of elements and collapsed groups to create completion proposals from.

Creating Elements and Groups Completion

CompletionProposalGroup.calcCompletionProposals()

Afterwards, the only remaining thing is to create proposals. For element proposals there is a wrapper proxy PartialProposal for CodeDataCompletionProposal which cuts off matching segments of prefix, and for groups – there is a wrapper proxy TemporaryCompletionProposal for CompletionProposal created with cut prefixes,  which only ovverrides ICompletionProposal.apply() method to reactivate completion immediately group application.

That’s all it’s about.

Hello Eclipse

Wednesday, November 14th, 2007

I’ve just found the new(?) Eclipse.org’s feature to create blogs and decidet to import here my posts from my blog which are more or less related to what I do with/on Eclipse project.

Copying files the Eclipse way

Tuesday, November 6th, 2007

The tip on subject.

PDT CodeDataResolver and ContentAssistSupport Unit Testing

Sunday, October 21st, 2007

Just wrote the subject related article here.

The article explains the concept of editor caret position based Unit Testing of editor links and code completion in PDT.

  • You are currently browsing the archives for the eclipse category.
  • Pages

  • Archives

  • Categories