mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
failing test for PY-1065
This commit is contained in:
@@ -176,6 +176,7 @@
|
||||
serviceImplementation="com.jetbrains.python.psi.resolve.PythonPathCache"/>
|
||||
|
||||
<preserveIndentOnPaste fileType="Python"/>
|
||||
<lang.whiteSpaceFormattingStrategy language="Python" implementationClass="com.jetbrains.python.formatter.PyWhiteSpaceFormattingStrategy"/>
|
||||
|
||||
<!-- Django -->
|
||||
<codeInsight.lineMarkerProvider language="Python" implementationClass="com.jetbrains.django.annotator.ViewMethodLineMarkerProvider"/>
|
||||
|
||||
@@ -98,9 +98,11 @@ public class PyBlock implements ASTBlock {
|
||||
// whitespace between sub-blocks would include \ characters,
|
||||
// because the IDEA 5.0/5.1 formatter core requires that whitespace
|
||||
// between blocks must include whitespace-only characters
|
||||
/*
|
||||
if (child.getText().indexOf('\\') >= 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
*/
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.jetbrains.python.formatter;
|
||||
|
||||
import com.intellij.formatting.WhiteSpaceFormattingStrategy;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PyWhiteSpaceFormattingStrategy implements WhiteSpaceFormattingStrategy {
|
||||
@Override
|
||||
public int check(@NotNull CharSequence text, int start, int end) {
|
||||
for (int i = start; i < end; i++) {
|
||||
char c = text.charAt(i);
|
||||
if (c != ' ' && c != '\t' && c != '\n' && c != '\\') {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return end;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
import contextlib,\
|
||||
math,decimal
|
||||
@@ -0,0 +1,2 @@
|
||||
import contextlib,\
|
||||
math, decimal
|
||||
@@ -72,6 +72,10 @@ public class PyFormatterTest extends PyLightFixtureTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void _testSpaceAfterCommaWrappedLine() { // PY-1065
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
myFixture.configureByFile("formatter/" + getTestName(true) + ".py");
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user