Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 2.2.0-beta-1
    • Component/s: None
    • Labels:
    • Number of attachments :
      0

      Description

      Update to more recent version: jline: 1.0 -> 2.6+ (this has a dependency on jansi, so it makes sense to also update that to 1.8)

      Involves (thanks for input from Jason Dillon): the api changes from 1->2 are mostly package name changes, some generic signatures and some spelling fixes (e.g. completor -> completer) etc.

      Possible specifics (some may become irrelevant depending on the approach taken):

      • Terminal is an intf now; use TerminalFactory to get instances of a Terminal
      • Terminal.getTerminalWidth() is now simply Terminal.getWidth()
      • ConsoleReader is now in jline.console
      • history functionality is now in jline.console.history, History is an intf now
      • completer functionality is now in jline.console.completer
      • SimpleCompletor (in groovysh) is about the same as StringsCompleter

      This will be a breaking change (albeit to a mostly internal api) since org.codehaus.groovy.tools.shell.Command has a method Completor getCompletor() which should probably be renamed to getCompleter() and will return a class in a different package.

        Issue Links

          Activity

          Hide
          Paul King added a comment -

          changing version number to see if we can fix before rc-1 so we don't forget

          Show
          Paul King added a comment - changing version number to see if we can fix before rc-1 so we don't forget
          Hide
          Pascal Schumacher added a comment -

          I did some quick hacking to see how much work this update would be.

          Looks like more work than I expected. At least for someone who does neither know JLine or groovysh.

          Obstacles I encountered:

          • MultiCompletor (which CommandsMultiCompletor extends) is not in 2.9. I guess it was replaced by AggregateCompleter but this doesn't look like a drop-in replacement for MultiCompletor.
          • SimpleCompletor (which SimpleCompleter extends) is not in 2.9. As stated above StringsCompleter is similar, but not a drop-in replacement.
          • As stated above History is an Interface now and underwent other changes.

          Everything else seems to be simple renaming.

          I commited my results to https://github.com/PascalSchumacher/groovy-core/commit/541617ff07c951b2a88abe60d2b582f641874dad. As said before I did not get much done, but if it helps I gladly create a pull request.

          Show
          Pascal Schumacher added a comment - I did some quick hacking to see how much work this update would be. Looks like more work than I expected. At least for someone who does neither know JLine or groovysh. Obstacles I encountered: MultiCompletor (which CommandsMultiCompletor extends) is not in 2.9. I guess it was replaced by AggregateCompleter but this doesn't look like a drop-in replacement for MultiCompletor. SimpleCompletor (which SimpleCompleter extends) is not in 2.9. As stated above StringsCompleter is similar, but not a drop-in replacement. As stated above History is an Interface now and underwent other changes. Everything else seems to be simple renaming. I commited my results to https://github.com/PascalSchumacher/groovy-core/commit/541617ff07c951b2a88abe60d2b582f641874dad . As said before I did not get much done, but if it helps I gladly create a pull request.
          Hide
          Pascal Schumacher added a comment -

          This would possibly also solve GROOVY-4503.

          Show
          Pascal Schumacher added a comment - This would possibly also solve GROOVY-4503 .
          Hide
          Thibault Kruse added a comment -

          I think I can provide a patch. I have migrated to JLine2.10 and jansi1.10 and it seems to work. Need to write some unit tests first though

          • I think AggregateCompletor can replace MultiCompletor.
          • We can keep SimpleCompletor from jline 1.0, the interface is the same anyway.
          • History functionality is the worst change to fix.

          Will be part of a pull request soon, after #177, #178, and maybe one or two more have been merged

          Show
          Thibault Kruse added a comment - I think I can provide a patch. I have migrated to JLine2.10 and jansi1.10 and it seems to work. Need to write some unit tests first though I think AggregateCompletor can replace MultiCompletor. We can keep SimpleCompletor from jline 1.0, the interface is the same anyway. History functionality is the worst change to fix. Will be part of a pull request soon, after #177, #178, and maybe one or two more have been merged
          Hide
          Thibault Kruse added a comment -
          Show
          Thibault Kruse added a comment - Reference: https://github.com/groovy/groovy-core/pull/181
          Hide
          Pascal Schumacher added a comment -

          Pull request merged! Thanks!

          Show
          Pascal Schumacher added a comment - Pull request merged! Thanks!

            People

            • Assignee:
              Pascal Schumacher
              Reporter:
              Paul King
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: