Skip to content

Commit 947abb5

Browse files
committed
Fix incorrect error message on conditionals placed after an object key
1 parent 10678e2 commit 947abb5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/language/KvTokensProviderBase.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export abstract class KvTokensProviderBase implements vscode.DocumentSemanticTok
7272
this.processKvKey(token, tokenRange, tokensBuilder, kvDoc, currentScope);
7373

7474
// Is this key not followed by a value?
75-
if (interestingToken?.token.type !== TokenType.Value) {
75+
const interestingTokenType = interestingToken?.token.type;
76+
if (interestingTokenType !== TokenType.Value && interestingTokenType !== TokenType.Conditional) {
7677
this.diagnostics.push(new vscode.Diagnostic(tokenRange, "Expecting value to this key", vscode.DiagnosticSeverity.Error));
7778
}
7879
continue;

0 commit comments

Comments
 (0)