diff --git a/src/lsp/providers/diagnosticsProvider.ts b/src/lsp/providers/diagnosticsProvider.ts index aa02c0238df9d155f0e7326555cb223035219161..42609a0f4a0506c419604a51314e932673959235 100644 --- a/src/lsp/providers/diagnosticsProvider.ts +++ b/src/lsp/providers/diagnosticsProvider.ts @@ -279,13 +279,9 @@ let base = match.groups.helper === 'theme' ? ['theme'] : [] let keys = match.groups.key.split(/[.\[\]]/).filter(Boolean) let value = dlv(state.config, [...base, ...keys]) - if ( - typeof value === 'string' || - typeof value === 'number' || - value instanceof String || - value instanceof Number || - Array.isArray(value) - ) { + // TODO: check that the type is valid + // e.g. objects are not valid + if (typeof value !== 'undefined') { return null } @@ -308,10 +304,7 @@ severity: severity === 'error' ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning, - message: - typeof value === 'undefined' - ? `'${match.groups.key}' does not exist in your theme config.` - : `'${match.groups.key}' was found but does not resolve to a string.`, + message: `Unknown ${match.groups.helper} key: ${match.groups.key}`, }) }) })