From c1d27147c4fb7541805dffd2029e2c2f0433fb25 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 8 Dec 2022 12:04:36 -0500 Subject: [PATCH] Fix surround tag in empty document - Fill in grammar when invoking surround tag in an empty document - Fix NPE that prevented surround tags from working in empty documents that are linked to a grammar with file association Closes #1395 Signed-off-by: David Thompson --- .../commands/SurroundWithCommand.java | 10 +++++- .../java/org/eclipse/lemminx/XMLAssert.java | 11 ++++-- .../commands/SurroundWithTagsCommandTest.java | 36 +++++++++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/commands/SurroundWithCommand.java b/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/commands/SurroundWithCommand.java index 1a9b7d5f8..cf080a397 100644 --- a/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/commands/SurroundWithCommand.java +++ b/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/commands/SurroundWithCommand.java @@ -35,7 +35,7 @@ /** * XML Command "xml.refactor.surround.with" to support surround: - * + * *