Seva Lapsha at Work & around

Software Architect, Project Lead

Archive for the ‘pdt’ Category

Phing plugin for Eclipse PDT

with 6 comments

I love Ant integration into Eclipse JDT – it provides smart editor, handy auto-completion, and the most important – fully functional debugger.

Recently I have been laboring on porting a deployment system from shell scripts to Phing, a loose PHP port of Ant. And naturally, I miss the above. I still get a little aid from Eclipse – since Phing’s syntax is very close to Ant’s, I can at use Ant editor for Phing files to enjoy property navigation and target integrity validation.

I would be more than happy to announce that I’m going to fill the gap and implement Phing plugin for Eclipse PDT, but unfortunately – I’m too busy and too lazy. On the other hand, if you, my dear friend, will suddenly decide to accept this challenge, I can gladly invest my time in architecture, design, review & testing free of charge. :) Or should I anyway try to start it myself?

Written by Seva

2010-04-15 (April 15) at 12:31:09

Eclipse Committer Emeritus

leave a comment »

Time passes and doesn’t wait, and some of the plans don’t be realized, you know. So due to last year inactivity my PDT committer rights were expired and I was appointed with the Eclipse Committer Emeritus status. How sad.

I will still try to not loose connections and relations with my good old friends and will do my best for the project’s success (even if it will be just mental support).

Written by Seva

2009-08-12 (August 12) at 12:24:55

Posted in development, eclipse, past, pdt

Tagged with

Iterators in PHP

leave a comment »

Recently, while playing with Scala/Python/PHP comparative implementation of lazy algorithms (I will hopefully describe them some days later) with colleague and friend of mine Michael Fuks, I sorrowfully discovered that, despite there are several SPL units, which define basic Iterator interfaces and functionality, most of the functionality available for arrays is missing for Iterators.

So I decided to fill the gap and started to reimplement for Iterators the applicable non-trivial array functions and also started trying to simulate iterator comprehension (generator routines) in PHP which is missing there too. For this reason I opened a GoogleCode project of php-iterator-utils – please observe my first experiments here.

In addition I need to notice that latest NetBeans build (6.8) branch has great PHP 5.3 support and feels more stable, fast and functional than Eclipse PDT :(

Written by Seva

2009-08-03 (August 3) at 03:46:35

Aptana “steals” PDT code

with 4 comments

Long time ago I set up Google alerts to receive new search results related to myself. And today I’ve discovered that Aptana steals prepares derivative work of PDT code.

The only visible “derivation” there is they changed package names, though. :)

Written by Seva

2009-01-05 (January 5) at 10:03:19

Zend Studio for Eclipse Creators

leave a comment »

As I mentioned, yesterday we released the 1st version of Zend Studio for Eclipse (it was released under version 6.0 however, to continue the line of Zend Studio numbering). And I think, my dear diary, that you should see these extraordinarily talented people that sacrificed their minds and hearts to make it possible. Here are they:

Zend Studio for Eclipse Creators

Written by Seva

2008-01-23 (January 23) at 02:33:22

Zend Studio for Eclipse Release & cetera

leave a comment »

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.

Written by Seva

2008-01-22 (January 22) at 06:21:52

PDT Resource Containers Include Paths

with one comment

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

Written by Seva

2007-12-16 (December 16) at 06:37:52

Grouped Completion (Content Assist) in PDT

with 2 comments

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.

Written by Seva

2007-11-25 (November 25) at 06:52:43

Copying files the Eclipse way

leave a comment »

The tip on subject.

Written by Seva

2007-11-06 (November 6) at 07:10:00

Posted in eclipse, java, pdt

PDT CodeDataResolver and ContentAssistSupport Unit Testing

leave a comment »

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.

Written by Seva

2007-10-21 (October 21) at 04:44:00

Posted in eclipse, java, pdt, unit testing

Follow

Get every new post delivered to your Inbox.

Join 602 other followers