GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-493

unhelpful auto insertion of quotes when closing a multi line string

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0m1
    • Fix Version/s: 2.0.0RC1
    • Component/s: Editor
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Try typing this in:

      print """
      hello $world
      """

      When I try and input the closing """, on typing the 3rd quote it 'helpfully' gives me a 4th that I don't want.

        Activity

        Hide
        Andrew Eisenberg added a comment -

        This is quite annoying and should be fixed.

        Show
        Andrew Eisenberg added a comment - This is quite annoying and should be fixed.
        Hide
        Andrew Eisenberg added a comment -

        Unfortunately, this is not as simple as I had originally thought. Bracket and quote matching is performed inside of CompilationUnitEditor. The field is private/final and is of type BracketInserter, which is a private class. Essentially, the only way I can really effect behavior here is to patch jdt.ui (AspectJ is another enticing option, but also a no-go).

        I think the best solution here is to disable single and double quote matching inside Groovy Editors.

        Show
        Andrew Eisenberg added a comment - Unfortunately, this is not as simple as I had originally thought. Bracket and quote matching is performed inside of CompilationUnitEditor. The field is private/final and is of type BracketInserter, which is a private class. Essentially, the only way I can really effect behavior here is to patch jdt.ui (AspectJ is another enticing option, but also a no-go). I think the best solution here is to disable single and double quote matching inside Groovy Editors.
        Hide
        Andrew Eisenberg added a comment -

        Not entirely pleased with the solution, but it is fixed. Now, strings will never be auto-closed. My reasoning is that the annoyance of having triple quoted strings not autoclosing properly is greater than the annoyance of not having any autoclosing at all for strings (because I don't really find it too useful).

        However, I can easily be persuaded otherwise...

        Closing this bug, but reopen if you don't like the change. I may post on the mailing list to see what others think.

        Show
        Andrew Eisenberg added a comment - Not entirely pleased with the solution, but it is fixed. Now, strings will never be auto-closed. My reasoning is that the annoyance of having triple quoted strings not autoclosing properly is greater than the annoyance of not having any autoclosing at all for strings (because I don't really find it too useful). However, I can easily be persuaded otherwise... Closing this bug, but reopen if you don't like the change. I may post on the mailing list to see what others think.
        Hide
        John Bito added a comment -

        Perhaps this should be a separate issue. (This is with RC4)

        When editing a line to add a string, such as changing

        assert exec.input, USAGE

        to

        assert exec.input, "No input specified" + USAGE

        Adding the first quote results in one quote inserted. Typing the close-quote inserts two quotes (leaving the cursor between them). As long is I remember to hit DEL (and not) BS after typing the close, I can almost ignore this behavior.

        In case it needs to be mentioned, when I type the first quote after the comma, the statement becomes invalid since there is no '+' operator.

        Show
        John Bito added a comment - Perhaps this should be a separate issue. (This is with RC4) When editing a line to add a string, such as changing assert exec.input, USAGE to assert exec.input, "No input specified" + USAGE Adding the first quote results in one quote inserted. Typing the close-quote inserts two quotes (leaving the cursor between them). As long is I remember to hit DEL (and not) BS after typing the close, I can almost ignore this behavior. In case it needs to be mentioned, when I type the first quote after the comma, the statement becomes invalid since there is no '+' operator.
        Hide
        Andrew Eisenberg added a comment -

        Created GRECLIPSE-611

        Show
        Andrew Eisenberg added a comment - Created GRECLIPSE-611

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Andy Clement
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: