Got rid of "jet" file extension.
This commit is contained in:
+1
-1
@@ -155,7 +155,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static ClassFileFactory getFactoryFromText(String filePath, String text, JetCoreEnvironment jetEnvironment) {
|
private static ClassFileFactory getFactoryFromText(String filePath, String text, JetCoreEnvironment jetEnvironment) {
|
||||||
JetFile psiFile = JetTestUtils.createFile("dummy.jet", text, jetEnvironment.getProject());
|
JetFile psiFile = JetTestUtils.createFile("dummy.kt", text, jetEnvironment.getProject());
|
||||||
ClassFileFactory factory;
|
ClassFileFactory factory;
|
||||||
try {
|
try {
|
||||||
factory = GenerationUtils.compileFileGetClassFileFactoryForTest(psiFile);
|
factory = GenerationUtils.compileFileGetClassFileFactoryForTest(psiFile);
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ public class JetCoreEnvironment {
|
|||||||
applicationEnvironment.registerFileType(JetFileType.INSTANCE, "kts");
|
applicationEnvironment.registerFileType(JetFileType.INSTANCE, "kts");
|
||||||
applicationEnvironment.registerFileType(JetFileType.INSTANCE, "ktm");
|
applicationEnvironment.registerFileType(JetFileType.INSTANCE, "ktm");
|
||||||
applicationEnvironment.registerFileType(JetFileType.INSTANCE, JetParserDefinition.KTSCRIPT_FILE_SUFFIX); // should be renamed to kts
|
applicationEnvironment.registerFileType(JetFileType.INSTANCE, JetParserDefinition.KTSCRIPT_FILE_SUFFIX); // should be renamed to kts
|
||||||
applicationEnvironment.registerFileType(JetFileType.INSTANCE, "jet");
|
|
||||||
applicationEnvironment.registerParserDefinition(new JavaParserDefinition());
|
applicationEnvironment.registerParserDefinition(new JavaParserDefinition());
|
||||||
applicationEnvironment.registerParserDefinition(new JetParserDefinition());
|
applicationEnvironment.registerParserDefinition(new JetParserDefinition());
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class JetPsiFactory {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static JetFile createFile(Project project, String text) {
|
public static JetFile createFile(Project project, String text) {
|
||||||
return createFile(project, "dummy.jet", text);
|
return createFile(project, "dummy.kt", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class LightClassUtil {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static URL getBuiltInsDirUrl() {
|
public static URL getBuiltInsDirUrl() {
|
||||||
String builtInFilePath = "/" + KotlinBuiltIns.BUILT_INS_PACKAGE_NAME_STRING + "/Library.jet";
|
String builtInFilePath = "/" + KotlinBuiltIns.BUILT_INS_PACKAGE_NAME_STRING + "/Library.kt";
|
||||||
|
|
||||||
URL url = KotlinBuiltIns.class.getResource(builtInFilePath);
|
URL url = KotlinBuiltIns.class.getResource(builtInFilePath);
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public abstract class JetLiteFixture extends KotlinTestWithEnvironment {
|
|||||||
protected JetFile createPsiFile(@Nullable String testName, @Nullable String fileName, String text) {
|
protected JetFile createPsiFile(@Nullable String testName, @Nullable String fileName, String text) {
|
||||||
if (fileName == null) {
|
if (fileName == null) {
|
||||||
Assert.assertNotNull(testName);
|
Assert.assertNotNull(testName);
|
||||||
fileName = testName + ".jet";
|
fileName = testName + ".kt";
|
||||||
}
|
}
|
||||||
return JetTestUtils.createFile(fileName, text, getProject());
|
return JetTestUtils.createFile(fileName, text, getProject());
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ public abstract class JetLiteFixture extends KotlinTestWithEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void prepareForTest(String name) throws IOException {
|
protected void prepareForTest(String name) throws IOException {
|
||||||
String text = loadFile(name + ".jet");
|
String text = loadFile(name + ".kt");
|
||||||
createAndCheckPsiFile(name, text);
|
createAndCheckPsiFile(name, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import static com.intellij.openapi.util.io.FileUtil.toSystemIndependentName;
|
|||||||
|
|
||||||
public abstract class JetTestCaseBuilder {
|
public abstract class JetTestCaseBuilder {
|
||||||
|
|
||||||
public static final FilenameFilter KOTLIN_FILTER = filterByExtension("kt", "jet", JetParserDefinition.KTSCRIPT_FILE_SUFFIX);
|
public static final FilenameFilter KOTLIN_FILTER = filterByExtension("kt", JetParserDefinition.KTSCRIPT_FILE_SUFFIX);
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static FilenameFilter filterByExtension(@NotNull final String... extensions) {
|
public static FilenameFilter filterByExtension(@NotNull final String... extensions) {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class JetControlFlowTest extends JetLiteFixture {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void runTest() throws Throwable {
|
protected void runTest() throws Throwable {
|
||||||
JetFile file = loadPsiFile(myName + ".jet");
|
JetFile file = loadPsiFile(myName + ".kt");
|
||||||
|
|
||||||
Map<JetElement, Pseudocode> data = new LinkedHashMap<JetElement, Pseudocode>();
|
Map<JetElement, Pseudocode> data = new LinkedHashMap<JetElement, Pseudocode>();
|
||||||
AnalyzeExhaust analyzeExhaust = JetTestUtils.analyzeFile(file);
|
AnalyzeExhaust analyzeExhaust = JetTestUtils.analyzeFile(file);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class BuiltInsSerializer {
|
|||||||
public static void serializeToDir(final File destDir, @Nullable final PrintStream out) throws IOException {
|
public static void serializeToDir(final File destDir, @Nullable final PrintStream out) throws IOException {
|
||||||
Disposable rootDisposable = Disposer.newDisposable();
|
Disposable rootDisposable = Disposer.newDisposable();
|
||||||
try {
|
try {
|
||||||
List<File> sourceFiles = FileUtil.findFilesByMask(Pattern.compile(".*\\.jet"), new File(BUILT_INS_SRC_DIR));
|
List<File> sourceFiles = FileUtil.findFilesByMask(Pattern.compile(".*\\.kt"), new File(BUILT_INS_SRC_DIR));
|
||||||
CompilerConfiguration configuration = new CompilerConfiguration();
|
CompilerConfiguration configuration = new CompilerConfiguration();
|
||||||
JetCoreEnvironment environment = new JetCoreEnvironment(rootDisposable, configuration);
|
JetCoreEnvironment environment = new JetCoreEnvironment(rootDisposable, configuration);
|
||||||
List<JetFile> files = JetTestUtils.loadToJetFiles(environment, sourceFiles);
|
List<JetFile> files = JetTestUtils.loadToJetFiles(environment, sourceFiles);
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ public class GenerateFunctions {
|
|||||||
this.superClassNamePrefix = superClassNamePrefix;
|
this.superClassNamePrefix = superClassNamePrefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getJetFileName() {
|
public String getFileName() {
|
||||||
return classNamePrefix + "s.jet";
|
return classNamePrefix + "s.kt";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClassName(int i) {
|
public String getClassName(int i) {
|
||||||
@@ -223,7 +223,7 @@ public class GenerateFunctions {
|
|||||||
assert RUNTIME_SRC_DIR.exists() : "Runtime src dir does not exist: " + RUNTIME_SRC_DIR.getAbsolutePath();
|
assert RUNTIME_SRC_DIR.exists() : "Runtime src dir does not exist: " + RUNTIME_SRC_DIR.getAbsolutePath();
|
||||||
|
|
||||||
for (FunctionKind kind : FunctionKind.values()) {
|
for (FunctionKind kind : FunctionKind.values()) {
|
||||||
PrintWriter functions = new PrintWriter(new File(JET_SRC_DIR, kind.getJetFileName()));
|
PrintWriter functions = new PrintWriter(new File(JET_SRC_DIR, kind.getFileName()));
|
||||||
new GenerateFunctions(functions, kind).generateBuiltInFunctions();
|
new GenerateFunctions(functions, kind).generateBuiltInFunctions();
|
||||||
functions.close();
|
functions.close();
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
public class JetFileFactory extends FileTypeFactory {
|
public class JetFileFactory extends FileTypeFactory {
|
||||||
@Override
|
@Override
|
||||||
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
|
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
|
||||||
// TODO: Remove unused extensions
|
consumer.consume(JetFileType.INSTANCE, "kt;kts;ktm");
|
||||||
consumer.consume(JetFileType.INSTANCE, "jet;jetl;jets;kt;kts;ktm");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
var x : <ref>Any?
|
var x : <ref>Any?
|
||||||
//jet/Any.jet:Any
|
//jet/Any.kt:Any
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
val empty = IntRange.<ref>EMPTY
|
val empty = IntRange.<ref>EMPTY
|
||||||
//jet/Ranges.jet:EMPTY
|
//jet/Ranges.kt:EMPTY
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
val x = 5.<ref>equals(5)
|
val x = 5.<ref>equals(5)
|
||||||
//jet/Numbers.jet:equals
|
//jet/Numbers.kt:equals
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
fun f(p : () -> String) {
|
fun f(p : () -> String) {
|
||||||
p.<ref>invoke()
|
p.<ref>invoke()
|
||||||
}
|
}
|
||||||
//jet/Functions.jet:invoke
|
//jet/Functions.kt:invoke
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
val x : <ref>Int?
|
val x : <ref>Int?
|
||||||
//jet/Numbers.jet:Int
|
//jet/Numbers.kt:Int
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
val ia = <ref>IntArray(4)
|
val ia = <ref>IntArray(4)
|
||||||
//jet/Arrays.jet:IntArray
|
//jet/Arrays.kt:IntArray
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
var x : <ref>Nothing
|
var x : <ref>Nothing
|
||||||
//jet/Nothing.jet:Nothing
|
//jet/Nothing.kt:Nothing
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
val x = 2.0 <ref>* 3.0
|
val x = 2.0 <ref>* 3.0
|
||||||
//jet/Numbers.jet:times
|
//jet/Numbers.kt:times
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
val x = 5.<ref>toString()
|
val x = 5.<ref>toString()
|
||||||
//jet/Library.jet:toString
|
//jet/Library.kt:toString
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
var x : <ref>Unit?
|
var x : <ref>Unit?
|
||||||
//jet/Unit.jet:Unit
|
//jet/Unit.kt:Unit
|
||||||
@@ -51,7 +51,7 @@ public class FunctionTest extends AbstractExpressionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClosureWithParameterAndBoxing() throws Exception {
|
public void testClosureWithParameterAndBoxing() throws Exception {
|
||||||
checkFooBoxIsOk("closureWithParameterAndBoxing.jet");
|
checkFooBoxIsOk("closureWithParameterAndBoxing.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnclosingThis() throws Exception {
|
public void testEnclosingThis() throws Exception {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public final class MiscTest extends AbstractExpressionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testLocalPropertys() throws Exception {
|
public void testLocalPropertys() throws Exception {
|
||||||
runFunctionOutputTest("localProperty.jet", "foo", "box", 50);
|
runFunctionOutputTest("localProperty.kt", "foo", "box", 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIntRange() throws Exception {
|
public void testIntRange() throws Exception {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public final class TraitTest extends SingleFileTranslationTest {
|
|||||||
|
|
||||||
|
|
||||||
public void testFunDelegation() throws Exception {
|
public void testFunDelegation() throws Exception {
|
||||||
checkFooBoxIsOk("funDelegation.jet");
|
checkFooBoxIsOk("funDelegation.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,12 +57,11 @@ public abstract class TranslatorTestCaseBuilder {
|
|||||||
|
|
||||||
public static void appendTestsInDirectory(String dataPath, boolean recursive,
|
public static void appendTestsInDirectory(String dataPath, boolean recursive,
|
||||||
final FilenameFilter filter, NamedTestFactory factory, TestSuite suite) {
|
final FilenameFilter filter, NamedTestFactory factory, TestSuite suite) {
|
||||||
final String extensionJet = ".jet";
|
|
||||||
final String extensionKt = ".kt";
|
final String extensionKt = ".kt";
|
||||||
final FilenameFilter extensionFilter = new FilenameFilter() {
|
final FilenameFilter extensionFilter = new FilenameFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File dir, String name) {
|
public boolean accept(File dir, String name) {
|
||||||
return name.endsWith(extensionJet) || name.endsWith(extensionKt);
|
return name.endsWith(extensionKt);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
FilenameFilter resultFilter;
|
FilenameFilter resultFilter;
|
||||||
@@ -98,7 +97,6 @@ public abstract class TranslatorTestCaseBuilder {
|
|||||||
for (File file : files) {
|
for (File file : files) {
|
||||||
String fileName = file.getName();
|
String fileName = file.getName();
|
||||||
assert fileName != null;
|
assert fileName != null;
|
||||||
String extension = fileName.endsWith(extensionJet) ? extensionJet : extensionKt;
|
|
||||||
suite.addTest(factory.createTest(fileName));
|
suite.addTest(factory.createTest(fileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,6 @@ public final class JetFileUtils {
|
|||||||
@NotNull Project project
|
@NotNull Project project
|
||||||
) {
|
) {
|
||||||
return (JetFile) PsiFileFactory.getInstance(project)
|
return (JetFile) PsiFileFactory.getInstance(project)
|
||||||
.createFileFromText(name.endsWith(".kt") ? name : name + ".jet", JetLanguage.INSTANCE, text, true, false);
|
.createFileFromText(name.endsWith(".kt") ? name : name + ".kt", JetLanguage.INSTANCE, text, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user