mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
PY-34591 Add default implementation for broken API
This commit is contained in:
@@ -6,6 +6,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
||||
public interface PyPositionConverter {
|
||||
@Deprecated
|
||||
@NotNull
|
||||
PySourcePosition create(@NotNull final String file, final int line);
|
||||
|
||||
/**
|
||||
* @param file filepath in position on Python side
|
||||
@@ -14,14 +17,18 @@ public interface PyPositionConverter {
|
||||
* Python side, but also navigatable in the IDE editor.
|
||||
*/
|
||||
@NotNull
|
||||
PySourcePosition convertPythonToFrame(@NotNull final String file, final int line);
|
||||
default PySourcePosition convertPythonToFrame(@NotNull final String file, final int line) {
|
||||
return create(file, line);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param position shown in Frames window
|
||||
* @return position on Python side
|
||||
*/
|
||||
@NotNull
|
||||
PySourcePosition convertFrameToPython(@NotNull PySourcePosition position);
|
||||
default PySourcePosition convertFrameToPython(@NotNull PySourcePosition position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param position source position in the IDE editor
|
||||
|
||||
@@ -54,6 +54,12 @@ public class PyLocalPositionConverter implements PyPositionConverter {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public PySourcePosition create(@NotNull String file, int line) {
|
||||
return convertPythonToFrame(file, line);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public PySourcePosition convertPythonToFrame(@NotNull final String filePath, final int line) {
|
||||
|
||||
Reference in New Issue
Block a user