Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 3e5319c

Browse files
committed
post groovy support merge cleanup
- move java source to standard eclim package structure - conform to coding style - remove some unnecessary code, config, etc. - fix src validation - speed up code completion - fix code completion 'complete' string - update installer dependencies refs #312
1 parent ca838a5 commit 3e5319c

File tree

18 files changed

+391
-467
lines changed

18 files changed

+391
-467
lines changed

.classpath

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<classpathentry kind="con" path="org.eclim.ECLIM_CONTAINER"/>
44
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
55
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6+
<classpathentry kind="con" path="GROOVY_SUPPORT"/>
67
<classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
78
<classpathentry kind="lib" path="ant/lib/eclim-checkstyle.jar"/>
89
<classpathentry kind="lib" path="ant/lib/junit-4.9.jar"/>
@@ -22,6 +23,8 @@
2223
<classpathentry kind="src" path="org.eclim.dltk/java"/>
2324
<classpathentry kind="src" path="org.eclim.dltkruby/java"/>
2425
<classpathentry kind="src" path="org.eclim.dltkruby/test/junit"/>
26+
<classpathentry kind="src" path="org.eclim.groovy/java"/>
27+
<classpathentry kind="src" path="org.eclim.groovy/test/junit"/>
2528
<classpathentry kind="src" path="org.eclim.installer/java"/>
2629
<classpathentry kind="src" path="org.eclim.jdt/java"/>
2730
<classpathentry kind="src" path="org.eclim.jdt/test/junit"/>
@@ -33,8 +36,6 @@
3336
<classpathentry kind="src" path="org.eclim.sdt/test/junit"/>
3437
<classpathentry kind="src" path="org.eclim.vimplugin/java"/>
3538
<classpathentry kind="src" path="org.eclim.wst/java"/>
36-
<classpathentry kind="src" path="org.eclim.groovy/groovy"/>
3739
<classpathentry kind="src" path="org.eclim.wst/test/junit"/>
38-
<classpathentry kind="con" path="GROOVY_SUPPORT"/>
3940
<classpathentry exported="true" kind="src" path="/formic"/>
4041
</classpath>

ant/build.gant

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,12 @@ def initPlugins(){
889889
ant.echo("Plugins:")
890890
names.sort()
891891
names.each{ name -> ant.echo(" ${name}") }
892+
// FIXME: hack to move jdt above groovy. Better solution would be to scan the
893+
// plugin manifests to determine the ordering.
894+
if (names.contains("org.eclim.jdt")){
895+
names.remove("org.eclim.jdt")
896+
names.add(0, "org.eclim.jdt")
897+
}
892898
return defaults + names
893899
}
894900

build.xml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@
7777
<antcall target="gant"> <param name="target" value="org.eclim.pdt.test"/> </antcall>
7878
</target>
7979

80-
<target name="test.python">
81-
<antcall target="gant"> <param name="target" value="org.eclim.python.test"/> </antcall>
82-
</target>
83-
84-
<target name="test.sdt">
85-
<antcall target="gant"> <param name="target" value="org.eclim.sdt.test"/> </antcall>
86-
</target>
87-
8880
<target name="test.wst">
8981
<antcall target="gant"> <param name="target" value="org.eclim.wst.test"/> </antcall>
9082
</target>
@@ -93,10 +85,18 @@
9385
<antcall target="gant"> <param name="target" value="org.eclim.adt.test"/> </antcall>
9486
</target>
9587

88+
<target name="test.groovy">
89+
<antcall target="gant"> <param name="target" value="org.eclim.groovy.test"/> </antcall>
90+
</target>
91+
9692
<target name="test.pydev">
9793
<antcall target="gant"> <param name="target" value="org.eclim.pydev.test"/> </antcall>
9894
</target>
9995

96+
<target name="test.sdt">
97+
<antcall target="gant"> <param name="target" value="org.eclim.sdt.test"/> </antcall>
98+
</target>
99+
100100
<target name="dist" depends="clean">
101101
<antcall target="gant"> <param name="target" value="dist"/> </antcall>
102102
</target>
@@ -133,10 +133,6 @@
133133
<antcall target="gant"> <param name="target" value="patch.revert"/> </antcall>
134134
</target>
135135

