mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
### Generic words ###
|
||||
f### Generic words ###
|
||||
GNAME.function=function
|
||||
GNAME.class=class
|
||||
GNAME.var=variable
|
||||
|
||||
@@ -25,7 +25,7 @@ public abstract class PythonModuleTypeBase<T extends ModuleBuilder> extends Modu
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "Provides facilities for developing Python, Django and Google App Engine applications";
|
||||
return "Python modules are used for developing <b>Python</b> applications. Supported technologies include <b>Django, Google App Engine, Mako, Jinja2</b> and others.";
|
||||
}
|
||||
|
||||
public Icon getBigIcon() {
|
||||
|
||||
@@ -84,13 +84,20 @@ public class PyDebugSupportUtils {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isContinuationLine(@NotNull Document document, int line) {
|
||||
@Nullable
|
||||
private static String getLineText(@NotNull Document document, int line) {
|
||||
if (line > 0 && line < document.getLineCount()) {
|
||||
String text = document.getText(TextRange.create(document.getLineStartOffset(line), document.getLineEndOffset(line)));
|
||||
if (text.trim().endsWith("\\")) {
|
||||
return true;
|
||||
}
|
||||
return document.getText(TextRange.create(document.getLineStartOffset(line), document.getLineEndOffset(line)));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isContinuationLine(@NotNull Document document, int line) {
|
||||
String text = getLineText(document, line);
|
||||
if (text != null && text.trim().endsWith("\\")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.psi.PyCallExpression;
|
||||
import com.jetbrains.python.psi.PyElement;
|
||||
import com.jetbrains.python.psi.PyExpression;
|
||||
import com.jetbrains.python.psi.PyFunction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -40,14 +39,15 @@ public class PySmartStepIntoHandler extends XSmartStepIntoHandler<PySmartStepInt
|
||||
final Document document = FileDocumentManager.getInstance().getDocument(position.getFile());
|
||||
final List<PySmartStepIntoVariant> variants = Lists.newArrayList();
|
||||
final Set<PyCallExpression> visitedCalls = Sets.newHashSet();
|
||||
final Set<PyFunction> addedFunctions = Sets.newHashSet();
|
||||
|
||||
XDebuggerUtil.getInstance().iterateLine(mySession.getProject(), document, position.getLine(), new Processor<PsiElement>() {
|
||||
final int line = position.getLine();
|
||||
XDebuggerUtil.getInstance().iterateLine(mySession.getProject(), document, line, new Processor<PsiElement>() {
|
||||
public boolean process(PsiElement psiElement) {
|
||||
addVariants(psiElement, variants, visitedCalls, addedFunctions);
|
||||
addVariants(document, line, psiElement, variants, visitedCalls);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
return variants;
|
||||
}
|
||||
|
||||
@@ -60,15 +60,16 @@ public class PySmartStepIntoHandler extends XSmartStepIntoHandler<PySmartStepInt
|
||||
return PyBundle.message("debug.popup.title.step.into.function");
|
||||
}
|
||||
|
||||
private static void addVariants(@Nullable PsiElement element,
|
||||
private static void addVariants(Document document, int line, @Nullable PsiElement element,
|
||||
List<PySmartStepIntoVariant> variants,
|
||||
Set<PyCallExpression> visited,
|
||||
Set<PyFunction> addedFunctions) {
|
||||
Set<PyCallExpression> visited) {
|
||||
if (element == null) return;
|
||||
|
||||
final PyCallExpression expression = PsiTreeUtil.getParentOfType(element, PyCallExpression.class);
|
||||
if (expression != null && visited.add(expression)) {
|
||||
addVariants(expression.getParent(), variants, visited, addedFunctions);
|
||||
if (expression != null &&
|
||||
expression.getTextRange().getEndOffset() <= document.getLineEndOffset(line) &&
|
||||
visited.add(expression)) {
|
||||
addVariants(document, line, expression.getParent(), variants, visited);
|
||||
PyExpression ref = expression.getCallee();
|
||||
|
||||
variants.add(new PySmartStepIntoVariant(ref));
|
||||
|
||||
Reference in New Issue
Block a user