Skip to content

Commit

Permalink
Fix incorrect error message on conditionals placed after an object key
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanH-AT committed Mar 14, 2023
1 parent 10678e2 commit 947abb5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/language/KvTokensProviderBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export abstract class KvTokensProviderBase implements vscode.DocumentSemanticTok
this.processKvKey(token, tokenRange, tokensBuilder, kvDoc, currentScope);

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

0 comments on commit 947abb5

Please sign in to comment.