mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 09:03:31 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+4
-3
@@ -32,6 +32,7 @@ import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.ScrollingUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -56,7 +57,7 @@ public abstract class LookupActionHandler extends EditorActionHandler {
|
||||
LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(editor);
|
||||
if (lookup == null || !lookup.isAvailableToUser() || myRequireFocusedLookup && !lookup.isFocused()) {
|
||||
Project project = editor.getProject();
|
||||
if (project != null) {
|
||||
if (project != null && lookup != null) {
|
||||
LookupManager.getInstance(project).hideActiveLookup();
|
||||
}
|
||||
myOriginalHandler.execute(editor, caret, dataContext);
|
||||
@@ -70,9 +71,9 @@ public abstract class LookupActionHandler extends EditorActionHandler {
|
||||
protected abstract void executeInLookup(LookupImpl lookup, DataContext context, @Nullable Caret caret);
|
||||
|
||||
@Override
|
||||
public boolean isEnabled(Editor editor, DataContext dataContext) {
|
||||
public boolean isEnabledForCaret(@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) {
|
||||
LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(editor);
|
||||
return lookup != null || myOriginalHandler.isEnabled(editor, dataContext);
|
||||
return lookup != null || myOriginalHandler.isEnabled(editor, caret, dataContext);
|
||||
}
|
||||
|
||||
private static void executeUpOrDown(LookupImpl lookup, boolean up) {
|
||||
|
||||
@@ -193,6 +193,10 @@ public class GitSkippedCommits extends PanelWithActionsAndCloseButton {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for vcs root
|
||||
*/
|
||||
|
||||
+5
@@ -4,6 +4,7 @@ import com.intellij.ide.projectView.ProjectView;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -50,6 +51,10 @@ public abstract class CCRenameHandler implements RenameHandler {
|
||||
}
|
||||
rename(project, course, directory);
|
||||
ProjectView.getInstance(project).refresh();
|
||||
FileEditorManagerEx managerEx = FileEditorManagerEx.getInstanceEx(project);
|
||||
for (VirtualFile virtualFile : managerEx.getOpenFiles()) {
|
||||
managerEx.updateFilePresentation(virtualFile);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void rename(@NotNull Project project, @NotNull Course course, @NotNull PsiDirectory directory);
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@ public class CCCreateStudyItemPanel extends JPanel {
|
||||
public CCCreateStudyItemPanel(String itemName, String thresholdName, int thresholdIndex) {
|
||||
myThresholdName = thresholdName;
|
||||
myItemName = itemName;
|
||||
myNameField.setText(itemName + thresholdIndex);
|
||||
int newIndex = thresholdIndex + 1;
|
||||
myNameField.setText(itemName + newIndex);
|
||||
add(myPanel, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public class CCItemPositionPanel extends JPanel {
|
||||
group.add(myAfterButton);
|
||||
myBeforeButton.setText("before " + postfix);
|
||||
myAfterButton.setText("after " + postfix);
|
||||
myBeforeButton.setSelected(true);
|
||||
myAfterButton.setSelected(true);
|
||||
}
|
||||
|
||||
public int getIndexDelta() {
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
<statistics.usagesCollector implementation="com.jetbrains.edu.learning.statistics.EduUsagesCollector"/>
|
||||
<applicationService serviceImplementation="com.jetbrains.edu.learning.statistics.EduUsagesCollector"/>
|
||||
<applicationService serviceImplementation="com.jetbrains.edu.learning.stepic.StepicUpdateSettings"/>
|
||||
<editorTabTitleProvider implementation="com.jetbrains.edu.learning.StudyTabTitleProvider"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="Edu">
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.jetbrains.edu.learning;
|
||||
|
||||
import com.intellij.openapi.fileEditor.impl.EditorTabTitleProvider;
|
||||
import com.intellij.openapi.fileEditor.impl.UniqueNameEditorTabTitleProvider;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.jetbrains.edu.learning.core.EduNames;
|
||||
import com.jetbrains.edu.learning.courseFormat.Lesson;
|
||||
import com.jetbrains.edu.learning.courseFormat.Task;
|
||||
import com.jetbrains.edu.learning.courseFormat.TaskFile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class StudyTabTitleProvider implements EditorTabTitleProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public String getEditorTabTitle(Project project, VirtualFile file) {
|
||||
TaskFile taskFile = StudyUtils.getTaskFile(project, file);
|
||||
if (taskFile == null) {
|
||||
return null;
|
||||
}
|
||||
String title = new UniqueNameEditorTabTitleProvider().getEditorTabTitle(project, file);
|
||||
if (title == null) {
|
||||
return null;
|
||||
}
|
||||
String[] split = title.split(File.separator);
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
String part = split[i];
|
||||
Task task = taskFile.getTask();
|
||||
VirtualFile taskDir = task.getTaskDir(project);
|
||||
if (taskDir != null && part.equals(taskDir.getName())) {
|
||||
split[i] = task.getName();
|
||||
continue;
|
||||
}
|
||||
Lesson lesson = task.getLesson();
|
||||
int lessonIndex = lesson.getIndex();
|
||||
if (part.equals(EduNames.LESSON + lessonIndex)) {
|
||||
split[i] = lesson.getName();
|
||||
}
|
||||
}
|
||||
return StringUtil.join(split, File.separator);
|
||||
}
|
||||
}
|
||||
@@ -288,12 +288,15 @@ public class PyNames {
|
||||
//_BuiltinMethods.put("__author__", _only_self_descr);
|
||||
//_BuiltinMethods.put("__bases__", _only_self_descr);
|
||||
.put("__call__", new BuiltinDescription("(self, *args, **kwargs)"))
|
||||
.put("__ceil__", _only_self_descr)
|
||||
//_BuiltinMethods.put("__class__", _only_self_descr);
|
||||
.put("__cmp__", _self_other_descr)
|
||||
.put("__coerce__", _self_other_descr)
|
||||
.put("__complex__", _only_self_descr)
|
||||
.put("__contains__", _self_item_descr)
|
||||
.put("__copy__", _only_self_descr)
|
||||
//_BuiltinMethods.put("__debug__", _only_self_descr);
|
||||
.put("__deepcopy__", new BuiltinDescription("(self, memodict={})"))
|
||||
.put("__del__", _only_self_descr)
|
||||
.put("__delete__", new BuiltinDescription("(self, instance)"))
|
||||
.put("__delattr__", _self_item_descr)
|
||||
@@ -308,14 +311,18 @@ public class PyNames {
|
||||
.put("__eq__", _self_other_descr)
|
||||
//_BuiltinMethods.put("__file__", _only_self_descr);
|
||||
.put("__float__", _only_self_descr)
|
||||
.put("__floor__", _only_self_descr)
|
||||
.put("__floordiv__", _self_other_descr)
|
||||
//_BuiltinMethods.put("__future__", _only_self_descr);
|
||||
.put("__ge__", _self_other_descr)
|
||||
.put("__get__", new BuiltinDescription("(self, instance, owner)"))
|
||||
.put("__getattr__", _self_item_descr)
|
||||
.put("__getattribute__", _self_item_descr)
|
||||
.put("__getinitargs__", _only_self_descr)
|
||||
.put("__getitem__", _self_item_descr)
|
||||
.put("__getnewargs__", _only_self_descr)
|
||||
//_BuiltinMethods.put("__getslice__", new BuiltinDescription("(self, i, j)"));
|
||||
.put("__getstate__", _only_self_descr)
|
||||
.put("__gt__", _self_other_descr)
|
||||
.put("__hash__", _only_self_descr)
|
||||
.put("__hex__", _only_self_descr)
|
||||
@@ -345,6 +352,7 @@ public class PyNames {
|
||||
.put("__lt__", _self_other_descr)
|
||||
//_BuiltinMethods.put("__members__", _only_self_descr);
|
||||
//_BuiltinMethods.put("__metaclass__", _only_self_descr);
|
||||
.put("__missing__", _self_key_descr)
|
||||
.put("__mod__", _self_other_descr)
|
||||
//_BuiltinMethods.put("__mro__", _only_self_descr);
|
||||
.put("__mul__", _self_other_descr)
|
||||
@@ -362,6 +370,7 @@ public class PyNames {
|
||||
.put("__rdiv__", _self_other_descr)
|
||||
.put("__rdivmod__", _self_other_descr)
|
||||
.put("__reduce__", _only_self_descr)
|
||||
.put("__reduce_ex__", new BuiltinDescription("(self, protocol)"))
|
||||
.put("__repr__", _only_self_descr)
|
||||
.put("__reversed__", _only_self_descr)
|
||||
.put("__rfloordiv__", _self_other_descr)
|
||||
@@ -384,6 +393,7 @@ public class PyNames {
|
||||
.put("__str__", _only_self_descr)
|
||||
.put("__sub__", _self_other_descr)
|
||||
.put("__truediv__", _self_other_descr)
|
||||
.put("__trunc__", _only_self_descr)
|
||||
.put("__unicode__", _only_self_descr)
|
||||
//_BuiltinMethods.put("__version__", _only_self_descr);
|
||||
.put("__xor__", _self_other_descr)
|
||||
@@ -401,8 +411,10 @@ public class PyNames {
|
||||
.put("__bool__", _only_self_descr)
|
||||
.put("__bytes__", _only_self_descr)
|
||||
.put("__format__", new BuiltinDescription("(self, format_spec)"))
|
||||
.put("__instancecheck__", new BuiltinDescription("(self, instance)"))
|
||||
.put("__prepare__", new BuiltinDescription("(metacls, name, bases)"))
|
||||
.put("__round__", new BuiltinDescription("(self, n=None)"))
|
||||
.put("__subclasscheck__", new BuiltinDescription("(self, subclass)"))
|
||||
.put(DUNDER_NEXT, _only_self_descr)
|
||||
.build();
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
class Cl(object):
|
||||
def __rp<caret>
|
||||
def __rpo<caret>
|
||||
Reference in New Issue
Block a user