mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed PY-8159 Lines continued with \ in doctest are marked as errors
This commit is contained in:
+11
-1
@@ -28,12 +28,22 @@ public class PyDocstringLanguageInjector implements LanguageInjector {
|
||||
|
||||
int currentPosition = 0;
|
||||
int maxPosition = text.length();
|
||||
boolean endsWithSlash = false;
|
||||
for (String string : strings) {
|
||||
final String trimmedString = string.trim();
|
||||
if (!trimmedString.startsWith(">>>") && !trimmedString.startsWith("...") && gotExample && start < end) {
|
||||
gotExample = false;
|
||||
injectionPlacesRegistrar.addPlace(PyDocstringLanguageDialect.getInstance(), TextRange.create(start, end), null, null);
|
||||
if (!endsWithSlash)
|
||||
injectionPlacesRegistrar.addPlace(PyDocstringLanguageDialect.getInstance(), TextRange.create(start, end), null, null);
|
||||
}
|
||||
if (endsWithSlash) {
|
||||
endsWithSlash = false;
|
||||
injectionPlacesRegistrar.addPlace(PyDocstringLanguageDialect.getInstance(),
|
||||
TextRange.create(start, getEndOffset(currentPosition, string, maxPosition)), null, null);
|
||||
}
|
||||
if (trimmedString.endsWith("\\"))
|
||||
endsWithSlash = true;
|
||||
|
||||
if (trimmedString.startsWith(">>>")) {
|
||||
if (!gotExample)
|
||||
start = currentPosition;
|
||||
|
||||
Reference in New Issue
Block a user