GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-269

[content assist] Code completion inside multi-line GStrings

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1Release
    • Fix Version/s: 2.8.0.Release
    • Component/s: Content Assist
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Feature request for code completion inside GStrings. As in println "Hello $

      {name}

      ".

        Activity

        Hide
        Andrew Eisenberg added a comment -

        This would be very nice. What needs to happen here is that a new content type must be added to the document in the GroovyEditor. Then there must be a content assistant associated with that content type. Not impossible. I'll try to get to it for M2.

        Show
        Andrew Eisenberg added a comment - This would be very nice. What needs to happen here is that a new content type must be added to the document in the GroovyEditor. Then there must be a content assistant associated with that content type. Not impossible. I'll try to get to it for M2.
        Hide
        Andrew Eisenberg added a comment -

        Partially fixed now. GString completion is now available in single-line strings, not multiline strings.

        Show
        Andrew Eisenberg added a comment - Partially fixed now. GString completion is now available in single-line strings, not multiline strings.
        Hide
        Andrew Eisenberg added a comment -

        Will look at this for RC1.

        Show
        Andrew Eisenberg added a comment - Will look at this for RC1.
        Hide
        Andrew Eisenberg added a comment -

        updated title to more specifically describe current bug.

        Show
        Andrew Eisenberg added a comment - updated title to more specifically describe current bug.
        Hide
        Andrew Eisenberg added a comment -

        Multi-line String quick assist is annoyingly hard to do. Multi-line strings have a special content type to differentiate it from regular strings. Unfortunately, this means that the content assistant cannot recognize multi-line strings and they are always ignored.

        I may have to create a custom content assistant to handle multi-line strings. Uggh. Dirty work.

        Show
        Andrew Eisenberg added a comment - Multi-line String quick assist is annoyingly hard to do. Multi-line strings have a special content type to differentiate it from regular strings. Unfortunately, this means that the content assistant cannot recognize multi-line strings and they are always ignored. I may have to create a custom content assistant to handle multi-line strings. Uggh. Dirty work.
        Hide
        Andrew Eisenberg added a comment -

        Wayyyy harder than it should be. Will have to wait until post-2.0.

        Show
        Andrew Eisenberg added a comment - Wayyyy harder than it should be. Will have to wait until post-2.0.
        Hide
        Andrew Eisenberg added a comment -

        Uggh...just ugly.

        Show
        Andrew Eisenberg added a comment - Uggh...just ugly.
        Hide
        Andrew Eisenberg added a comment -

        Won't make the 2.0.2 release.

        Show
        Andrew Eisenberg added a comment - Won't make the 2.0.2 release.
        Hide
        Bob Tiernay added a comment -

        Any update on this? This would be a much welcomed feature indeed.

        Show
        Bob Tiernay added a comment - Any update on this? This would be a much welcomed feature indeed.
        Hide
        Andrew Eisenberg added a comment -

        I decided to have another look at this problem and I was able to get a fix.

        The main thing that I did was add a new partition-type for the groovy content assistant so that it now works on multi-line strings. I know I tried this in the past, but discarded the idea since the Eclipse manifest builder will log an error in the content assist plugin's plugin.xml file. Even though the error is there, the content assistant still behaves properly. This is because I am already hacking the partition provider to include multi-line strings (the problem is that the PDE builder doesn't know about this). So, I abandoned the idea because of a validation error, and never knew that things would work even with the validation error.

        In order to avoid getting a pesky error marker in the plugin.xml, I had to remove the manifest builder from the project (and hence no more validation of plugin related things in org.codehaus.groovy.eclipse.codeassist.completion. This could come back to bite me later, but we'll see.

        Since I was in this area anyway, I also added some checking such that if you are invoking content assist from inside of a GString, but not inside of a ${}, then no proposals appear.

        Also, added regression tests for this area.

        Show
        Andrew Eisenberg added a comment - I decided to have another look at this problem and I was able to get a fix. The main thing that I did was add a new partition-type for the groovy content assistant so that it now works on multi-line strings. I know I tried this in the past, but discarded the idea since the Eclipse manifest builder will log an error in the content assist plugin's plugin.xml file. Even though the error is there, the content assistant still behaves properly. This is because I am already hacking the partition provider to include multi-line strings (the problem is that the PDE builder doesn't know about this). So, I abandoned the idea because of a validation error, and never knew that things would work even with the validation error. In order to avoid getting a pesky error marker in the plugin.xml, I had to remove the manifest builder from the project (and hence no more validation of plugin related things in org.codehaus.groovy.eclipse.codeassist.completion. This could come back to bite me later, but we'll see. Since I was in this area anyway, I also added some checking such that if you are invoking content assist from inside of a GString, but not inside of a ${}, then no proposals appear. Also, added regression tests for this area.

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Martin Gilday
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: