From 497790ac4fd00024a02498dd9e8acec7f32ecedc Mon Sep 17 00:00:00 2001 From: Anton Lobov Date: Tue, 18 Sep 2018 18:12:13 +0200 Subject: [PATCH] WEB-34877 - json schema: port highlighting tests from ReSharper --- .../daemon/DaemonAnalyzerTestCase.java | 11 +- .../JsonSchemaReSharperHighlightingTest.java | 184 ++++++++++++++++ .../resharper/Test012_2.json.gold | 10 + .../highlighting/resharper/Test027.json.gold | 12 ++ .../highlighting/resharper/Test029.json.gold | 12 ++ .../highlighting/resharper/schema001.json | 1 + .../highlighting/resharper/schema002.json | 9 + .../highlighting/resharper/schema003.json | 14 ++ .../highlighting/resharper/schema004.json | 27 +++ .../highlighting/resharper/schema005.json | 11 + .../highlighting/resharper/schema006.json | 204 ++++++++++++++++++ .../highlighting/resharper/schema007.json | 22 ++ .../highlighting/resharper/schema008.json | 19 ++ .../highlighting/resharper/schema009.json | 26 +++ .../highlighting/resharper/schema010.json | 52 +++++ .../highlighting/resharper/schema011.json | 55 +++++ .../highlighting/resharper/schema012.json | 30 +++ .../highlighting/resharper/schema013.json | 11 + .../highlighting/resharper/schema014.json | 17 ++ .../highlighting/resharper/schema015.json | 19 ++ .../highlighting/resharper/schema016.json | 23 ++ .../highlighting/resharper/schema017.json | 11 + .../highlighting/resharper/schema018.json | 25 +++ .../highlighting/resharper/schema019.json | 14 ++ .../highlighting/resharper/schema020.json | 16 ++ .../highlighting/resharper/schema021.json | 18 ++ .../highlighting/resharper/schema022.json | 23 ++ .../highlighting/resharper/schema023.json | 10 + .../highlighting/resharper/schema024.json | 16 ++ .../highlighting/resharper/schema025.json | 16 ++ .../highlighting/resharper/schema026.json | 22 ++ .../highlighting/resharper/schema027.json | 18 ++ .../highlighting/resharper/schema028.json | 204 ++++++++++++++++++ .../highlighting/resharper/schema029.json | 65 ++++++ .../highlighting/resharper/test001.json | 6 + .../highlighting/resharper/test002.json | 4 + .../highlighting/resharper/test003.json | 5 + .../highlighting/resharper/test004.json | 8 + .../highlighting/resharper/test004_2.json | 7 + .../highlighting/resharper/test005.json | 5 + .../highlighting/resharper/test005_2.json | 5 + .../highlighting/resharper/test006.json | 17 ++ .../highlighting/resharper/test007.json | 5 + .../highlighting/resharper/test008.json | 5 + .../highlighting/resharper/test008_2.json | 5 + .../highlighting/resharper/test008_3.json | 5 + .../highlighting/resharper/test009.json | 5 + .../highlighting/resharper/test010.json | 5 + .../highlighting/resharper/test011.json | 5 + .../highlighting/resharper/test012.json | 5 + .../highlighting/resharper/test012_2.json | 5 + .../highlighting/resharper/test012_3.json | 5 + .../highlighting/resharper/test013.json | 5 + .../highlighting/resharper/test014.json | 5 + .../highlighting/resharper/test015.json | 4 + .../highlighting/resharper/test016.json | 4 + .../highlighting/resharper/test016_2.json | 4 + .../highlighting/resharper/test016_3.json | 4 + .../highlighting/resharper/test016_4.json | 4 + .../highlighting/resharper/test016_5.json | 4 + .../highlighting/resharper/test017.json | 4 + .../highlighting/resharper/test017_2.json | 4 + .../highlighting/resharper/test017_3.json | 4 + .../highlighting/resharper/test018.json | 5 + .../highlighting/resharper/test019.json | 5 + .../highlighting/resharper/test019_2.json | 5 + .../highlighting/resharper/test020.json | 7 + .../highlighting/resharper/test020_2.json | 7 + .../highlighting/resharper/test021.json | 8 + .../highlighting/resharper/test022.json | 7 + .../highlighting/resharper/test023.json | 9 + .../highlighting/resharper/test024.json | 9 + .../highlighting/resharper/test025.json | 9 + .../highlighting/resharper/test026.json | 9 + .../highlighting/resharper/test027.json | 8 + .../highlighting/resharper/test028.json | 18 ++ .../highlighting/resharper/test029.json | 8 + .../resharper/webjob-publish-settings.json | 64 ++++++ 78 files changed, 1555 insertions(+), 3 deletions(-) create mode 100644 json/tests/test/com/jetbrains/jsonSchema/JsonSchemaReSharperHighlightingTest.java create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/Test012_2.json.gold create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/Test027.json.gold create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/Test029.json.gold create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema001.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema002.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema003.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema004.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema005.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema006.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema007.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema008.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema009.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema010.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema011.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema012.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema013.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema014.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema015.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema016.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema017.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema018.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema019.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema020.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema021.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema022.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema023.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema024.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema025.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema026.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema027.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema028.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/schema029.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test001.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test002.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test003.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test004.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test004_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test005.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test005_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test006.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test007.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test008.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test008_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test008_3.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test009.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test010.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test011.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test012.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test012_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test012_3.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test013.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test014.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test015.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test016.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test016_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test016_3.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test016_4.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test016_5.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test017.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test017_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test017_3.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test018.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test019.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test019_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test020.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test020_2.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test021.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test022.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test023.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test024.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test025.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test026.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test027.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test028.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/test029.json create mode 100644 json/tests/testData/jsonSchema/highlighting/resharper/webjob-publish-settings.json diff --git a/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java b/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java index 3841702c6ff3..008617e9aa60 100644 --- a/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java +++ b/java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java @@ -36,7 +36,6 @@ import com.intellij.lang.StdLanguages; import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.lang.java.JavaLanguage; -import com.intellij.openapi.application.Result; import com.intellij.openapi.application.ex.PathManagerEx; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.editor.Document; @@ -246,8 +245,7 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase { Collection infos = doHighlighting(); String text = myEditor.getDocument().getText(); - data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text); - data.checkResult(infos, text); + doCheckResult(data, infos, text); return infos; } finally { @@ -255,6 +253,13 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase { } } + protected void doCheckResult(@NotNull ExpectedHighlightingData data, + Collection infos, + String text) { + data.checkLineMarkers(DaemonCodeAnalyzerImpl.getLineMarkers(getDocument(getFile()), getProject()), text); + data.checkResult(infos, text); + } + @Override protected Editor createEditor(@NotNull VirtualFile file) { if (myVirtualFileFilter instanceof FileTreeAccessFilter) { diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaReSharperHighlightingTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaReSharperHighlightingTest.java new file mode 100644 index 000000000000..8c65849c1ba7 --- /dev/null +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaReSharperHighlightingTest.java @@ -0,0 +1,184 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.jetbrains.jsonSchema; + +import com.intellij.codeInsight.daemon.impl.HighlightInfo; +import com.intellij.codeInspection.InspectionProfileEntry; +import com.intellij.json.JsonLanguage; +import com.intellij.openapi.fileTypes.LanguageFileType; +import com.intellij.openapi.util.io.FileUtil; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.testFramework.ExpectedHighlightingData; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.util.containers.Predicate; +import com.jetbrains.jsonSchema.impl.JsonSchemaComplianceInspection; +import org.intellij.lang.annotations.Language; +import org.jetbrains.annotations.NotNull; + +import java.io.File; +import java.util.Collection; + +public class JsonSchemaReSharperHighlightingTest extends JsonSchemaHighlightingTestBase { + @Override + protected String getTestDataPath() { + return PlatformTestUtil.getCommunityPath() + "/json/tests/testData/jsonSchema/highlighting/resharper"; + } + + @Override + protected String getTestFileName() { + return "config.json"; + } + + @Override + protected InspectionProfileEntry getInspectionProfile() { + return new JsonSchemaComplianceInspection(); + } + + @Override + protected Predicate getAvailabilityPredicate() { + return file -> file.getFileType() instanceof LanguageFileType && ((LanguageFileType)file.getFileType()).getLanguage().isKindOf( + JsonLanguage.INSTANCE); + } + + private void doTestFiles(String file, String schema) throws Exception { + @Language("JSON") String schemaText = FileUtil.loadFile(new File(getTestDataPath() + "/" + schema + ".json")); + String inputText = FileUtil.loadFile(new File(getTestDataPath() + "/" + file + ".json")); + doTest(schemaText, inputText); + } + + @Override + protected void doCheckResult(@NotNull ExpectedHighlightingData data, Collection infos, String text) { + data.checkResult(infos, text, getTestDataPath() + "/" + getName() + ".json"); + } + + // generated code below + public void test001() throws Exception { + doTestFiles("test001", "schema001"); + } + public void test002() throws Exception { + doTestFiles("test002", "schema002"); + } + public void test003() throws Exception { + doTestFiles("test003", "schema003"); + } + public void test004() throws Exception { + doTestFiles("test004", "schema004"); + } + public void test004_2() throws Exception { + doTestFiles("test004_2", "schema004"); + } + public void test005() throws Exception { + doTestFiles("test005", "schema005"); + } + public void test005_2() throws Exception { + doTestFiles("test005_2", "schema005"); + } + public void test006() throws Exception { + doTestFiles("test006", "schema006"); + } + public void test007() throws Exception { + doTestFiles("test007", "schema007"); + } + public void test008() throws Exception { + doTestFiles("test008", "schema008"); + } + public void test008_2() throws Exception { + doTestFiles("test008_2", "schema008"); + } + public void test008_3() throws Exception { + doTestFiles("test008_3", "schema008"); + } + public void test009() throws Exception { + doTestFiles("test009", "schema009"); + } + public void test010() throws Exception { + doTestFiles("test010", "schema010"); + } + public void test011() throws Exception { + doTestFiles("test011", "schema011"); + } + public void test012() throws Exception { + doTestFiles("test012", "schema012"); + } + public void _test012_2() throws Exception { // TODO bug + doTestFiles("test012_2", "schema012"); + } + public void test012_3() throws Exception { + doTestFiles("test012_3", "schema012"); + } + public void test013() throws Exception { + doTestFiles("test013", "schema013"); + } + public void test014() throws Exception { + doTestFiles("test014", "schema014"); + } + public void test015() throws Exception { + doTestFiles("test015", "schema015"); + } + public void test016() throws Exception { + doTestFiles("test016", "schema016"); + } + public void test016_2() throws Exception { + doTestFiles("test016_2", "schema016"); + } + public void test016_3() throws Exception { + doTestFiles("test016_3", "schema016"); + } + public void test016_4() throws Exception { + doTestFiles("test016_4", "schema016"); + } + public void test016_5() throws Exception { + doTestFiles("test016_5", "schema016"); + } + public void test017() throws Exception { + doTestFiles("test017", "schema017"); + } + public void test017_2() throws Exception { + doTestFiles("test017_2", "schema017"); + } + public void test017_3() throws Exception { + doTestFiles("test017_3", "schema017"); + } + public void test018() throws Exception { + doTestFiles("test018", "schema018"); + } + public void test019() throws Exception { + doTestFiles("test019", "schema019"); + } + public void test019_2() throws Exception { + doTestFiles("test019_2", "schema019"); + } + public void test020() throws Exception { + doTestFiles("test020", "schema020"); + } + public void test020_2() throws Exception { + doTestFiles("test020_2", "schema020"); + } + public void test021() throws Exception { + doTestFiles("test021", "schema021"); + } + public void test022() throws Exception { + doTestFiles("test022", "schema022"); + } + public void test023() throws Exception { + doTestFiles("test023", "schema023"); + } + public void test024() throws Exception { + doTestFiles("test024", "schema024"); + } + public void test025() throws Exception { + doTestFiles("test025", "schema025"); + } + public void test026() throws Exception { + doTestFiles("test026", "schema026"); + } + public void _test027() throws Exception { // TODO bug + doTestFiles("test027", "schema027"); + } + public void test028() throws Exception { + doTestFiles("test028", "schema028"); + } + public void _test029() throws Exception { // TODO bug + doTestFiles("test029", "schema029"); + } + +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/Test012_2.json.gold b/json/tests/testData/jsonSchema/highlighting/resharper/Test012_2.json.gold new file mode 100644 index 000000000000..5133c8fb3b71 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/Test012_2.json.gold @@ -0,0 +1,10 @@ +{ + + "a": |true|(0) +} + + +--------------------------------------------------------- +(0): ReSharper Underlined Error Highlighting: JSON validation failed: Should satisfy at least one of constraints: + Expression must be of type 'string' + Expression must be of type 'number' diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/Test027.json.gold b/json/tests/testData/jsonSchema/highlighting/resharper/Test027.json.gold new file mode 100644 index 000000000000..5b2aa4ad09d5 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/Test027.json.gold @@ -0,0 +1,12 @@ +{ + "aa": { + "type": "string" + }, + "bb": |5|(0), + "ccbb": |7|(1) +} + + +--------------------------------------------------------- +(0): ReSharper Underlined Error Highlighting: JSON validation failed: Expression must be of type 'string' +(1): ReSharper Underlined Error Highlighting: JSON validation failed: Expression must be of type 'string' diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/Test029.json.gold b/json/tests/testData/jsonSchema/highlighting/resharper/Test029.json.gold new file mode 100644 index 000000000000..c813fb1864e8 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/Test029.json.gold @@ -0,0 +1,12 @@ +{ + "webJobName": "ProcessQueryJob", + "startTime": |null|(0), + "endTime": |null|(1), + "jobRecurrenceFrequency": "Day", + "runMode": "Continuous", + "interval": 5 +} + +--------------------------------------------------------- +(0): ReSharper Underlined Error Highlighting: JSON validation failed: Expression must be of type 'string' +(1): ReSharper Underlined Error Highlighting: JSON validation failed: Expression must be of type 'string' diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema001.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema001.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema001.json @@ -0,0 +1 @@ +{} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema002.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema002.json new file mode 100644 index 000000000000..033fbb84402e --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema002.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "string" + } + }, + "additionalProperties": false +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema003.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema003.json new file mode 100644 index 000000000000..13058074d66c --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema003.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "string" + } + }, + "dependencies" : { + "a": ["b", "c", "d"] + } + "additionalProperties": { + "type": "string" + } +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema004.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema004.json new file mode 100644 index 000000000000..b62e92c06c60 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema004.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "string" + } + }, + "dependencies" : { + "a": { + "properties": { + "b": { + "type": "string" + }, + "c": { + "type": "number" + } + }, + "required": ["c"] + } + }, + "patternProperties": { + "x25": { + "type": "string" + } + } + "additionalProperties": false +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema005.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema005.json new file mode 100644 index 000000000000..2e69a79e07d1 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema005.json @@ -0,0 +1,11 @@ +{ + "type": "object", + "not": { + "properties": { + "a": { + "type": "string" + } + }, + "required": ["b"] + } +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema006.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema006.json new file mode 100644 index 000000000000..71d1ea6aa0bc --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema006.json @@ -0,0 +1,204 @@ +{ + "title": "JSON schema for the TypeScript compiler's configuration file", + "$schema": "http://json-schema.org/draft-04/schema#", + + "definitions": { + "filesDefinition": { + "properties": { + "files": { + "type": "array", + "description": "If no 'files' property is present in a tsconfig.json, the compiler defaults to including all files the containing directory and subdirectories. When a 'files' property is specified, only those files are included.", + "items": { + "type": "string", + "format": "uri" + } + } + }, + "not": { + "required": [ "exclude" ] + } + }, + "excludeDefinition": { + "properties": { + "exclude": { + "type": "array", + "description": "If no 'files' property is present in a tsconfig.json, but an 'exclude' property is present, the compiler will exclude the files and folders specified in the 'exclude' property.", + "items": { + "type": "string", + "format": "uri" + } + } + }, + "not": { + "required": [ "files" ] + } + }, + "compilerOptionsDefinition": { + "properties": { + "compilerOptions": { + "type": "object", + "description": "Instructs the TypeScript compiler how to compile .ts files", + "properties": { + "charset": { + "description": "The character set of the input files.", + "type": "string" + }, + "declaration": { + "description": "Generates corresponding d.ts files.", + "type": "boolean" + }, + "diagnostics": { + "description": "Show diagnostic information.", + "type": "boolean" + }, + "emitBOM": { + "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.", + "type": "boolean" + }, + "listFiles": { + "description": "Print names of files part of the compilation.", + "type": "boolean" + }, + "locale": { + "description": "The locale to use to show error messages, e.g. en-us.", + "type": "string" + }, + "mapRoot": { + "description": "Specifies the location where debugger should locate map files instead of generated locations", + "type": "string", + "format": "uri" + }, + "module": { + "description": "Specify module code generation: 'CommonJS', 'Amd', 'System', 'UMD', 'es6', or 'es2015'.", + "enum": [ "commonjs", "amd", "umd", "system", "es6", "es2015" ] + }, + "newLine": { + "description": "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).", + "enum": [ "CRLF", "LF" ] + }, + "noEmitHelpers": { + "description": "Do not generate custom helper functions like __extends in compiled output.", + "type": "boolean" + }, + "noEmit": { + "description": "Do not emit output.", + "type": "boolean" + }, + "noEmitOnError": { + "description": "Do not emit outputs if any type checking errors were reported.", + "type": "boolean" + }, + "noImplicitAny": { + "description": "Warn on expressions and declarations with an implied 'any' type.", + "type": "boolean" + }, + "noLib": { + "description": "Do not include the default library file (lib.d.ts).", + "type": "boolean" + }, + "noLibCheck": { + "type": "boolean" + }, + "noResolve": { + "description": " Do not add triple-slash references or module import targets to the list of compiled files.", + "type": "boolean" + }, + "outFile": { + "description": "Concatenate and emit output to single file.", + "type": "string", + "format": "uri" + }, + "outDir": { + "description": "Redirect output structure to the directory.", + "type": "string", + "format": "uri" + }, + "preserveConstEnums": { + "description": "Do not erase const enum declarations in generated code.", + "type": "boolean" + }, + "removeComments": { + "description": "Do not emit comments to output.", + "type": "boolean" + }, + "sourceMap": { + "description": "Generates corresponding '.map' file.", + "type": "boolean" + }, + "sourceRoot": { + "description": "Specifies the location where debugger should locate TypeScript files instead of source locations.", + "type": "string", + "format": "uri" + }, + "suppressImplicitAnyIndexErrors": { + "description": "Suppress noImplicitAny errors for indexing objects lacking index signatures.", + "type": "boolean" + }, + "suppressExcessPropertyErrors": { + "description": "Suppress excess property checks for object literals.", + "type": "boolean" + }, + "target": { + "description": "Specify ECMAScript target version.", + "enum": [ "es3", "es5", "es6", "es2015" ], + "default": "es5" + }, + "watch": { + "description": "Watch input files.", + "type": "boolean" + }, + "inlineSourceMap": { + "description": "Emit a single file with source maps instead of having a separate file.", + "type": "boolean" + }, + "inlineSources": { + "description": "Emit the source alongside the sourcemaps within a single file; requires --inlineSourceMap to be set.", + "type": "boolean" + }, + "emitDecoratorMetadata": { + "description": "Emit design-type metadata for decorated declarations in source.", + "type": "boolean" + }, + "isolatedModules": { + "description": "Unconditionally emit imports for unresolved files.", + "type": "boolean" + }, + "experimentalDecorators": { + "description": "Enables experimental support for ES7 decorators.", + "type": "boolean" + }, + "experimentalAsyncFunctions": { + "description": "Enables experimental support for ES7 async functions.", + "type": "boolean" + }, + "rootDir": { + "description": "Specifies the root directory of input files. Use to control the output directory structure with --outDir.", + "type": "string", + "format": "uri" + }, + "jsx": { + "description": "Specify JSX code generation: 'preserve' or 'react'.", + "enum": [ "preserve", "react" ] + }, + "moduleResolution": { + "description": "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) .", + "enum": [ "classic", "node" ], + "default": "classic" + } + } + } + } + } + }, + + "type": "object", + "allOf": [ + { "$ref": "#/definitions/compilerOptionsDefinition" }, + { + "anyOf": [ + { "$ref": "#/definitions/filesDefinition" }, + { "$ref": "#/definitions/excludeDefinition" } + ] + } + ] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema007.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema007.json new file mode 100644 index 000000000000..3c6547878fcd --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema007.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "properties": { + "a": { + "not": { + "not": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + + } + + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema008.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema008.json new file mode 100644 index 000000000000..f14950cc9978 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema008.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "a": { + "not": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema009.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema009.json new file mode 100644 index 000000000000..773fba348e5d --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema009.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "a": { + "allOf": [ + { + "not": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + { + "type": "boolean" + } + ] + + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema010.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema010.json new file mode 100644 index 000000000000..9a42a86ea06c --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema010.json @@ -0,0 +1,52 @@ +{ + "type": "object", + "properties": { + "a": { + "allOf": [ + { + "not": { + "not": { + "not": { + "not": { + "not": { + "type": "string" + } + } + } + } + } + }, + { + "not": { + "not": { + "not": { + "not": { + "not": { + "type": "number" + } + } + } + } + } + }, + { + "not": { + "not": { + "not": { + "not": { + "not": { + "not": { + "type": "boolean" + } + } + } + } + } + } + } + ] + + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema011.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema011.json new file mode 100644 index 000000000000..f12bfdcc76f2 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema011.json @@ -0,0 +1,55 @@ +{ + "type": "object", + "properties": { + "a": { + "not": { + "anyOf": [ + { + "not": { + "not": { + "not": { + "not": { + "not": { + "not": { + "type": "string" + } + } + } + } + } + } + }, + { + "not": { + "not": { + "not": { + "not": { + "not": { + "not": { + "type": "number" + } + } + } + } + } + } + }, + { + "not": { + "not": { + "not": { + "not": { + "not": { + "type": "boolean" + } + } + } + } + } + } + ] + } + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema012.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema012.json new file mode 100644 index 000000000000..2d57105d9efd --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema012.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "a": { + "allOf": [ + { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + } + ] + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema013.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema013.json new file mode 100644 index 000000000000..038dc7568714 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema013.json @@ -0,0 +1,11 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "array", + "items": { + "type": "string" + } + } + } +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema014.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema014.json new file mode 100644 index 000000000000..c0e390029a22 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema014.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "additionalItems": false + } + } +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema015.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema015.json new file mode 100644 index 000000000000..6bcbea6d8751 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema015.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "additionalItems": { + "type": "boolean" + } + } + } +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema016.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema016.json new file mode 100644 index 000000000000..7d1668b4f73c --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema016.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "array", + "not": { + "items": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "additionalItems": { + "type": "boolean" + }, + "minItems": 7 + } + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema017.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema017.json new file mode 100644 index 000000000000..2a54009ea0fd --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema017.json @@ -0,0 +1,11 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "array", + "not": { + "items": {"type": "string"} + } + } + } +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema018.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema018.json new file mode 100644 index 000000000000..170ba5d88945 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema018.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "array", + "not": { + "not": { + "items": [ + { + "type": "string" + }, + { + "type": "number" + } + ], + "additionalItems": { + "type": "boolean" + }, + "minItems": 7 + } + } + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema019.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema019.json new file mode 100644 index 000000000000..34a474de73e9 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema019.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "not": { + "properties": { + "a": { + "type": "number" + }, + "b": { + "type": "number" + } + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema020.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema020.json new file mode 100644 index 000000000000..973e96c10c10 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema020.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "not": { + "properties": { + "a": { + "type": "number" + } + }, + "patternProperties": { + "x": { + "type": "number" + } + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema021.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema021.json new file mode 100644 index 000000000000..6d3d1963d937 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema021.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "not": { + "not": { + "properties": { + "a": { + "type": "number" + } + }, + "patternProperties": { + "x": { + "type": "number" + } + } + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema022.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema022.json new file mode 100644 index 000000000000..d3a08ac6d360 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema022.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "a": { + "anyOf": [ + { + "type": "number", + "enum": [ 2, 3, 4 ] + }, + { + "type": "number", + "enum": [1, 2, 3] + } + ] + } + }, + "patternProperties": { + "x": { + "type": "number" + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema023.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema023.json new file mode 100644 index 000000000000..2b1cf5e15fc6 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema023.json @@ -0,0 +1,10 @@ +{ + "type": "object", + + "properties": { + "a": { + "$ref": "#" + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema024.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema024.json new file mode 100644 index 000000000000..fb9501ca66e1 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema024.json @@ -0,0 +1,16 @@ +{ + "type": "object", + + "definitions": { + "qq": { + "$ref": "#" + } + }, + + "properties": { + "a": { + "$ref": "#/definitions/qq" + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema025.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema025.json new file mode 100644 index 000000000000..1ba0f7933c87 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema025.json @@ -0,0 +1,16 @@ +{ + "type": "object", + + "definitions": { + "qq": { + "$ref": "#/definitions/qq" + } + }, + + "properties": { + "a": { + "$ref": "#/definitions/qq" + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema026.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema026.json new file mode 100644 index 000000000000..6937deca6ca2 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema026.json @@ -0,0 +1,22 @@ +{ + "type": "object", + + "definitions": { + "qq": { + "$ref": "#/definitions/ee" + }, + "ee": { + "$ref": "#/definitions/ff" + }, + "ff": { + "$ref": "#/definitions/qq" + } + }, + + "properties": { + "a": { + "$ref": "#/definitions/qq" + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema027.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema027.json new file mode 100644 index 000000000000..66caa730f3f3 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema027.json @@ -0,0 +1,18 @@ +{ + "type": "object", + + "properties": { + "a": { + "type": "object" + } + }, + "patternProperties": { + "aa": { + "type": "object" + }, + "bb": { + "$ref": "test027.json#/aa" + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema028.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema028.json new file mode 100644 index 000000000000..71d1ea6aa0bc --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema028.json @@ -0,0 +1,204 @@ +{ + "title": "JSON schema for the TypeScript compiler's configuration file", + "$schema": "http://json-schema.org/draft-04/schema#", + + "definitions": { + "filesDefinition": { + "properties": { + "files": { + "type": "array", + "description": "If no 'files' property is present in a tsconfig.json, the compiler defaults to including all files the containing directory and subdirectories. When a 'files' property is specified, only those files are included.", + "items": { + "type": "string", + "format": "uri" + } + } + }, + "not": { + "required": [ "exclude" ] + } + }, + "excludeDefinition": { + "properties": { + "exclude": { + "type": "array", + "description": "If no 'files' property is present in a tsconfig.json, but an 'exclude' property is present, the compiler will exclude the files and folders specified in the 'exclude' property.", + "items": { + "type": "string", + "format": "uri" + } + } + }, + "not": { + "required": [ "files" ] + } + }, + "compilerOptionsDefinition": { + "properties": { + "compilerOptions": { + "type": "object", + "description": "Instructs the TypeScript compiler how to compile .ts files", + "properties": { + "charset": { + "description": "The character set of the input files.", + "type": "string" + }, + "declaration": { + "description": "Generates corresponding d.ts files.", + "type": "boolean" + }, + "diagnostics": { + "description": "Show diagnostic information.", + "type": "boolean" + }, + "emitBOM": { + "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.", + "type": "boolean" + }, + "listFiles": { + "description": "Print names of files part of the compilation.", + "type": "boolean" + }, + "locale": { + "description": "The locale to use to show error messages, e.g. en-us.", + "type": "string" + }, + "mapRoot": { + "description": "Specifies the location where debugger should locate map files instead of generated locations", + "type": "string", + "format": "uri" + }, + "module": { + "description": "Specify module code generation: 'CommonJS', 'Amd', 'System', 'UMD', 'es6', or 'es2015'.", + "enum": [ "commonjs", "amd", "umd", "system", "es6", "es2015" ] + }, + "newLine": { + "description": "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix).", + "enum": [ "CRLF", "LF" ] + }, + "noEmitHelpers": { + "description": "Do not generate custom helper functions like __extends in compiled output.", + "type": "boolean" + }, + "noEmit": { + "description": "Do not emit output.", + "type": "boolean" + }, + "noEmitOnError": { + "description": "Do not emit outputs if any type checking errors were reported.", + "type": "boolean" + }, + "noImplicitAny": { + "description": "Warn on expressions and declarations with an implied 'any' type.", + "type": "boolean" + }, + "noLib": { + "description": "Do not include the default library file (lib.d.ts).", + "type": "boolean" + }, + "noLibCheck": { + "type": "boolean" + }, + "noResolve": { + "description": " Do not add triple-slash references or module import targets to the list of compiled files.", + "type": "boolean" + }, + "outFile": { + "description": "Concatenate and emit output to single file.", + "type": "string", + "format": "uri" + }, + "outDir": { + "description": "Redirect output structure to the directory.", + "type": "string", + "format": "uri" + }, + "preserveConstEnums": { + "description": "Do not erase const enum declarations in generated code.", + "type": "boolean" + }, + "removeComments": { + "description": "Do not emit comments to output.", + "type": "boolean" + }, + "sourceMap": { + "description": "Generates corresponding '.map' file.", + "type": "boolean" + }, + "sourceRoot": { + "description": "Specifies the location where debugger should locate TypeScript files instead of source locations.", + "type": "string", + "format": "uri" + }, + "suppressImplicitAnyIndexErrors": { + "description": "Suppress noImplicitAny errors for indexing objects lacking index signatures.", + "type": "boolean" + }, + "suppressExcessPropertyErrors": { + "description": "Suppress excess property checks for object literals.", + "type": "boolean" + }, + "target": { + "description": "Specify ECMAScript target version.", + "enum": [ "es3", "es5", "es6", "es2015" ], + "default": "es5" + }, + "watch": { + "description": "Watch input files.", + "type": "boolean" + }, + "inlineSourceMap": { + "description": "Emit a single file with source maps instead of having a separate file.", + "type": "boolean" + }, + "inlineSources": { + "description": "Emit the source alongside the sourcemaps within a single file; requires --inlineSourceMap to be set.", + "type": "boolean" + }, + "emitDecoratorMetadata": { + "description": "Emit design-type metadata for decorated declarations in source.", + "type": "boolean" + }, + "isolatedModules": { + "description": "Unconditionally emit imports for unresolved files.", + "type": "boolean" + }, + "experimentalDecorators": { + "description": "Enables experimental support for ES7 decorators.", + "type": "boolean" + }, + "experimentalAsyncFunctions": { + "description": "Enables experimental support for ES7 async functions.", + "type": "boolean" + }, + "rootDir": { + "description": "Specifies the root directory of input files. Use to control the output directory structure with --outDir.", + "type": "string", + "format": "uri" + }, + "jsx": { + "description": "Specify JSX code generation: 'preserve' or 'react'.", + "enum": [ "preserve", "react" ] + }, + "moduleResolution": { + "description": "Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6) .", + "enum": [ "classic", "node" ], + "default": "classic" + } + } + } + } + } + }, + + "type": "object", + "allOf": [ + { "$ref": "#/definitions/compilerOptionsDefinition" }, + { + "anyOf": [ + { "$ref": "#/definitions/filesDefinition" }, + { "$ref": "#/definitions/excludeDefinition" } + ] + } + ] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/schema029.json b/json/tests/testData/jsonSchema/highlighting/resharper/schema029.json new file mode 100644 index 000000000000..dafeb3077e58 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/schema029.json @@ -0,0 +1,65 @@ +{ + "title": "JSON schema for Azure Webjobs configuration files", + "$schema": "http://json-schema.org/draft-04/schema#", + + "type": "object", + "required": [ "runMode" ], + + "definitions": { + "shared": { + "properties": { + "webJobName": { + "type": "string", + "description": "The name of the Azure Webjob." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "The start time of a scheduled job. Example. 2014-06-11T00:00:00-08:00" + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "The end time of a scheduled job. Example. 2014-06-12T00:00:00-08:00" + }, + "jobRecurrenceFrequency": { + "type": "string", + "enum": [ "Second", "Minute", "Hour", "Day", "Week", "Month" ], + "description": "The frequency metric used with the 'interval' property." + }, + "interval": { + "type": "integer", + "description": "The interval of how often the Azure Webjob should run. Use it with the 'jobRecurrenceFrequency' property." + } + } + }, + "scheduled": { + "required": [ "webJobName", "startTime", "endTime", "jobRecurrenceFrequency", "interval" ], + "allOf": [ { "$ref": "#/definitions/shared" } ], + "properties": { + "runMode": { + "type": "string", + "enum": [ "Scheduled" ], + "description": "Determines the run mode of the Azure Webjob. \n\n Triggered: manually triggered \n Scheduled: runs on a specific schedule \n Continuous: runs all the time" + } + } + }, + "notScheduled": { + "required": [ "runMode" ], + "allOf": [ { "$ref": "#/definitions/shared" } ], + "properties": { + "runMode": { + "type": "string", + "enum": [ "Continuous", "OnDemand" ], + "description": "Determines the run mode of the Azure Webjob. \n\n Triggered: manually triggered \n Scheduled: runs on a specific schedule \n Continuous: runs all the time" + } + } + } + }, + + "oneOf": [ + { "$ref": "#/definitions/scheduled" }, + { "$ref": "#/definitions/notScheduled" } + ] +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test001.json b/json/tests/testData/jsonSchema/highlighting/resharper/test001.json new file mode 100644 index 000000000000..8a6bfe94e072 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test001.json @@ -0,0 +1,6 @@ +{ + "a": 6, + "b": "a", + "q": {"a": [], "b": "qq"}, + "s": [{}] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test002.json b/json/tests/testData/jsonSchema/highlighting/resharper/test002.json new file mode 100644 index 000000000000..538cd719712f --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test002.json @@ -0,0 +1,4 @@ +{ + "a": 6, + "b": "a" +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test003.json b/json/tests/testData/jsonSchema/highlighting/resharper/test003.json new file mode 100644 index 000000000000..bdfebd374abd --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test003.json @@ -0,0 +1,5 @@ +{ + "a": 5, + "b": 7, + "c": 9 +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test004.json b/json/tests/testData/jsonSchema/highlighting/resharper/test004.json new file mode 100644 index 000000000000..243a2f22a1f5 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test004.json @@ -0,0 +1,8 @@ +{ + "a": "a", + "b": 5, + "x25": "q", + "x255": 7, + "0x256": true, + "x025": "fail" +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test004_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test004_2.json new file mode 100644 index 000000000000..c495a717fb78 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test004_2.json @@ -0,0 +1,7 @@ +{ + "b": 5, + "x25": "q", + "x255": 7, + "0x256": true, + "x025": "fail" +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test005.json b/json/tests/testData/jsonSchema/highlighting/resharper/test005.json new file mode 100644 index 000000000000..71960eb4d6d1 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test005.json @@ -0,0 +1,5 @@ +{ + "a": 5, + "b": 6, + "c": 7 +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test005_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test005_2.json new file mode 100644 index 000000000000..b03834f0f879 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test005_2.json @@ -0,0 +1,5 @@ +{ + "a": "5", + "b": 6, + "c": 7 +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test006.json b/json/tests/testData/jsonSchema/highlighting/resharper/test006.json new file mode 100644 index 000000000000..9cc26003c21e --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test006.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "noImplicitAny": false, + "noEmitOnError": true, + "removeComments": true, + "sourceMap": true, + "target": "es5", + "declaration": true, + "module": "amd", + "moduleResolution": "classic" + }, + "exclude": [ + "node_modules", + "wwwroot" + ], + "files": [] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test007.json b/json/tests/testData/jsonSchema/highlighting/resharper/test007.json new file mode 100644 index 000000000000..f3ebbba51a86 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test007.json @@ -0,0 +1,5 @@ +{ + + "a": true +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test008.json b/json/tests/testData/jsonSchema/highlighting/resharper/test008.json new file mode 100644 index 000000000000..dde0516989be --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test008.json @@ -0,0 +1,5 @@ +{ + + "a": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test008_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test008_2.json new file mode 100644 index 000000000000..beecf2d835b2 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test008_2.json @@ -0,0 +1,5 @@ +{ + + "a": "s" +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test008_3.json b/json/tests/testData/jsonSchema/highlighting/resharper/test008_3.json new file mode 100644 index 000000000000..4ed24bc40c43 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test008_3.json @@ -0,0 +1,5 @@ +{ + + "a": true +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test009.json b/json/tests/testData/jsonSchema/highlighting/resharper/test009.json new file mode 100644 index 000000000000..5b37f2391dac --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test009.json @@ -0,0 +1,5 @@ +{ + + "a": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test010.json b/json/tests/testData/jsonSchema/highlighting/resharper/test010.json new file mode 100644 index 000000000000..dde0516989be --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test010.json @@ -0,0 +1,5 @@ +{ + + "a": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test011.json b/json/tests/testData/jsonSchema/highlighting/resharper/test011.json new file mode 100644 index 000000000000..dde0516989be --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test011.json @@ -0,0 +1,5 @@ +{ + + "a": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test012.json b/json/tests/testData/jsonSchema/highlighting/resharper/test012.json new file mode 100644 index 000000000000..83376fac6642 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test012.json @@ -0,0 +1,5 @@ +{ + + "a": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test012_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test012_2.json new file mode 100644 index 000000000000..4ed24bc40c43 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test012_2.json @@ -0,0 +1,5 @@ +{ + + "a": true +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test012_3.json b/json/tests/testData/jsonSchema/highlighting/resharper/test012_3.json new file mode 100644 index 000000000000..232e008c4139 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test012_3.json @@ -0,0 +1,5 @@ +{ + + "a": "a" +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test013.json b/json/tests/testData/jsonSchema/highlighting/resharper/test013.json new file mode 100644 index 000000000000..ceb7200dda7d --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test013.json @@ -0,0 +1,5 @@ +{ + + "a": ["", true, 5] +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test014.json b/json/tests/testData/jsonSchema/highlighting/resharper/test014.json new file mode 100644 index 000000000000..533379939d23 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test014.json @@ -0,0 +1,5 @@ +{ + + "a": ["", 5, 5] +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test015.json b/json/tests/testData/jsonSchema/highlighting/resharper/test015.json new file mode 100644 index 000000000000..a8fc659c665d --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test015.json @@ -0,0 +1,4 @@ +{ + + "a": [5, "a", 5, true, "A"] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test016.json b/json/tests/testData/jsonSchema/highlighting/resharper/test016.json new file mode 100644 index 000000000000..5a46b9def67e --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test016.json @@ -0,0 +1,4 @@ +{ + + "a": ["a", 5, true, false,true, false, true] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test016_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test016_2.json new file mode 100644 index 000000000000..e4f02efa82b1 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test016_2.json @@ -0,0 +1,4 @@ +{ + + "a": ["a", 5, true, false,true, false] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test016_3.json b/json/tests/testData/jsonSchema/highlighting/resharper/test016_3.json new file mode 100644 index 000000000000..e01186b35451 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test016_3.json @@ -0,0 +1,4 @@ +{ + + "a": ["a", 5, true, 5, true, false, true] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test016_4.json b/json/tests/testData/jsonSchema/highlighting/resharper/test016_4.json new file mode 100644 index 000000000000..21d6e26bf1ea --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test016_4.json @@ -0,0 +1,4 @@ +{ + + "a": [5, 5, true, false, true, false, true] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test016_5.json b/json/tests/testData/jsonSchema/highlighting/resharper/test016_5.json new file mode 100644 index 000000000000..678ccc8bc3db --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test016_5.json @@ -0,0 +1,4 @@ +{ + + "a": ["a", "a", true, false, true, false, true] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test017.json b/json/tests/testData/jsonSchema/highlighting/resharper/test017.json new file mode 100644 index 000000000000..1efbad7e0a60 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test017.json @@ -0,0 +1,4 @@ +{ + + "a": ["a"] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test017_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test017_2.json new file mode 100644 index 000000000000..8b8d2e12b1b6 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test017_2.json @@ -0,0 +1,4 @@ +{ + + "a": [] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test017_3.json b/json/tests/testData/jsonSchema/highlighting/resharper/test017_3.json new file mode 100644 index 000000000000..b848b0810ffd --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test017_3.json @@ -0,0 +1,4 @@ +{ + + "a": ["a", 5] +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test018.json b/json/tests/testData/jsonSchema/highlighting/resharper/test018.json new file mode 100644 index 000000000000..0c370f7be3ee --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test018.json @@ -0,0 +1,5 @@ +{ + + "a": [5, 5, true, false, true, 5] +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test019.json b/json/tests/testData/jsonSchema/highlighting/resharper/test019.json new file mode 100644 index 000000000000..2bad7f6c774e --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test019.json @@ -0,0 +1,5 @@ +{ + + "a": 5, + "b": 5 +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test019_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test019_2.json new file mode 100644 index 000000000000..dc8807b86716 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test019_2.json @@ -0,0 +1,5 @@ +{ + + "a": 5, + "b": "a" +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test020.json b/json/tests/testData/jsonSchema/highlighting/resharper/test020.json new file mode 100644 index 000000000000..76d022557e8f --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test020.json @@ -0,0 +1,7 @@ +{ + + "a": 5, + "b": 5, + "c": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test020_2.json b/json/tests/testData/jsonSchema/highlighting/resharper/test020_2.json new file mode 100644 index 000000000000..857dd0c2b7f0 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test020_2.json @@ -0,0 +1,7 @@ +{ + + "a": 5, + "b": 5, + "x": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test021.json b/json/tests/testData/jsonSchema/highlighting/resharper/test021.json new file mode 100644 index 000000000000..f2012fecb7f8 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test021.json @@ -0,0 +1,8 @@ +{ + + "a": "a", + "x": "a", + "c": "a", + "cx": "a" +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test022.json b/json/tests/testData/jsonSchema/highlighting/resharper/test022.json new file mode 100644 index 000000000000..73dcfcc0eeb4 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test022.json @@ -0,0 +1,7 @@ +{ + + "a": 5, + "b": 5, + "c": 5 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test023.json b/json/tests/testData/jsonSchema/highlighting/resharper/test023.json new file mode 100644 index 000000000000..98a2e846a233 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test023.json @@ -0,0 +1,9 @@ +{ + + "a": { + "a": { + "a": 5 + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test024.json b/json/tests/testData/jsonSchema/highlighting/resharper/test024.json new file mode 100644 index 000000000000..98a2e846a233 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test024.json @@ -0,0 +1,9 @@ +{ + + "a": { + "a": { + "a": 5 + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test025.json b/json/tests/testData/jsonSchema/highlighting/resharper/test025.json new file mode 100644 index 000000000000..eb3a2b714e39 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test025.json @@ -0,0 +1,9 @@ +{ + + "a": { + "a": { + "a": 5 + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test026.json b/json/tests/testData/jsonSchema/highlighting/resharper/test026.json new file mode 100644 index 000000000000..eb3a2b714e39 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test026.json @@ -0,0 +1,9 @@ +{ + + "a": { + "a": { + "a": 5 + } + } +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test027.json b/json/tests/testData/jsonSchema/highlighting/resharper/test027.json new file mode 100644 index 000000000000..0850fb5ce40c --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test027.json @@ -0,0 +1,8 @@ +{ + "aa": { + "type": "string" + }, + "bb": 5, + "ccbb": 7 +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test028.json b/json/tests/testData/jsonSchema/highlighting/resharper/test028.json new file mode 100644 index 000000000000..c2208e09f799 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test028.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "noImplicitAny": false, + "noEmitOnError": true, + "removeComments": true, + "sourceMap": true, + "target": "es5", + "declaration": 5, + "module": "amd", + "moduleResolution": "classic" + }, + "exclude": [ + "node_modules", + "wwwroot" + ], + "files": [] +} + diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/test029.json b/json/tests/testData/jsonSchema/highlighting/resharper/test029.json new file mode 100644 index 000000000000..5cb79592eb71 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/test029.json @@ -0,0 +1,8 @@ +{ + "webJobName": "ProcessQueryJob", + "startTime": null, + "endTime": null, + "jobRecurrenceFrequency": "Day", + "runMode": "Continuous", + "interval": 5 +} diff --git a/json/tests/testData/jsonSchema/highlighting/resharper/webjob-publish-settings.json b/json/tests/testData/jsonSchema/highlighting/resharper/webjob-publish-settings.json new file mode 100644 index 000000000000..2fd3f0aca092 --- /dev/null +++ b/json/tests/testData/jsonSchema/highlighting/resharper/webjob-publish-settings.json @@ -0,0 +1,64 @@ +{ + "title": "JSON schema for Azure Webjobs configuration files", + "$schema": "http://json-schema.org/draft-04/schema#", + + "type": "object", + "required": [ "runMode" ], + + "definitions": { + "shared": { + "properties": { + "webJobName": { + "type": "string", + "description": "The name of the Azure Webjob." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "The start time of a scheduled job. Example. 2014-06-11T00:00:00-08:00" + }, + "endTime": { + "type": "string", + "format": "date-time", + "description": "The end time of a scheduled job. Example. 2014-06-12T00:00:00-08:00" + }, + "jobRecurrenceFrequency": { + "type": "string", + "enum": [ "Second", "Minute", "Hour", "Day", "Week", "Month" ], + "description": "The frequency metric used with the 'interval' property." + }, + "interval": { + "type": "integer", + "description": "The interval of how often the Azure Webjob should run. Use it with the 'jobRecurrenceFrequency' property." + } + } + }, + "scheduled": { + "required": [ "webJobName", "startTime", "endTime", "jobRecurrenceFrequency", "interval" ], + "allOf": [ { "$ref": "#/definitions/shared" } ], + "properties": { + "runMode": { + "type": "string", + "enum": [ "Scheduled" ], + "description": "Determines the run mode of the Azure Webjob. \n\n Triggered: manually triggered \n Scheduled: runs on a specific schedule \n Continuous: runs all the time" + } + } + }, + "notScheduled": { + "required": [ "runMode" ], + "allOf": [ { "$ref": "#/definitions/shared" } ], + "properties": { + "runMode": { + "type": "string", + "enum": [ "Continuous", "OnDemand" ], + "description": "Determines the run mode of the Azure Webjob. \n\n Triggered: manually triggered \n Scheduled: runs on a specific schedule \n Continuous: runs all the time" + } + } + } + }, + + "oneOf": [ + { "$ref": "#/definitions/scheduled" }, + { "$ref": "#/definitions/notScheduled" } + ] +}