Permalink
Browse files

12.1

  • Loading branch information...
1 parent 36090e9 commit 4c7c4aac6a4c45c91b401f058ab79d96ca9f36ca @ignatov committed Mar 20, 2013
View
@@ -6,7 +6,7 @@ If you want to help but doesn't know how, you may check out issues [for collabor
Before sending a pull request please check that the **ErlangTestCase** is successfully passed. Moreover, new tests will be gladly accepted.
## Getting started with plugin development
-1. [Download](http://www.jetbrains.com/idea/download/) the 12 IntelliJ IDEA build and install it
+1. [Download](http://www.jetbrains.com/idea/download/) the latest 12.1 IntelliJ IDEA build and install it
1. Checkout plugin repo and open the project
1. Setup [IDEA SDK](http://confluence.jetbrains.net/display/IDEADEV/Getting+Started+with+Plugin+Development#GettingStartedwithPluginDevelopment-anchor2):
select the IDEA installation directory as SDK root
@@ -8,6 +8,7 @@
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.util.CommonProcessors;
@@ -86,7 +87,7 @@ public boolean apply(ErlangTarget target, File file, ErlangSourceRootDescriptor
CommonProcessors.CollectProcessor<File> processor = new CommonProcessors.CollectProcessor<File>() {
@Override
protected boolean accept(File file) {
- return !file.isDirectory() && FileUtil.getExtension(file.getName()).equals("erl");
+ return !file.isDirectory() && FileUtilRt.extensionEquals(file.getName(), "erl");
}
};
for (JpsModuleSourceRoot root : module.getSourceRoots()) {
@@ -1,10 +1,9 @@
package org.intellij.erlang.jps.builder;
-import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.io.FileUtilRt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.builders.BuildRootDescriptor;
import org.jetbrains.jps.builders.BuildTarget;
-import org.jetbrains.jps.cmdline.ProjectDescriptor;
import java.io.File;
import java.io.FileFilter;
@@ -36,12 +35,13 @@ public File getRootFile() {
return myErlangTarget;
}
+ @NotNull
@Override
- public FileFilter createFileFilter(@NotNull ProjectDescriptor descriptor) {
+ public FileFilter createFileFilter() {
return new FileFilter() {
@Override
public boolean accept(File file) {
- return FileUtil.getExtension(file.getName()).equals("erl");
+ return FileUtilRt.extensionEquals(file.getName(), "erl");
}
};
}
@@ -4,7 +4,7 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.builders.BuildTargetLoader;
-import org.jetbrains.jps.builders.BuildTargetType;
+import org.jetbrains.jps.builders.ModuleBasedBuildTargetType;
import org.jetbrains.jps.model.JpsDummyElement;
import org.jetbrains.jps.model.JpsModel;
import org.jetbrains.jps.model.module.JpsTypedModule;
@@ -15,7 +15,7 @@
/**
* @author @nik
*/
-public class ErlangTargetType extends BuildTargetType<ErlangTarget> {
+public class ErlangTargetType extends ModuleBasedBuildTargetType<ErlangTarget> {
public static final ErlangTargetType PRODUCTION = new ErlangTargetType("erlang-production", false);
public static final ErlangTargetType TESTS = new ErlangTargetType("erlang-tests", true);
private final boolean myTests;
View
@@ -2,7 +2,7 @@
<id>org.jetbrains.erlang</id>
<version>0.4.1</version>
<vendor email="sergey.ignatov@jetbrains.com" logo="">Sergey Ignatov</vendor>
- <idea-version since-build="123.1" until-build="123.9999"/>
+ <idea-version since-build="129.1" until-build="129.9999"/>
<depends>com.intellij.modules.lang</depends>
<depends optional="true" config-file="erlang-copyright.xml">com.intellij.copyright</depends>
@@ -199,7 +199,7 @@ public ChildAttributes getChildAttributes(int newChildIndex) {
@Nullable
private static Indent getChildIndent(@Nullable IElementType type) {
if (BLOCKS_TOKEN_SET.contains(type)) {
- return Indent.getNormalIndent(true);
+ return Indent.getNormalIndent(false);
}
if (type == ERL_IF_EXPRESSION || type == ERL_CASE_EXPRESSION) {
return Indent.getNormalIndent(true);
@@ -71,6 +71,7 @@
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
@@ -93,7 +94,7 @@ protected void checkFile(PsiFile file, final ProblemsHolder problemsHolder) {
file.accept(new ErlangRecursiveVisitor() {
@Override
public void visitModule(@NotNull ErlangModule o) {
- String ext = FileUtil.getExtension(o.getContainingFile().getName());
+ String ext = FileUtilRt.getExtension(o.getContainingFile().getName());
String withoutExtension = FileUtil.getNameWithoutExtension(o.getContainingFile().getName());
String moduleName = StringUtil.replace(o.getName(), "'", "");
ErlangCompositeElement atom = o.getQAtom();
@@ -153,7 +154,7 @@ public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor proble
public ErlangRenameFileFix(ErlangModule module) {
myModule = module;
- myExtension = FileUtil.getExtension(myModule.getContainingFile().getName());
+ myExtension = FileUtilRt.getExtension(myModule.getContainingFile().getName());
}
@NotNull
@@ -142,10 +142,10 @@ public String fun(PsiElement element) {
new GutterIconNavigationHandler<PsiElement>() {
@Override
public void navigate(MouseEvent e, PsiElement elt) {
+ String title = MessageFormat.format("<html><body>Choose Overriding Callback of <b>{0}</b> ({1} callbacks found)</body></html>", presentation, prototypes.size());
PsiElementListNavigator.openTargets(
e, navigatables.toArray(new NavigatablePsiElement[navigatables.size()]),
- MessageFormat.format("<html><body>Choose Overriding Callback of <b>{0}</b> ({1} callbacks found)</body></html>", presentation, prototypes.size()),
- new DefaultPsiElementCellRenderer()
+ title, title, new DefaultPsiElementCellRenderer()
);
}
},
@@ -34,7 +34,7 @@
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
-import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
@@ -48,7 +48,10 @@
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.search.SearchScope;
import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.util.*;
+import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.PathUtil;
import com.intellij.util.containers.ContainerUtil;
import org.apache.commons.lang.StringUtils;
import org.intellij.erlang.*;
@@ -638,7 +641,7 @@ public static PsiElement setName(@NotNull ErlangModule o, String newName) {
VirtualFile virtualFile = o.getContainingFile().getVirtualFile();
if (virtualFile != null) {
try {
- String ext = FileUtil.getExtension(virtualFile.getName());
+ String ext = FileUtilRt.getExtension(virtualFile.getName());
virtualFile.rename(o, StringUtil.replace(newName, "'", "") + "." + ext);
ErlangQAtom qAtom = o.getQAtom();
@@ -1079,4 +1082,4 @@ public static String getCallbackSpecName(@NotNull ErlangCallbackSpec spec) {
ErlangFunTypeArguments arguments = funType != null ? funType.getFunTypeArguments() : null;
return arguments != null ? arguments.getTopTypeList() : ContainerUtil.<ErlangTopType>emptyList();
}
-}
+}
@@ -68,11 +68,7 @@ protected RunContentDescriptor doExecute(@NotNull Project project,
@NotNull ExecutionEnvironment env)
throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
- final RebarRunningState rebarRunningState = (RebarRunningState) state;
- final ExecutionResult result = rebarRunningState.execute(executor, this);
- final RunContentBuilder contentBuilder = new RunContentBuilder(project, this, executor);
- contentBuilder.setExecutionResult(result);
- contentBuilder.setEnvironment(env);
- return contentBuilder.showRunContent(contentToReuse);
+ ExecutionResult result = state.execute(executor, this);
+ return new RunContentBuilder(project, this, executor, result, env).showRunContent(contentToReuse);
}
}
@@ -88,11 +88,6 @@ protected RunContentDescriptor doExecute(Project project,
FileDocumentManager.getInstance().saveAllDocuments();
ExecutionResult executionResult = runningState.execute(executor, this);
- if (executionResult == null) return null;
-
- final RunContentBuilder contentBuilder = new RunContentBuilder(project, this, executor);
- contentBuilder.setExecutionResult(executionResult);
- contentBuilder.setEnvironment(env);
- return contentBuilder.showRunContent(contentToReuse);
+ return new RunContentBuilder(project, this, executor, executionResult, env).showRunContent(contentToReuse);
}
}

0 comments on commit 4c7c4aa

Please sign in to comment.