Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The lack of code completion in the Groovy source code editor is a huge problem. Not only does it speed up input, but allows one to explore unfamiliar APIs. This last fact alone makes it easier to code in Java, even though the code can never be as terse and and elegant as the equivalent Groovy code.
      Code completion for Java based libraries alone would be a huge boost in productivity. Completion hints for dynamic Groovy types would be an added bonus.

        Activity

        Hide
        Louis Foucart added a comment -

        I am adding as attatched file to this issue my first attempt to code completion.
        This attempt implements completion for groovy keywords.
        It will need very small work for adaptation to repository code to access keywords.

        Here is code portion to add template proposals:
        to include in computeCompletionProposals() after determining keyword completion :

        if (fTemplateEngine != null)

        { fTemplateEngine.reset(); fTemplateEngine.complete(viewer, offset, null); TemplateProposal[] templateResults= fTemplateEngine.getResults(); // concatenate arrays IJavaCompletionProposal[] total= new IJavaCompletionProposal[results.length + templateResults.length]; System.arraycopy(templateResults, 0, total, 0, templateResults.length); System.arraycopy(results, 0, total, templateResults.length, results.length); results= total; }

        results being the ICompletionProposal array built with the content of the keyword list.
        here is the code to add to the constructor :

        TemplateContextType contextType= JavaPlugin.getDefault().getTemplateContextRegistry().getContextType("java"); //$NON-NLS-1$
        if (contextType != null)

        { fTemplateEngine= new TemplateEngine(contextType); }

        It should work easily.

        Thanks for your attention.

        Louis Foucart

        Show
        Louis Foucart added a comment - I am adding as attatched file to this issue my first attempt to code completion. This attempt implements completion for groovy keywords. It will need very small work for adaptation to repository code to access keywords. Here is code portion to add template proposals: to include in computeCompletionProposals() after determining keyword completion : if (fTemplateEngine != null) { fTemplateEngine.reset(); fTemplateEngine.complete(viewer, offset, null); TemplateProposal[] templateResults= fTemplateEngine.getResults(); // concatenate arrays IJavaCompletionProposal[] total= new IJavaCompletionProposal[results.length + templateResults.length]; System.arraycopy(templateResults, 0, total, 0, templateResults.length); System.arraycopy(results, 0, total, templateResults.length, results.length); results= total; } results being the ICompletionProposal array built with the content of the keyword list. here is the code to add to the constructor : TemplateContextType contextType= JavaPlugin.getDefault().getTemplateContextRegistry().getContextType("java"); //$NON-NLS-1$ if (contextType != null) { fTemplateEngine= new TemplateEngine(contextType); } It should work easily. Thanks for your attention. Louis Foucart
        Hide
        Louis Foucart added a comment -

        see comment to the issue

        Louis Foucart.

        Show
        Louis Foucart added a comment - see comment to the issue Louis Foucart.
        Hide
        Edward Povazan added a comment -

        Started to work on this full time 2 days ago. Ready in a month.

        Show
        Edward Povazan added a comment - Started to work on this full time 2 days ago. Ready in a month.
        Hide
        Edward Povazan added a comment -

        The code is in the repository, a prerelease is coming soon, to expose remaining issues. The following works in most contexts:
        -Code completion on all locals, fields, methods, class names, and after '.'
        -Inferred types for locals, fields, method returns.
        -Override method code assist.
        -Completions on the DGM.
        -Completions on code inside of 'use' category blocks.
        -Extension point to add dynamic types to the system - there is a small demo for Grails findBy* methods.
        -Developer documentation in Eclipse help. If parts are lacking, tell me and I will add more.

        Show
        Edward Povazan added a comment - The code is in the repository, a prerelease is coming soon, to expose remaining issues. The following works in most contexts: -Code completion on all locals, fields, methods, class names, and after '.' -Inferred types for locals, fields, method returns. -Override method code assist. -Completions on the DGM. -Completions on code inside of 'use' category blocks. -Extension point to add dynamic types to the system - there is a small demo for Grails findBy* methods. -Developer documentation in Eclipse help. If parts are lacking, tell me and I will add more.

          People

          • Assignee:
            Edward Povazan
            Reporter:
            Edward Povazan
          • Votes:
            7 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 672h
              672h
              Remaining:
              Remaining Estimate - 672h
              672h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development