From 3ae314e35a9fbfbe5bb028cb7a65fe8fb5b7fdc8 Mon Sep 17 00:00:00 2001 From: Andrey Starovoyt Date: Thu, 6 Oct 2016 20:44:42 +0300 Subject: [PATCH] typescript: improve tsconfig support --- .../impl/JsonBySchemaObjectAnnotator.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaObjectAnnotator.java b/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaObjectAnnotator.java index b889494eb67a..67caf00eebca 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaObjectAnnotator.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaObjectAnnotator.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.jetbrains.jsonSchema.impl; import com.intellij.json.psi.*; @@ -244,7 +259,8 @@ class JsonBySchemaObjectAnnotator implements Annotator { } private boolean checkForEnum(JsonValue value, JsonSchemaObject schema) { - if (schema.getEnum() == null) return true; + //enum values + pattern -> don't check enum values + if (schema.getEnum() == null || schema.getPattern() != null) return true; final String text = value.getText(); final List objects = schema.getEnum(); for (Object object : objects) {