Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Google Summer of Code 2015/JDT UI Code Completion and Refactoring"

(Details on Substring completion)
 
(2 intermediate revisions by the same user not shown)
Line 24: Line 24:
 
<strike>Configure my workspace for the work, including Gerrit setup</strike>
 
<strike>Configure my workspace for the work, including Gerrit setup</strike>
  
== Details on Substring completion ==
+
== Code ==
  
=== Matching Rule ===
+
The code will be available on GitHub:
 +
https://github.com/gaborbsd/JDT_UI_SOC2015
  
# If the pattern only contains lower case letters, any member that contains the pattern as a substring is matched.
+
== Details on Substring completion ==
# If the pattern contains upper case letters, the list of matches is equivalent of the matches of the regular expression that is constructed in the following way. Before each upper case letter, \p{javaLowerCase}* is inserted, that is, an arbitrary number of lower case letters are allowed.
+
  
=== Implementation Plan ===
+
Substring code completion will offer any possible suggestions that the pattern matches in a case insensitive way. However, matches that match exactly or match the camel case initials, will be listed with a higher relevance.
  
Code completion code in JDT relies on search functions, so this work mostly consists of implementing the underlying search function that retrieves results based on the algorithm described above. Search-related code is located in the org.eclipse.jdt.internal.core.search package of JDT Core. This subsystem is accessed through the BasicSearchEngine class. Its methods take a SearchPattern instance that describes, what has to be exactly matched. Several subtasks of matching and indexing are delegated to SearchParticipant, JavaSearchParticipant and org.eclipse.jdt.internal.core.search.matching.MatchLocator. However, the flags that control how the matching is done and the logic that decides whether a given name is matching, resides in SearchPattern. Thus, the implementation of substring matching requires the following steps to complete:
+
Java code completion is implemented in org.eclipse.jdt.internal.codeassist.CompletionEngine. This class relies on the matching functions implemented in org.eclipse.jdt.core.compiler.CharOperation. The main matching logic should be thus implemented in the latter class.
  
# Implement the new search flag and the algorithm
+
Related Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350000
# Implement code completion strategy configuration in Preferences/Java/Editor/Content Assist
+
# Connect the new search algorithm to the code completion code
+
# Provide tests
+
  
 
== Details on Tail Completion completion ==
 
== Details on Tail Completion completion ==

Latest revision as of 16:19, 8 June 2015

Contact

gabor at_sign kovesdan dot_here org

Project Goals

  • Exploring current refactoring features of JDT UI, especially those related to Java 8 and extend its functionality with new features. For example: refactoring to Optional<T>, using String.join instead of StringBuffer, new Date API etc.
  • Implement a simplified substring code completion. Only a small subset of substring matching will be implemented, which are useful to be an integral part of JDT UI. For example, .SelectionListener should match .addSelectionListener but not .addSelectionTestListener or .SL should match .addSelectionListener and .setSelectionListener but not .addSelectionTestListener.
  • Implement postfix code completion. It increases developer productivity by reducing the need to jump back in the code. Often we start to type variable or type names and then we realize we have to go back to put a specific keyword before, such as if or throw. A demo about the concept is available [1] Also, there is some work done towards this feature. I propose reviewing and integrating this to JDT.

General TODO

Create wiki for GSOC

Introduction mail to JDT UI list

Clone JDT UI at Github

Sign CLA

Configure my workspace for the work, including Gerrit setup

Code

The code will be available on GitHub: https://github.com/gaborbsd/JDT_UI_SOC2015

Details on Substring completion

Substring code completion will offer any possible suggestions that the pattern matches in a case insensitive way. However, matches that match exactly or match the camel case initials, will be listed with a higher relevance.

Java code completion is implemented in org.eclipse.jdt.internal.codeassist.CompletionEngine. This class relies on the matching functions implemented in org.eclipse.jdt.core.compiler.CharOperation. The main matching logic should be thus implemented in the latter class.

Related Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350000

Details on Tail Completion completion

We have already a partial contribution for this to JDT, see https://github.com/trylimits/Eclipse-Postfix-Code-Completion https://git.eclipse.org/r/#/c/40855/

Details on Refactoring

Resources on Raffi's page: https://openlab.citytech.cuny.edu/khatchad/research/background/

Back to the top