136-
<target name="test.groovy">
137-
<antcall target="gant"> <param name="target" value="org.eclim.groovy.plugin.compile"/> </antcall>
138-
</target>
139-
140136
<target name="gant">
141137
<path id="gant-classpath">
142138
<fileset dir="ant/lib" includes="*.jar"/>

org.eclim.core/java/org/eclim/plugin/core/command/complete/AbstractCodeCompleteCommand.java

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package org.eclim.plugin.core.command.complete;
1818

1919
import java.util.ArrayList;
20-
2120
import java.util.Collections;
21+
import java.util.List;
2222

2323
import org.apache.commons.lang.StringUtils;
2424

@@ -59,6 +59,35 @@ public Object execute(final CommandLine commandLine)
5959
String file = commandLine.getValue(Options.FILE_OPTION);
6060
int offset = getOffset(commandLine);
6161

62+
List<CodeCompleteResult> results =
63+
getCompletionResults(commandLine, project, file, offset);
64+
65+
String layout = commandLine.getValue(Options.LAYOUT_OPTION);
66+
if(COMPACT.equals(layout) && results.size() > 0){
67+
results = compact(results);
68+
}
69+
Collections.sort(results);
70+
return getResponse(results);
71+
}
72+
73+
protected Object getResponse(List<CodeCompleteResult> results)
74+
{
75+
return results;
76+
}
77+
78+
/**
79+
* Gets the list of CodeCompletionResult objects.
80+
*
81+
* @param commandLine The current command line.
82+
* @param project The project name.
83+
* @param file The project relative file name.
84+
* @param offset The offset in the file.
85+
* @return The completion results.
86+
*/
87+
protected List<CodeCompleteResult> getCompletionResults(
88+
CommandLine commandLine, String project, String file, int offset)
89+
throws Exception
90+
{
6291
ICompletionProposal[] proposals =
6392
getCompletionProposals(commandLine, project, file, offset);
6493

@@ -74,28 +103,9 @@ public Object execute(final CommandLine commandLine)
74103
}
75104
}
76105
}
77-
78-
String layout = commandLine.getValue(Options.LAYOUT_OPTION);
79-
if(COMPACT.equals(layout) && results.size() > 0){
80-
results = compact(results);
81-
}
82-
Collections.sort(results);
83106
return results;
84107
}
85108

86-
/**
87-
* Constructs a new CodeCompleteResult for the supplied proposal.
88-
*
89-
* @param proposal The ICompletionProposal.
90-
* @return The CodeCompleteResult.
91-
*/
92-
protected CodeCompleteResult createCodeCompletionResult(
93-
ICompletionProposal proposal)
94-
{
95-
return new CodeCompleteResult(
96-
getCompletion(proposal), getMenu(proposal), getInfo(proposal));
97-
}
98-
99109
/**
100110
* Gets the ICompletionProposal results.
101111
*
@@ -141,7 +151,7 @@ protected IContentAssistProcessor getContentAssistProcessor(
141151
* @param commandLine The current command line.
142152
* @param project The project the file is in.
143153
* @param file The file.
144-
* @return The ITextViewer.
154+
* @return The ISourceViewer.
145155
*/
146156
protected ISourceViewer getTextViewer(
147157
CommandLine commandLine, String project, String file)
@@ -163,6 +173,19 @@ protected boolean acceptProposal(ICompletionProposal proposal)
163173
return true;
164174
}
165175

