GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-987

Code completion enters variable name based on the ClassName (like in java editor)

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.1Release
    • Fix Version/s: None
    • Component/s: Content Assist
    • Labels:
    • Number of attachments :
      0

      Description

      E.g. In java code completion:
      1.Str CTRL+SPACE => String and import (works most of the times in Groovy files :S )
      2.String CTRL+SPACE => string
      => endresult in String string

      If you do have it in the Java editor I expected it to be in the Groovy editor as well since it is such a nice feature!

        Issue Links

          Activity

          Hide
          Andrew Eisenberg added a comment -

          Do you often name your variables of type String string? Or is there something more fundamental that you are trying to get at here?

          Show
          Andrew Eisenberg added a comment - Do you often name your variables of type String string? Or is there something more fundamental that you are trying to get at here?
          Hide
          Timothy Freyne added a comment -

          For String it is indeed strange but for project specific own classes it makes more sense.
          E.g.:
          Book book
          Customer customer
          Appointment appointment
          List<Customer> customers

          In Java editor this stuff all works great and is a joy to use it.

          Show
          Timothy Freyne added a comment - For String it is indeed strange but for project specific own classes it makes more sense. E.g.: Book book Customer customer Appointment appointment List<Customer> customers In Java editor this stuff all works great and is a joy to use it.
          Hide
          Andrew Eisenberg added a comment -

          Let's see what I can do here...

          Show
          Andrew Eisenberg added a comment - Let's see what I can do here...
          Hide
          Andrew Eisenberg added a comment -

          Now working for fields. I will see what I can do for variable declarations.

          Show
          Andrew Eisenberg added a comment - Now working for fields. I will see what I can do for variable declarations.
          Hide
          Andrew Eisenberg added a comment -

          I'll try to get to this for 2.7.0.

          Show
          Andrew Eisenberg added a comment - I'll try to get to this for 2.7.0.
          Hide
          Mauro Molinari added a comment -

          Another use case:

          String my| <= CTRL + SPACE here
             => brings String myString
          ThreadLocal counter| <= CTRL + SPACE here
             => brings a dialog to choose between counterLocal and counterThreadLocal
          

          Once again, the examples do not reveal how useful this can be in real-world cases.

          Show
          Mauro Molinari added a comment - Another use case: String my| <= CTRL + SPACE here => brings String myString ThreadLocal counter| <= CTRL + SPACE here => brings a dialog to choose between counterLocal and counterThreadLocal Once again, the examples do not reveal how useful this can be in real-world cases.
          Hide
          Timothy Freyne added a comment -

          Mauro,
          In real world cases you have a complex business-model. Order, Customer, OrderItem, Book, Address,... Maybe a CustomerService and a CustomerRepository... You would type
          Customer | <= CTRL + SPACE here
          => brings Customer customer
          CustomerService | <= CTRL + SPACE here
          => brings a dialog to choose between customerService and service
          List<Customer> | <= CTRL + SPACE here
          => brings a dialog to choose between customers and customerList and list
          Check out how tyne Eclipse Java editor does this. Check out how IntelliJ does this for Groovy already. The added value and usefulness is in a larger context than proposed here in in this simple examples like: String | <= CTRL + SPACE here => brings String string

          Additionally the Java editor goes a bit further and does this:
          Customer | <= CTRL + SPACE here => brings Customer customer
          The further type = new | <= CTRL + SPACE brings up all the Constructors for the Customer =>
          resulting in final Customer customer = new Customer();

          Show
          Timothy Freyne added a comment - Mauro, In real world cases you have a complex business-model. Order, Customer, OrderItem, Book, Address,... Maybe a CustomerService and a CustomerRepository... You would type Customer | <= CTRL + SPACE here => brings Customer customer CustomerService | <= CTRL + SPACE here => brings a dialog to choose between customerService and service List<Customer> | <= CTRL + SPACE here => brings a dialog to choose between customers and customerList and list Check out how tyne Eclipse Java editor does this. Check out how IntelliJ does this for Groovy already. The added value and usefulness is in a larger context than proposed here in in this simple examples like: String | <= CTRL + SPACE here => brings String string Additionally the Java editor goes a bit further and does this: Customer | <= CTRL + SPACE here => brings Customer customer The further type = new | <= CTRL + SPACE brings up all the Constructors for the Customer => resulting in final Customer customer = new Customer();

            People

            • Assignee:
              Unassigned
              Reporter:
              Timothy Freyne
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: