diff --git a/server/src/modules/validation.ts b/server/src/modules/validation.ts index 0b309e0..4bb76b3 100644 --- a/server/src/modules/validation.ts +++ b/server/src/modules/validation.ts @@ -23,6 +23,11 @@ export const statefulValidation = (text: String, diagnostics: Diagnostic[]) => { // Check for 'mutate' keyword after the endpoint/func declaration for (let bodyLineIndex = lineIndex + 1; bodyLineIndex < lines.length; bodyLineIndex++) { const bodyLine = lines[bodyLineIndex]; + + if(/^(?!\s*$)[^\t ]/.test(bodyLine)){ + break; + } + if (!(/^\s*$/.test(bodyLine))) { // Skip empty lines if (bodyLine.match(mutatePattern)) { hasMutateKeyword = true;