Introduce constant for "kt".
This commit is contained in:
@@ -24,7 +24,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import javax.swing.*;
|
||||
|
||||
public class JetFileType extends LanguageFileType {
|
||||
public static final String EXTENSION = "kt";
|
||||
public static final JetFileType INSTANCE = new JetFileType();
|
||||
|
||||
private final NotNullLazyValue<Icon> myIcon = new NotNullLazyValue<Icon>() {
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -52,7 +54,7 @@ public class JetFileType extends LanguageFileType {
|
||||
@Override
|
||||
@NotNull
|
||||
public String getDefaultExtension() {
|
||||
return "kt";
|
||||
return EXTENSION;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class JsHeaderLibraryDetectionUtil {
|
||||
@Override
|
||||
protected boolean accept(VirtualFile file) {
|
||||
String extension = file.getExtension();
|
||||
return extension != null && extension.equals(JetFileType.INSTANCE.getDefaultExtension());
|
||||
return extension != null && extension.equals(JetFileType.EXTENSION);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import com.intellij.refactoring.ui.MethodSignatureComponent
|
||||
public class KotlinFunctionSignatureComponent(
|
||||
signature: String, project: Project
|
||||
) : MethodSignatureComponent(signature, project, JetFileType.INSTANCE) {
|
||||
private val myFileName = "dummy." + JetFileType.INSTANCE.getDefaultExtension()
|
||||
private val myFileName = "dummy." + JetFileType.EXTENSION
|
||||
|
||||
override fun getFileName(): String = myFileName
|
||||
}
|
||||
@@ -168,7 +168,7 @@ fun createMoveUsageInfo(
|
||||
|
||||
public fun JetNamedDeclaration.getFileNameAfterMove(): String? {
|
||||
return (getContainingFile() as? JetFile)?.let { file ->
|
||||
if (file.getDeclarations().size > 1) "${getName()}.${JetFileType.INSTANCE.getDefaultExtension()}" else file.getName()
|
||||
if (file.getDeclarations().size > 1) "${getName()}.${JetFileType.EXTENSION}" else file.getName()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user