From 0c64995ea28febcc7d38e1519da8d93391ce2e7d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 7 Jun 2022 14:10:49 -0700 Subject: Major language server features. (#2264) * Major language server features. * Include slangd in binary release. * Fix compiler issues. * Fix compiler error. * Completion resolve. * Various improvements. * Update diagnostic test expected output. * Bug fix for source locations. * Adjust diagnostic update frequency. * Update github actions to store artifacts. * Fix infinite parser loop. * Fix parser recovery. * Fix parser recovery. * Update test. * Fix test. * Disable IR gen for language server. * Allow commit characters in auto completion. * Fix lookup for invoke exprs. * More parser robustness fixes. * update solution file Co-authored-by: Yong He --- source/compiler-core/slang-json-native.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/compiler-core/slang-json-native.cpp') diff --git a/source/compiler-core/slang-json-native.cpp b/source/compiler-core/slang-json-native.cpp index 6e54457d0..d268fffc2 100644 --- a/source/compiler-core/slang-json-native.cpp +++ b/source/compiler-core/slang-json-native.cpp @@ -136,7 +136,7 @@ SlangResult JSONToNativeConverter::convert(const JSONValue& in, const RttiInfo* Index fieldCount = 0; SLANG_RETURN_ON_FAIL(_structToNative(pairs, structRttiInfo, out, fieldCount)); - if (fieldCount != pairs.getCount()) + if (fieldCount != pairs.getCount() && !structRttiInfo->m_ignoreUnknownFieldsInJson) { // We want to find the fields not found in the type @@ -176,6 +176,8 @@ SlangResult JSONToNativeConverter::convert(const JSONValue& in, const RttiInfo* } case RttiInfo::Kind::List: { + if (in.getKind() == JSONValue::Kind::Null) + return SLANG_OK; if (in.getKind() != JSONValue::Kind::Array) { return SLANG_FAIL; -- cgit v1.2.3