Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
65,100
void () { doTestYaml(SCHEMA_FOR_REFS, """ bar: <<: &q a: <warning descr="Schema validation: Incompatible types. Required: array. Actual: integer.">5</warning> b: 5"""); }
testInlineRef
65,101
String (final String s) { return "{\"type\": \"object\", \"properties\": {\"prop\": " + s + "}}"; }
schema
65,102
String () { return """ { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "$ref" : "#/definitions/root", "definitions": { "root" : { "type": "object", "additionalProperties": false, "properties": { "r1": { "type": "string" }, "r2": { "type": "string" } } } } } """; }
rootObjectRedefinedSchema
65,103
void () { doTestYaml(""" { "properties": { "x": { "type": "number" } } }""", "x: 2.99792458e8"); }
testExpNumberNotation
65,104
void () { doTestYaml(""" { "properties": { "x": { "type": "number" } } }""", "x:<warning descr=\"Schema validation: Incompatible types.\n Required: number. Actual: null.\"> </warning>"); }
testTreatEmptyValueAsNull_1
65,105
void () { doTestYaml(""" { "properties": { "x": { "type": "null" } } }""", "x: "); }
testTreatEmptyValueAsNull_2
65,106
void () { doTestYaml(""" { "type": "object", "properties": { "versionAsStringArray": { "type": "array", "items": { "type": "string" } } } }""", """ versionAsStringArray: -<warning descr="Schema validation: Incompatible types. Required: string. Actual: null."> </warning> <warning descr="Schema validation: Incompatible t...
testEmptyValueInArray
65,107
void () { doTestYaml(""" { "type": "object", "properties": { "versionAsStringArray": { "type": "array" } }, "required": ["versionAsStringArray"] }""", "<warning descr=\"Schema validation: Missing required property 'versionAsStringArray'\"></warning>"); }
testEmptyFile
65,108
void () { doTestYaml(""" { "type": "object", "properties": { "versionAsStringArray": { "type": "object", "properties": { "xxx": { "type": "number" }, "yyy": { "type": "string" }, "zzz": { "type": "number" } }, "required": ["xxx", "yyy", "zzz"] } }, "required": ["versionAsStringArray"] }""", """ versionAsStringArray: zz...
testEmptyValueBetweenProps
65,109
void () { doTestYaml(""" {"properties": { "myPropertyXxx": { "deprecationMessage": "Baz", "description": "Foo bar" } }}""", "<weak_warning descr=\"Key 'myPropertyXxx' is deprecated: Baz\">myPropertyXxx</weak_warning>: a"); }
testDeprecation
65,110
String () { return "config.yml"; }
getTestFileName
65,111
InspectionProfileEntry () { return new JsonSchemaComplianceInspection(); }
getInspectionProfile
65,112
Predicate<VirtualFile> () { return file -> file.getFileType() instanceof LanguageFileType && ((LanguageFileType)file.getFileType()).getLanguage().isKindOf( YAMLLanguage.INSTANCE); }
getAvailabilityPredicate
65,113
void () { doTest(""" { "properties": { "X": { "x-intellij-language-injection": "XML" } } }""", "X: <a<caret>></a>", true); }
testXml
65,114
void () { doTest(""" { "properties": { "X": { } } }""", "X: <a<caret>></a>", false); }
testNoInjection
65,115
void () { doTest(""" { "type": "object", "additionalProperties": { "type": ["array"], "items": { "type": "string", "x-intellij-language-injection": "XML" } } }""", "x:\n" + " - <a><caret></a>;", true); }
testInArray
65,116
void () { doTest(""" { "additionalProperties": { "type": "string", "x-intellij-language-injection": "XML" } }""", "abc: \"d<caret>ef\"", true); }
testRegex
65,117
String () { return PathManagerEx.getCommunityHomePath() + "/plugins/yaml/testSrc/org/jetbrains/yaml/schema/data/completion"; }
getTestDataPath
65,118
String () { return ""; // unused }
getBasePath
65,119
String () { return "yml"; }
getExtensionWithoutDot
65,120
void () { // do nothing }
testRequiredPropsFirst
65,121
void () { // do nothing }
testRequiredPropsLast
65,122
void () { // do nothing }
testWhitespaceAfterColon
65,123
void (String... strings) { assertNotNull(myItems); List<String> actual = ContainerUtil.map(myItems, element -> element.getLookupString()); assertContainsOrdered(actual, strings); }
assertContains
65,124
String () { return "config.yml"; }
getTestFileName
65,125
InspectionProfileEntry () { return new YamlJsonSchemaHighlightingInspection(); }
getInspectionProfile
65,126
Predicate<VirtualFile> () { return file -> file.getFileType() instanceof LanguageFileType && ((LanguageFileType)file.getFileType()).getLanguage().isKindOf( YAMLLanguage.INSTANCE); }
getAvailabilityPredicate
65,127
void () { doTest(""" { "properties": { "a": { "default": "q" } }, "required": ["a", "b"] }""", "<warning>c: 5</warning>", "Add missing properties 'a', 'b'", """ a: q b: c: 5"""); }
testAddMissingProperty
65,128
void () { doTest(""" { "properties": { "a": {}, "c": {} }, "additionalProperties": false }""", "a: 5\n<warning>b: 6<caret></warning>\nc: 7", "Remove prohibited property 'b'", "a: 5\n" + "c: 7"); }
testRemoveProhibitedProperty
65,129
void () { doTest(""" { "type": "object", "properties": { "versionAsStringArray": { "type": "array" } }, "required": ["versionAsStringArray"] }""", "<warning></warning>", "Add missing property 'versionAsStringArray'", "versionAsStringArray:\n" + " - "); }
testEmptyFile
65,130
void () { doTest(""" { "type": "object", "properties": { "versionAsStringArray": { "type": "object", "properties": { "xxx": { "type": "array" } }, "required": ["xxx"] } }, "required": ["versionAsStringArray"] }""", "versionAsStringArray:\n" + "<warning> <caret></warning>", "Add missing property 'xxx'", """ versionAsStr...
testEmptyObject
65,131
void () { doTest(""" { "type": "object", "properties": { "versionAsStringArray": { "type": "object", "properties": { "xxx": { "type": "number" }, "yyy": { "type": "string" }, "zzz": { "type": "number" } }, "required": ["xxx", "yyy", "zzz"] } }, "required": ["versionAsStringArray"] }""", "versionAsStringArray:\n" + "<wa...
testEmptyObjectMultipleProps
65,132
void () { doTest(SCHEMA_WITH_NESTING, "image: #aaa\n" + "<warning descr=\"Schema validation: Missing required property 'tag'\"> <caret> </warning>", "Add missing property 'tag'", "image: #aaa\n" + " tag: "); }
testAddMissingPropertyAfterComment
65,133
void () { doTest(SCHEMA_WITH_NESTING, "image: \n" + "<warning descr=\"Schema validation: Missing required property 'tag'\"> <caret> </warning>", "Add missing property 'tag'", "image:\n" + " tag: "); }
testAddMissingPropertyAfterWhitespace
65,134
String () { return PlatformTestUtil.getCommunityPath() + "/plugins/yaml/testSrc/org/jetbrains/yaml/schema/data/completion"; }
getTestDataPath
65,135
String () { return PathManagerEx.getCommunityHomePath() + "/plugins/yaml/testSrc/org/jetbrains/yaml/breadcrumbs/data/"; }
getTestDataPath
65,136
void () { doTest(crumb -> "[" + crumb.getText() + "]"); }
testText
65,137
void () { doTest(crumb -> applyActions(crumb, action -> getActionName(action).equals( YAMLBundle.message("YAMLBreadcrumbsInfoProvider.copy.key.to.clipboard")))); }
testCopyPathAction
65,138
void (@NotNull Function<? super Crumb, String> crumbToString) { myFixture.configureByFile("all.yml"); final CaretModel caretModel = myFixture.getEditor().getCaretModel(); final String result = ContainerUtil.map(caretModel.getAllCarets(), Caret::getOffset).stream() .map((offset) -> { caretModel.moveToOffset(offset); ret...
doTest
65,139
String (@NotNull Action action) { try { return applySingleAction(action); } catch (IOException | UnsupportedFlavorException e) { throw new IllegalStateException(e); } }
applyAction
65,140
String (@NotNull Crumb crumb, Predicate<Action> filter) { String applied = crumb.getContextActions().stream().filter(filter).map(this::applyAction) .reduce((left, right) -> left + ", " + right).orElse(""); return "{" + applied + "}"; }
applyActions
65,141
String (@NotNull Action action) { Object actionNameValue = action.getValue("Name"); assert actionNameValue instanceof String; return (String)actionNameValue; }
getActionName
65,142
String () { return PathManagerEx.getCommunityHomePath() + "/plugins/yaml/testSrc/org/jetbrains/yaml/psi/data/"; }
getTestDataPath
65,143
void () { doTest(); }
testPlainScalar1
65,144
void () { doTest(); }
testPlainScalar2
65,145
void () { doTest(); }
testPlainScalar3
65,146
void () { doTest(); }
testPlainScalar3Tag
65,147
void () { doTest(); }
testPlainScalarBigFirstLineIndent1
65,148
void () { doTest(); }
testPlainScalarBigFirstLineIndent2
65,149
void () { doTest(); }
testLiteralStyle1
65,150
void () { doTest(); }
testLiteralStyle2
65,151
void () { doTest(); }
testLiteralStyle3
65,152
void () { doTest(); }
testLiteralStyleCommentInHeader
65,153
void () { doTest(); }
testLiteralStyleStrip
65,154
void () { doTest(); }
testLiteralStyleKeep
65,155
void () { doTest(); }
testFoldedStyle1
65,156
void () { doTest(); }
testFoldedStyle2
65,157
void () { doTest(); }
testFoldedStyle3
65,158
void () { doTest(); }
testFoldedStyle4
65,159
void () { doTest(); }
testFoldedStyle4Tag
65,160
void () { doTest(); }
testFoldedStyleCommentInHeader
65,161
void () { doTest(); }
testFoldedStyleStrip
65,162
void () { doTest(); }
testFoldedStyleKeep
65,163
void () { doTest(); }
testSingleQuote1
65,164
void () { doTest(); }
testSingleQuote1Tag
65,165
void () { doTest(); }
testSingleQuote2
65,166
void () { doTest(); }
testDoubleQuote1
65,167
void () { doTest(); }
testDoubleQuote2
65,168
void () { doTest(); }
testDoubleQuote3
65,169
void () { doTest(); }
testDoubleQuoteTag
65,170
void () { myFixture.configureByFile(getTestName(true) + ".yml"); final int offset = myFixture.getCaretOffset(); final PsiElement elementAtCaret = myFixture.getFile().findElementAt(offset); final YAMLScalar scalarElement = PsiTreeUtil.getNonStrictParentOfType(elementAtCaret, YAMLScalar.class); assertNotNull(scalarElemen...
doTest
65,171
String () { return PathManagerEx.getCommunityHomePath() + "/plugins/yaml/testSrc/org/jetbrains/yaml/psi/data/"; }
getTestDataPath
65,172
void () { doTest(); }
testPlainScalar1
65,173
void () { doTest(); }
testPlainScalar2
65,174
void () { doTest(); }
testPlainScalar3
65,175
void () { doTest(); }
testPlainScalar3Tag
65,176
void () { doTest(); }
testPlainScalarBigFirstLineIndent1
65,177
void () { doTest(); }
testPlainScalarBigFirstLineIndent2
65,178
void () { doTest(); }
testLiteralStyle1
65,179
void () { doTest(); }
testLiteralStyle2
65,180
void () { doTest(); }
testLiteralStyle3
65,181
void () { doTest(); }
testLiteralStyleCommentInHeader
65,182
void () { doTest(); }
testLiteralStyleHeaderError
65,183
void () { doTest(); }
testLiteralStyleExplicitIndent
65,184
void () { doTest(); }
testLiteralStyleStrip
65,185
void () { doTest(); }
testLiteralStyleKeep
65,186
void () { doTest(); }
testLiteralStyleEmpty
65,187
void () { doTest(); }
testFoldedStyle1
65,188
void () { doTest(); }
testFoldedStyle2
65,189
void () { doTest(); }
testFoldedStyle3
65,190
void () { doTest(); }
testFoldedStyle4
65,191
void () { doTest(); }
testFoldedStyle4Tag
65,192
void () { doTest(); }
testFoldedStyle5
65,193
void () { doTest(); }
testFoldedStyle6
65,194
void () { doTest(); }
testFoldedStyleCommentInHeader
65,195
void () { doTest(); }
testFoldedStyleHeaderError
65,196
void () { doTest(); }
testFoldedStyleExplicitIndent
65,197
void () { doTest(); }
testFoldedStyleStrip
65,198
void () { doTest(); }
testFoldedStyleKeep
65,199
void () { doTest(); }
testFoldedStyleEmpty