176+
/**
177+
* Constructs a new CodeCompleteResult for the supplied proposal.
178+
*
179+
* @param proposal The ICompletionProposal.
180+
* @return The CodeCompleteResult.
181+
*/
182+
protected CodeCompleteResult createCodeCompletionResult(
183+
ICompletionProposal proposal)
184+
{
185+
return new CodeCompleteResult(
186+
getCompletion(proposal), getMenu(proposal), getInfo(proposal));
187+
}
188+
166189
/**
167190
* Get the completion from the proposal.
168191
*
@@ -209,7 +232,7 @@ protected String getInfo(ICompletionProposal proposal)
209232
* @return The compacted results.
210233
*/
211234
protected ArrayList<CodeCompleteResult> compact(
212-
ArrayList<CodeCompleteResult> results)
235+
List<CodeCompleteResult> results)
213236
{
214237
ArrayList<CodeCompleteResult> compactResults =
215238
new ArrayList<CodeCompleteResult>();

org.eclim.groovy/META-INF/MANIFEST.MF

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,14 @@ Bundle-ClassPath: .,
1111
eclim.groovy.jar,
1212
lib/groovy-eclipse-batch-2.1.5-03.jar
1313
Require-Bundle: org.eclim,
14-
org.eclim.core,
15-
org.eclipse.jdt.groovy.core,
16-
org.eclim.jdt,
17-
org.eclipse.core.resources,
18-
org.eclipse.core.runtime,
19-
org.eclipse.ui,
20-
org.eclipse.jface.text,
21-
org.codehaus.groovy,
22-
org.eclipse.jdt.groovy.core,
23-
org.eclipse.jdt,
24-
org.eclipse.jdt.core,
25-
org.codehaus.groovy.eclipse,
26-
org.codehaus.groovy.eclipse.codeassist.completion,
27-
org.codehaus.groovy.eclipse.ui,
28-
org.codehaus.groovy.eclipse.ant,
29-
org.codehaus.groovy.eclipse.astviews,
30-
org.codehaus.groovy.eclipse.codebrowsing,
31-
org.codehaus.groovy.eclipse.compilerResolver,
32-
org.codehaus.groovy.eclipse.core,
33-
org.codehaus.groovy.eclipse.dsl,
34-
org.codehaus.groovy.eclipse.quickfix,
35-
org.codehaus.groovy.eclipse.refactoring
36-
Import-Package: org.codehaus.jdt.groovy.model
37-
Eclim-ClassPath-Bundle: org.eclipse.jdt.groovy.core
14+
org.eclim.core,
15+
org.eclim.jdt,
16+
org.eclipse.core.resources,
17+
org.eclipse.core.runtime,
18+
org.eclipse.jface.text,
19+
org.eclipse.jdt,
20+
org.eclipse.jdt.core,
21+
org.eclipse.jdt.groovy.core,
22+
org.eclipse.ui,
23+
org.codehaus.groovy.eclipse.codeassist.completion,
24+
org.codehaus.groovy.eclipse.ui

org.eclim.groovy/build_groovy.gant

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,8 @@
11
feature_groovy = 'org.codehaus.groovy.jdt.patch'
22

3-
target(name: 'org.eclim.groovy.plugin.compile'){
4-
mkdir(dir: '${build.classes}/org.eclim.groovy')
5-
javac(
6-
srcdir: 'org.eclim.groovy/groovy',
7-
destdir: '${build.classes}/org.eclim.groovy',
8-
debug: 'on',
9-
optimize: false,
10-
target: '1.6',
11-
source: '1.6',
12-
failonerror: true,
13-
includeantruntime: false) {
14-
classpath {
15-
fileset(dir: '${eclipse}'){
16-
include(name: 'dropins/**/plugins/*groovy*.jar')
17-
include(name: 'plugins/*.jar')
18-
include(name: 'org.eclipse.jface*.jar')
19-
include(name:'org.eclipse.equinox.common*.jar')
20-
include(name: 'plugins/*core*.jar')
21-
include(name: 'plugins/*jdt*.jar')
22-
}
23-
fileset(dir: '${build.plugins}', includes: 'org.eclim*/eclim*.jar')
24-
fileset(dir: 'build/temp/lib/groovy', erroronmissingdir: false){
25-
include(name: '**/*.jar')
26-
}
27-
}
28-
29-
3+
target(name: 'org.eclim.groovy.classpath'){
4+
fileset(dir: '${eclipse}'){
5+
include(name: 'dropins/**/plugins/*groovy*.jar')
6+
include(name: 'plugins/*groovy*.jar')
307
}
318
}

org.eclim.groovy/groovy/eclim/plugin/groovy/PluginResources.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)