From d4617686d58e1dcf3a37b687943a52701015db6b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 14 Nov 2025 11:17:35 +0000 Subject: [PATCH 1/2] Add WARNING block completion template for AsciiDoc Added code completion template for WARNING admonition blocks in the AsciiDoc LSP server. When users type "WA" and press CTRL+Space, they will now see a completion option that inserts: [WARNING] ==== *CURSOR HERE* ==== The cursor will be positioned inside the block for immediate content entry. --- .../lsp/asciidoc/server/AsciidocTextDocumentService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java b/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java index bee1f40..f3d1543 100644 --- a/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java +++ b/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java @@ -1366,6 +1366,14 @@ private List getStandardCompletions() { include.setDetail("Include file"); items.add(include); + // WARNING admonition block + CompletionItem warning = new CompletionItem("[WARNING]"); + warning.setKind(CompletionItemKind.Snippet); + warning.setInsertText("[WARNING]\n====\n${1:}\n===="); + warning.setInsertTextFormat(InsertTextFormat.Snippet); + warning.setDetail("Warning admonition block"); + items.add(warning); + return items; } From abb377ebf6ee3e07f613e6def486da059a72928c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 11:12:02 +0000 Subject: [PATCH 2/2] Fix WARNING completion label to trigger with 'WA' prefix Changed the completion item label from "[WARNING]" to "WARNING" so that typing "WA" will correctly trigger the completion. The insertText still contains the full [WARNING] block syntax, but the label is now properly filtered by the prefix matching logic. --- .../lsp/asciidoc/server/AsciidocTextDocumentService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java b/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java index f3d1543..fbb5839 100644 --- a/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java +++ b/com.vogella.lsp.asciidoc.server/src/com/vogella/lsp/asciidoc/server/AsciidocTextDocumentService.java @@ -1367,7 +1367,7 @@ private List getStandardCompletions() { items.add(include); // WARNING admonition block - CompletionItem warning = new CompletionItem("[WARNING]"); + CompletionItem warning = new CompletionItem("WARNING"); warning.setKind(CompletionItemKind.Snippet); warning.setInsertText("[WARNING]\n====\n${1:}\n===="); warning.setInsertTextFormat(InsertTextFormat.Snippet);