mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-17497
This commit is contained in:
@@ -37,11 +37,9 @@ public class JsonContextType extends FileTypeBasedContextType {
|
||||
@Override
|
||||
public boolean accepts(@NotNull PsiElement element,
|
||||
ProcessingContext context) {
|
||||
return JsonPsiUtil.isPropertyKey(element) &&
|
||||
element.getNextSibling() != null &&
|
||||
element.getNextSibling().getNode().getElementType() == JsonElementTypes.COLON;
|
||||
return JsonPsiUtil.isPropertyKey(element);
|
||||
}
|
||||
})));
|
||||
})).beforeLeaf(psiElement(JsonElementTypes.COLON)));
|
||||
return !illegalPattern.accepts(file.findElementAt(offset));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ public class JsonLiveTemplateTest extends JsonTestCase {
|
||||
assertFalse(isApplicableContextUnderCaret("{fo<caret>o: \"bar\"}"));
|
||||
}
|
||||
|
||||
public void testNotExpandableInsidePropertyKeyWithWhitespace() {
|
||||
assertFalse(isApplicableContextUnderCaret("{fo<caret>o : \"bar\"}"));
|
||||
}
|
||||
|
||||
public void testExpandableAtTopLevel() {
|
||||
assertTrue(isApplicableContextUnderCaret("fo<caret>o"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user