From a6ce97d72e8e88fee3df61e8b1fedfae08209092 Mon Sep 17 00:00:00 2001 From: Ricardo Costa Date: Thu, 20 Aug 2026 14:21:22 +0100 Subject: [PATCH] Remove Annotation Cursor Verification Suppression --- client/src/lsp/client.ts | 14 ++------------ client/src/services/annotation.ts | 9 --------- client/src/services/events.ts | 2 -- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/client/src/lsp/client.ts b/client/src/lsp/client.ts index 998d7c2..4721337 100644 --- a/client/src/lsp/client.ts +++ b/client/src/lsp/client.ts @@ -8,7 +8,6 @@ import { onActiveFileChange } from '../services/events'; import type { LJDiagnostic } from "../types/diagnostics"; import { LJContext } from '../types/context'; import { handleContext } from '../services/context'; -import { isCursorInsideLiquidJavaAnnotation } from '../services/annotation'; /** * Starts the client and connects it to the language server @@ -30,13 +29,6 @@ export async function runClient(context: vscode.ExtensionContext, port: number) }; const clientOptions: LanguageClientOptions = { documentSelector: [{ language: "java" }], - middleware: { - didSave: async (document, next) => { - // skip verification if the cursor is inside a LiquidJava annotation - if (isCursorInsideLiquidJavaAnnotation(document)) return; - await next(document); - }, - }, }; extension.client = new LanguageClient("liquidJavaServer", "LiquidJava Server", serverOptions, clientOptions); @@ -70,10 +62,8 @@ export async function runClient(context: vscode.ExtensionContext, port: number) // update status bar on file save context.subscriptions.push( - vscode.workspace.onDidSaveTextDocument(document => { - if (extension.client && !isCursorInsideLiquidJavaAnnotation(document)) { - updateStatusBar("loading"); - } + vscode.workspace.onDidSaveTextDocument(() => { + if (extension.client) updateStatusBar("loading"); }) ); } diff --git a/client/src/services/annotation.ts b/client/src/services/annotation.ts index 0c34e02..fcf540b 100644 --- a/client/src/services/annotation.ts +++ b/client/src/services/annotation.ts @@ -32,12 +32,3 @@ export function getActiveLiquidJavaAnnotation(document: vscode.TextDocument, pos } return parenthesisDepth > 0 ? lastAnnotationName : null; } - -/** - * Checks whether any cursor in the active editor is inside a LiquidJava annotation - */ -export function isCursorInsideLiquidJavaAnnotation(document: vscode.TextDocument): boolean { - const editor = vscode.window.activeTextEditor; - if (!editor || editor.document.uri.toString() !== document.uri.toString()) return false; - return editor.selections.some(selection => Boolean(getActiveLiquidJavaAnnotation(document, selection.active))); -} diff --git a/client/src/services/events.ts b/client/src/services/events.ts index 58a46ba..e13a1e6 100644 --- a/client/src/services/events.ts +++ b/client/src/services/events.ts @@ -4,7 +4,6 @@ import { updateStateMachine } from './state-machine'; import { SELECTION_DEBOUNCE_MS } from '../utils/constants'; import { getSelectionContextVariables, normalizeRange, updateErrorAtCursor } from './context'; import { normalizeFilePath, toRange } from '../utils/utils'; -import { isCursorInsideLiquidJavaAnnotation } from './annotation'; let selectionTimeout: NodeJS.Timeout | null = null; @@ -21,7 +20,6 @@ export function registerEvents(context: vscode.ExtensionContext) { }), vscode.workspace.onDidSaveTextDocument(async document => { if (document.uri.scheme !== 'file' || document.languageId !== "java") return; - if (isCursorInsideLiquidJavaAnnotation(document)) return; await updateStateMachine(document) }), vscode.window.onDidChangeTextEditorSelection(event => {