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.
Difference between revisions of "Google Summer of Code 2015/JDT UI Code Completion and Refactoring"
(→Details on Substring completion) |
|||
Line 12: | Line 12: | ||
* 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 [http://blog.jetbrains.com/idea/2014/03/postfix-completion/|here.] Also, there is some [https://bugs.eclipse.org/bugs/show_bug.cgi?id=458804|initial work] done towards this feature. I propose reviewing and integrating this to JDT. | * 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 [http://blog.jetbrains.com/idea/2014/03/postfix-completion/|here.] Also, there is some [https://bugs.eclipse.org/bugs/show_bug.cgi?id=458804|initial work] done towards this feature. I propose reviewing and integrating this to JDT. | ||
− | == | + | == General TODO == |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<strike>Create wiki for GSOC</strike> | <strike>Create wiki for GSOC</strike> | ||
Line 33: | Line 23: | ||
<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 == | ||
+ | |||
+ | === Matching Rule === | ||
+ | |||
+ | # If the pattern only contains lower case letters, any member that contains the pattern as a substring is matched. | ||
+ | # 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 === | ||
+ | |||
+ | 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: | ||
+ | |||
+ | # Implement the new search flag and the algorithm | ||
+ | # 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 == | ||
+ | |||
+ | 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/ |
Revision as of 10:29, 2 June 2015
Contents
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
Details on Substring completion
Matching Rule
- If the pattern only contains lower case letters, any member that contains the pattern as a substring is matched.
- 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
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:
- Implement the new search flag and the algorithm
- 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
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/