[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-scm
Subject:    [groovy-scm] [jira] Commented: (GRECLIPSE-332) When selecting a completion to
From:       "Eric Tiffany (JIRA)" <jira () codehaus ! org>
Date:       2009-10-30 22:51:26
Message-ID: 11724392.156351256943086769.JavaMail.haus-jira () codehaus01 ! managed ! contegix ! com
[Download RAW message or body]


    [ http://jira.codehaus.org/browse/GRECLIPSE-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196733#action_196733 \
] 

Eric Tiffany commented on GRECLIPSE-332:
----------------------------------------

It seems that pasting code into a groovy script replaces existing import statements.  \
This may be due to the fact that I have a println statement at the top of my script, \
before the imports, but it is weird nonetheless.  Also, it doesn't happen in all \
cases, but I think I have a repeatable example.  This is with the 10/29 snapshot and \
eclipse 3.5.1 on MacOS

For example, if I have a groovy file containing

{code}
import com.voiplogic.qbill.core.Plan

int bar;
def fun(Plan p) {
    
}
{code}

And then I type 'def foo =' and paste this text I have copied from a Java file

{code}
new Schedule(customerId, ScheduleStart.Now, ScheduleFrequency.Never)
{code}

I end up with this (note that the original import statement is gone): 

{code}
import com.voiplogic.qbill.quartz.scheduler.Schedule;
import com.voiplogic.qbill.quartz.scheduler.ScheduleFrequency;
import com.voiplogic.qbill.quartz.scheduler.ScheduleStart;

int bar;

def foo = new Schedule(customerId, ScheduleStart.Now, ScheduleFrequency.Never)
def fun(Plan p) {
    
}
{code}

I think this may only happen if I copy from a Java file using Command-C (instead of \
the emacs-style commands such as Option-W), and may not happen if I copy from another \
groovy file.

Andrew Eisenberg responded on the mail list as follows:
{quote}
What's going on here (and this is a bug, not a feature) is that by
typing 'def foo =', you are temporarily breaking the parsing of the
file.  And so, when you paste, your unused imports are removed.  And
since your file is unparsable, all of your imports are considered
unused.

Obviously, a more robust groovy parser would be the ideal way to go
here, but in the short term, I should find a way to ensure that
imports are never removed in this situation.  Can you please raise a
bug for this?
{quote}

> When selecting a completion to insert a method all imports are removed
> ----------------------------------------------------------------------
> 
> Key: GRECLIPSE-332
> URL: http://jira.codehaus.org/browse/GRECLIPSE-332
> Project: GRECLIPSE
> Issue Type: Bug
> Affects Versions: 2.0.0alpha
> Reporter: Andrew Eisenberg
> Assignee: Andrew Eisenberg
> Priority: Critical
> Fix For: 2.0.0m2
> 
> Original Estimate: 0 minutes
> Remaining Estimate: 0 minutes
> 
> {code}
> package f;
> import java.util.Map.Entry;
> class F  {
> Entry y() {
> }
> 
> size// <- here
> 
> }
> {code}
> Code completion at here and select the method proposal 'size()'
> the import statement is removed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: \
                http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
    <a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic