Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

User:Karol.gusak.eu/GSoC Proposal Orion Web IDE PHP Editor

< User:Karol.gusak.eu
Revision as of 17:57, 5 April 2011 by Karol.gusak.eu (Talk | contribs) (PHP Editor Features)

Abstract

Orion is a new open source project which aim is to provide client-side and server-side architecture for building web-based development tools. Its ambitious goal is to mimic the desktop success of the Eclipse Platform in web environment, becoming the full-featured open source tool integration framework for web-based software development.

To achieve this goal, Orion needs to be designed and developed with great flexibility in mind. Thanks to self-hosting development method Orion is being continuously tested for client-side technologies, such as JavaScript, HTML5 and CSS. However, the real test for platform's flexibility and extensibility is to develop support for new programming language, which is not in the group of primarily targeted languages.

Orion's support for PHP – one of the world's most popular languages – is very important for platform's future success, while the mature codebase of Eclipse's PDT project will provide invaluable help in implementation of PHP editor features. I propose to implement PHP support in Orion Web IDE as my Google Summer of Code 2011 project.


Current Status of Open Source Web-Based PHP Editors

After conducting a small research about existing web-based PHP editors and IDEs, I came to following conclusion. Most of the solutions are not open source, and often not free. Furthermore, their design is remarkably different from Orion's – they bring desktop experience into a browser, trying to resemble desktop UI as much as possible, whereas Orion's goal is to use the web as the development environment, adhering all of its principles. Web-based PHP editors released under any open source license are sparse. Some of the open source PHP editor projects are abandoned or not updated for more than a year, like IDE.PHP [1], mEdit [2] or CodePress [3]. However, few projects are being actively developed and are worth mentioning.

The CodeMirror [4] is a general-purpose JavaScript library for assisted-editing of code-like content, available under MIT-style license. Despite the early stage of development, the library handles source highlighting, indentation, and simple autocompletion.

Another interesting project is Ace (Ajax.org Cloud9 Editor) [5] developed by Ajax.org and Mozilla. It's a standalone code editor component, used by Cloud9 IDE (among others). It supports syntax highlighting for many languages (including PHP), code indentation, key bindings and more. It's worth noting that Ace and CodeMirror defined a specification document for JavaScript syntax highlighting engines [6].


Current Status of Orion

I analyzed the Orion's' client-side code related to the implementation of PHP editor functionality. For example, adding PHP syntax highlighting would mean modifying styler.js file from org.eclipse.orion.client.editor bundle, as there is no extension mechanism implemented for this functionality yet. In case of code completion and assistance, keyword completion could be achieved by altering contentAssist.js code. For syntax checking a dedicated service exist called IEditorSyntaxChecker which can be used to provide this feature for PHP files.

In Orion's current state, there is a risk that implementation of PHP editor features could resemble a bunch of hacks instead of a proof for Orion's extensibility. However, Orion is still in a very early and active development phase and because of this fact the architecture design is expected to change. John Arthorne told me on the orion-dev mailing list [7] that implementation of extension points (among other important changes) is planned for the next milestone, M7. As the deadline is set for April 29th, I will have time for familiarizing myself with changes and finding the best way for adding PHP editor features (the GSoC 2011 coding period starts on May 23rd) while conforming to new design solutions.


PHP Editor Features

The research part of my proposal allowed me to define a set of features that form a good web-based PHP editor (sorted by importance):

  • Syntax highlighting (coloring)
  • Syntax checking (code validation)
  • Code formatting (auto indentation)
  • Code autocompletion (content-assist)
  • Outliner (list of fields and functions / methods defined in file)
  • Class and method definition finder ("jump to definition")
  • Bracket highlighting (parentheses matching)
  • Syntax expansion (code templates)
  • Smart paste (indent on paste)
  • Code folding (function / method collapse)

During the discussion with Jacek Pospychala and others we came to conclusion that it'll be best to concentrate on one feature and make it as good as possible, and then implement few other features being a proof of concept, as opposed to trying to develop a lot of features with mediocre quality.

The main feature I've chosen is "code autocompletion", because it's more challenging than most of others. It also can be done in parts, starting with very limited but usable functionality, and extending it by more production-like solutions.

The proof of concept features are "syntax highlighting", "syntax checking", "outliner" and "class and method definition finder". They will be implemented with smaller scope than the main feature.

Difficulty levels and relations between features were taken into account in Timeline section of this proposal – as a result they are planned to be implemented in different order than presented above. In situation when any feature will need to be withdrawn or will take significantly less time to implement than expected, one of remaining "reserve" feature will be taken into its place. On the other hand, in case of encountering a problem I won't be able to solve in reasonable time, I'll narrow the scope of feature functionality in order to meet the deadlines. Such approach provides great flexibility while ensuring maximal contribution to the project.

Implementation Details

[work in progress]

Syntax highlighting

  • Integrate highlighting from Ace / implement support for their's syntax highlighting specification

Syntax checking

  • Doing "php -l" on file and returning error information
  • Using ANSLR

Code autocompletion

  • Consists of two parts:
    • Completion of standard PHP functions and PHP language syntax
    • Completion of user-defined classes, methods, fields, etc
  • Can use ANTLR to create AST

Deliverables

  • Example implementation PHP editor in Orion with many interesting features
  • Proof of Orion architecture's flexibility and extensibility
  • Documentation of implementation details and usage instructions for PHP editor
  • Documentation of potential Orion's architecture obstacles which may hinder implementation of additional programming languages' support


Timeline

Prior to May 22

  • Get familiar with new features of Orion M7
  • Decide about final implementation details
  • Identify potential problems that may occur during development

May 23 -May 29

  • Implement PHP syntax highlighting

May 30 - June 5

  • Implement code formatting for PHP files

June 6 - June 12

  • Develop outline support for PHP files
  • Integrate bracket matching for PHP functions

June 13 - June 19

  • Add "Jump to definition" feature for functions and methods in same file
  • Implement code completion for PHP standard functions

June 20 - July 3

  • Implement code validation (syntax checking) feature

July 4 - July 10

  • Solve problems with features implemented up to this point (before midterm evaluation)
  • Start implementing content assist feature

July 11 - July 24

  • Implement content assist feature

July 25 - July 31

  • Add "Jump to definition" feature for functions and methods defined in another file

August 1 - August 7

  • Develop syntax expansion feature for PHP constructions (loops, conditional statements)

August 8 - August 14

  • Add more templates to syntax expansion feature
  • Solve problems with implemented features; final touches

August 15 - August 21

  • Write the documentation of the newly implemented PHP editor internals and usage
  • Write the documentation of problems and obstacles in Orion design encountered during the implementation process of PHP editor


About me

I'm a 22 years old CS student and Software Engineering passionate, currently living in Poland and attending the Bialystok University of Technology. I'm on my 4th year (1st year of graduate studies - I got my BSc degree in February). Recently I was also accepted to Software Engineering programme at Chalmers University of Technology in Göteborg, Sweden. I'll abort my current studies and start the graduate (Master) level at Chalmers in autumn.

I'm a successful GSoC 2010 participant. I was working with FLOW3 – a PHP Web Application Framework of TYPO3 Association. I was also contributing code during some months after the GSoC (until the degree project came up). My task was providing the internationalization and localization subsystem for the framework (implementing selected features from Unicode's CLDR specification). You can find my contributed code in trunk: [8] (unit tests: [9]). I was also blogging regularly about the progress: [10].

My BSc degree project's main task was to create an OpenGL benchmark for Android. I learned some basics of OpenGL ES and 3D graphics rendering in general, as well as Android development. The application consists of several demo-animations rendered in real-time, which present different parts of OpenGL ES functionality.

I'm comfortable with PHP and Java. I know basics of JavaScript I can learn fast with little or no assistance. I have solid Computer Science knowledge from my undergraduate course, as well as considerable programming experience thanks to GSoC and other activities I undertake in my spare time. I'm also familiar with open source development workflow and tools. Programming is my hobby and I find learning new technologies and languages rewarding.

This is going to be (I hope ;-)) a second year of my participation in Google Summer of Code, so I have an experience how it all works. Furthermore I was preparing myself for a quite long time. I planned to apply for one of other Eclipse projects, but when Orion came up on the ideas' list I knew I need to apply there. I'm sure that Orion will become a big player in field of web-based IDEs in a very near future. The possibility to make my own small contribution towards this goal is very appealing to me. Also, by participating in this project I'll expand my programming and software engineering knowledge, and gain the opportunity to observe day-to-day real-life development process of a new open source software project.

I'm a good candidate for Orion project because I have many traits very important for successful GSoC participant. I'm hard working, fast learning and eager to learn. I'm a type of a person who always tries to plan and organize a work ahead and gets deadlines seriously. I also undertake activities beyond my university course in order to continuously expand my knowledge and become a professional. I hope I'll be allowed to make positive difference for Orion development.

Please visit my homepage [11] for additional information about me. Should you have any questions, please contact me: karol@gusak.eu or kgusak at Freenode.


Bibliography

Back to the top