Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Import manager places now semicolons after the import statement.

The derived class XtendImportManager can be used for Xtend files where
no semicolon is required.
  • Loading branch information...
commit bae03d194f89f9201b1526655f6deee54f64fe2c 1 parent 13d5c3b
@ckulla authored
View
4 org.eclipse.emf.xtendfactory.test/src/org/eclipse/emf/xtendfactory/ImportManagerTest.xtend
@@ -37,7 +37,7 @@ class ImportManagerTest {
@Test
def void testImportClassInOtherPackage () {
assertEquals ("Bar", importManager.getImportedName("org.eclipse.bar.Bar"))
- assertEquals ("import org.eclipse.bar.Bar\n", importManager.expand.toString)
+ assertEquals ("import org.eclipse.bar.Bar;\n", importManager.expand.toString)
}
@Test
@@ -53,7 +53,7 @@ class ImportManagerTest {
assertEquals ("Bar", importManager.getImportedName("org.eclipse.bar.Bar"))
assertEquals ("org.eclipse.foo.Bar", importManager.getImportedName("org.eclipse.foo.Bar"))
assertEquals ("Bar", importManager.getImportedName("org.eclipse.bar.Bar"))
- assertEquals ("import org.eclipse.bar.Bar\n", importManager.expand.toString)
+ assertEquals ("import org.eclipse.bar.Bar;\n", importManager.expand.toString)
}
}
View
2  org.eclipse.emf.xtendfactory/src/org/eclipse/emf/xtendfactory/Generator.xtend
@@ -11,7 +11,7 @@ import java.io.FileWriter
class Generator {
@Inject
- extension ImportManager importManager
+ extension XtendImportManager importManager
String outputFolder = "../"
View
2  org.eclipse.emf.xtendfactory/src/org/eclipse/emf/xtendfactory/ImportManager.xtend
@@ -48,7 +48,7 @@ class ImportManager {
def expand () {
'''
«FOR c:importedClasses.sort»
- import «c»
+ import «c»;
«ENDFOR»
'''
}
View
11 org.eclipse.emf.xtendfactory/src/org/eclipse/emf/xtendfactory/XtendImportManager.xtend
@@ -0,0 +1,11 @@
+package org.eclipse.emf.xtendfactory
+
+import org.eclipse.emf.xtendfactory.ImportManager
+
+class XtendImportManager extends ImportManager {
+
+ override expand () {
+ super.expand().toString().replaceAll (";","")
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.