Merge remote-tracking branch 'origin/master'

This commit is contained in:
Konstantin Bulenkov
2013-10-21 22:12:51 +02:00
12 changed files with 56 additions and 28 deletions
@@ -1089,9 +1089,8 @@ public class PluginManagerCore {
ourPlugins = pluginDescriptors;
}
private static void registerExtensionPointsAndExtensions(ExtensionsArea area, List<IdeaPluginDescriptorImpl> result) {
for (IdeaPluginDescriptorImpl descriptor : result) {
if (shouldSkipPlugin(descriptor)) continue;
private static void registerExtensionPointsAndExtensions(ExtensionsArea area, List<IdeaPluginDescriptorImpl> loadedPlugins) {
for (IdeaPluginDescriptorImpl descriptor : loadedPlugins) {
descriptor.registerExtensionPoints(area);
}
@@ -1100,8 +1099,7 @@ public class PluginManagerCore {
epNames.add(point.getName());
}
for (IdeaPluginDescriptorImpl descriptor : result) {
if (shouldSkipPlugin(descriptor)) continue;
for (IdeaPluginDescriptorImpl descriptor : loadedPlugins) {
for (String epName : epNames) {
descriptor.registerExtensions(area, epName);
}
@@ -24,8 +24,10 @@ import com.intellij.openapi.ui.Splitter;
import com.intellij.openapi.util.Condition;
import com.intellij.platform.ModuleAttachProcessor;
import com.intellij.ui.CollectionListModel;
import com.intellij.ui.ListSpeedSearch;
import com.intellij.ui.components.JBList;
import com.intellij.ui.components.JBScrollPane;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
@@ -93,6 +95,15 @@ public abstract class ModuleAwareProjectConfigurable<T extends UnnamedConfigurab
}
final Splitter splitter = new Splitter(false, 0.25f);
final JBList moduleList = new JBList(new CollectionListModel<Module>(modules));
new ListSpeedSearch(moduleList, new Function<Object, String>() {
@Override
public String fun(Object o) {
if (o instanceof Module) {
return ((Module)o).getName();
}
return null;
}
});
moduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
moduleList.setCellRenderer(new ModuleListCellRenderer());
splitter.setFirstComponent(new JBScrollPane(moduleList));
@@ -18,15 +18,17 @@ package com.intellij.ide.actions;
import com.intellij.ide.FileEditorProvider;
import com.intellij.ide.SelectInContext;
import com.intellij.ide.structureView.StructureView;
import com.intellij.ide.structureView.StructureViewBuilder;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.Navigatable;
import com.intellij.psi.PsiDocumentManager;
@@ -35,6 +37,7 @@ import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ObjectUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -139,7 +142,11 @@ public abstract class SelectInContextImpl implements SelectInContext {
return new TextEditorContext((TextEditor)editor, psiFile);
}
else {
return new SimpleSelectInContext(psiFile);
StructureViewBuilder builder = editor.getStructureViewBuilder();
StructureView structureView = builder != null ? builder.createStructureView(editor, project) : null;
Object selectorInFile = structureView != null ? structureView.getTreeModel().getCurrentEditorElement() : null;
if (structureView != null) Disposer.dispose(structureView);
return new SimpleSelectInContext(psiFile, ObjectUtils.chooseNotNull(selectorInFile, psiFile));
}
}
@@ -235,10 +242,16 @@ public abstract class SelectInContextImpl implements SelectInContext {
}
private static class SimpleSelectInContext extends SelectInContextImpl {
private final PsiElement myElementToSelect;
private final Object mySelector;
public SimpleSelectInContext(PsiFile psiFile) {
this(psiFile, psiFile);
public SimpleSelectInContext(PsiFile psiFile, Object selector) {
super(psiFile);
mySelector = selector;
}
@Override
public Object getSelectorInFile() {
return mySelector;
}
@Override
@@ -246,7 +259,7 @@ public abstract class SelectInContextImpl implements SelectInContext {
return new FileEditorProvider() {
@Override
public FileEditor openFileEditor() {
final VirtualFile file = myElementToSelect.getContainingFile().getVirtualFile();
final VirtualFile file = myPsiFile.getVirtualFile();
if (file == null) {
return null;
}
@@ -254,11 +267,6 @@ public abstract class SelectInContextImpl implements SelectInContext {
}
};
}
public SimpleSelectInContext(PsiFile psiFile, PsiElement elementToSelect) {
super(psiFile);
myElementToSelect = elementToSelect;
}
}
private static class VirtualFileSelectInContext implements SelectInContext {
@@ -86,7 +86,7 @@ public class NameSuggestionsField extends JPanel {
this(suggestedNames, project, fileType);
if (editor == null) return;
// later here because EditorTextField creates Editor during addNotify()
SwingUtilities.invokeLater(new Runnable() {
final Runnable selectionRunnable = new Runnable() {
@Override
public void run() {
final int offset = editor.getCaretModel().getOffset();
@@ -99,9 +99,11 @@ public class NameSuggestionsField extends JPanel {
if (!word.equals(getEnteredName())) continue;
final SelectionModel selectionModel = editor.getSelectionModel();
myEditor.getSelectionModel().removeSelection();
int myOffset = offset - wordRange.getStartOffset();
final int wordRangeStartOffset = wordRange.getStartOffset();
int myOffset = offset - wordRangeStartOffset;
myEditor.getCaretModel().moveToOffset(myOffset);
TextRange selected = new TextRange(selectionModel.getSelectionStart(), selectionModel.getSelectionEnd()).shiftRight(-wordRange.getStartOffset());
TextRange selected = new TextRange(Math.max(0, selectionModel.getSelectionStart() - wordRangeStartOffset),
selectionModel.getSelectionEnd() - wordRangeStartOffset);
selected = selected.intersection(new TextRange(0, myEditor.getDocument().getTextLength()));
if (selectionModel.hasSelection() && selected != null && !selected.isEmpty()) {
myEditor.getSelectionModel().setSelection(selected.getStartOffset(), selected.getEndOffset());
@@ -112,7 +114,8 @@ public class NameSuggestionsField extends JPanel {
break;
}
}
});
};
SwingUtilities.invokeLater(selectionRunnable);
}
protected boolean shouldSelectAll() {
@@ -63,6 +63,7 @@ public class PluginAdvertiserEditorNotificationProvider extends EditorNotificati
if (file.getFileType() != PlainTextFileType.INSTANCE) return null;
final String extension = file.getExtension();
if (extension == null) return null;
if (myEnabledExtensions.contains(extension) ||
UnknownFeaturesCollector.getInstance(myProject).isIgnored(createExtensionFeature(extension))) return null;
@@ -123,7 +123,7 @@ public class PluginsAdvertiser implements StartupActivity {
streamReader.close();
}
}
catch (IOException e) {
catch (Throwable e) {
LOG.info(e);
return null;
}
@@ -15,6 +15,8 @@
*/
package com.intellij.openapi.updateSettings.impl.pluginsAdvertisement;
import org.jetbrains.annotations.NotNull;
/**
* User: anna
*/
@@ -22,7 +24,7 @@ public class UnknownFeature {
private final String myFeatureType;
private final String myImplementationName;
public UnknownFeature(String featureType, String implementationName) {
public UnknownFeature(@NotNull String featureType, @NotNull String implementationName) {
myFeatureType = featureType;
myImplementationName = implementationName;
}
+1 -1
View File
@@ -208,7 +208,7 @@ private String appInfoFile(String classesPath) {
private layoutFull(Map args, String target, Set usedJars) {
def openapiModules = pycharmPlatformApiModules()
def superLayouts = includeFile("$home/build/scripts/layouts.gant")
def superLayouts = includeFile("$ch/build/scripts/layouts.gant")
def result = layout(target) {
dir("lib") {
jar("util.jar") {
@@ -11,6 +11,9 @@
<applicationService serviceInterface="com.jetbrains.python.run.PyCommonOptionsFormFactory"
serviceImplementation="com.jetbrains.python.run.PyPluginCommonOptionsFormFactory"/>
<completion.contributor language="Python" implementationClass="com.jetbrains.python.psi.impl.PyConstructorArgumentCompletionContributor"/>
<!-- Console folding for Jython only, thus it's located in python-plugin only -->
<stacktrace.fold substring="*sys-package-mgr*:"/>
</extensions>
<extensions defaultExtensionNs="Pythonid">
+1 -1
View File
@@ -653,7 +653,7 @@
<add-to-group group-id="ProjectViewPopupMenuRunGroup" anchor="first"/>
</action>
<action id="CleanPyc" class="com.jetbrains.python.actions.CleanPycAction" text="Clean .pyc"
<action id="CleanPyc" class="com.jetbrains.python.actions.CleanPycAction" text="Clean Python Compiled Files"
description="Delete compiled bytecode files in selected directory and its subdirectories">
<add-to-group group-id="ProjectViewPopupMenu" anchor="after" relative-to-action="ProjectViewPopupMenuRefactoringGroup"/>
</action>
@@ -51,9 +51,9 @@ public class CleanPycAction extends AnAction {
}
FileUtil.asyncDelete(pycFiles);
}
}, "Cleaning up .py files...", false, e.getProject());
}, "Cleaning up .pyc files...", false, e.getProject());
final StatusBar statusBar = WindowManager.getInstance().getIdeFrame(e.getProject()).getStatusBar();
statusBar.setInfo("Deleted " + pycFiles.size() + " bytecode file" + (pycFiles.size() > 1 ? "s" : ""));
statusBar.setInfo("Deleted " + pycFiles.size() + " bytecode file" + (pycFiles.size() != 1 ? "s" : ""));
}
private static void collectPycFiles(File directory, final List<File> pycFiles) {
@@ -62,7 +62,8 @@ public class CleanPycAction extends AnAction {
public boolean process(File file) {
if (file.getParentFile().getName().equals(PyNames.PYCACHE) ||
FileUtilRt.extensionEquals(file.getName(), "pyc") ||
FileUtilRt.extensionEquals(file.getName(), "pyo")) {
FileUtilRt.extensionEquals(file.getName(), "pyo") ||
FileUtilRt.extensionEquals(file.getName(), "$py.class")) {
pycFiles.add(file);
}
return true;
@@ -22,6 +22,7 @@ import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.AddEditRemovePanel;
import com.intellij.ui.ColoredTableCellRenderer;
import com.intellij.ui.JBColor;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.PlatformUtils;
import org.jetbrains.annotations.Nls;
@@ -125,7 +126,7 @@ public class PythonDocumentationConfigurable implements SearchableConfigurable,
closeBrace = text.length();
else
closeBrace++;
append(text.substring(openBrace, closeBrace), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, Color.blue.darker()));
append(text.substring(openBrace, closeBrace), new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, JBColor.BLUE.darker()));
pos = closeBrace;
}
}