IDEA-CR-40089: Fixed bug with possible several internal dots

This commit is contained in:
Alexey Merkulov
2018-11-21 17:17:41 +03:00
parent 77dcc64591
commit e6e1135447
4 changed files with 14 additions and 1 deletions
@@ -25,7 +25,7 @@ import java.util.Iterator;
import java.util.List;
public class YAMLCopyPasteProcessor implements CopyPastePreProcessor {
private final static String CONFIG_KEY_SEQUENCE_PATTERN = "([^\\s{}\\[\\]][^\\s]*\\.)+[^\\s{}\\[\\].][^\\s.]*:?\\s*";
private final static String CONFIG_KEY_SEQUENCE_PATTERN = "([^\\s{}\\[\\].][^\\s.]*\\.)+[^\\s{}\\[\\].][^\\s.]*:?\\s*";
@Nullable
@Override
@@ -78,6 +78,11 @@ public class YAMLKeyPasteTest extends LightPlatformCodeInsightFixtureTestCase {
doTest("some. strange. text");
}
// Ambiguity in dot splitting
public void testDoNotPasteKeysWithBadPattern3() {
doTest("some.strange..text");
}
public void testDoNotPasteArrayAsKeys() {
doTest("[x.y]");
}
@@ -0,0 +1,4 @@
top:
next: value1
key:
some.strange..text<caret>
@@ -0,0 +1,4 @@
top:
next: value1
key:
<caret>