mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-8325 Do not reset chunk position if it was parsed
This commit is contained in:
@@ -491,7 +491,9 @@ public class PyStringFormatInspection extends PyInspection {
|
||||
as(chunks.get(i), PyStringFormatParser.NewStyleSubstitutionChunk.class);
|
||||
|
||||
if (chunk != null) {
|
||||
chunk.setPosition(i);
|
||||
if (chunk.getPosition() == null) {
|
||||
chunk.setPosition(i);
|
||||
}
|
||||
String mappingKey = inspectNewStyleChunkAndGetMappingKey(chunk);
|
||||
if (!isProblem()) {
|
||||
inspectArguments(chunk, mappingKey);
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<warning descr="Too few mapping keys">'Hello, {1}'</warning>.format('World')
|
||||
<warning descr="Too few mapping keys">'Hello, {} {}!'</warning>.format('World')
|
||||
@@ -189,6 +189,11 @@ public class PyStringFormatInspectionTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-8325
|
||||
public void testTooFewMappingKeys() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-20599
|
||||
public void testPy3kAsciiFormatSpecifier() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user