This is an automated email from the ASF dual-hosted git repository.

shanedell pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git


The following commit(s) were added to refs/heads/main by this push:
     new 861cf2d  Output TDML errors via vscode pop-up
861cf2d is described below

commit 861cf2d0c26c600dece9101ca8e69817148781be
Author: Larry Barber <[email protected]>
AuthorDate: Tue Jan 28 11:06:25 2025 -0500

    Output TDML errors via vscode pop-up
---
 src/tdmlEditor/utilities/tdmlXmlUtils.ts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/tdmlEditor/utilities/tdmlXmlUtils.ts 
b/src/tdmlEditor/utilities/tdmlXmlUtils.ts
index 84ecb1a..42c7a36 100644
--- a/src/tdmlEditor/utilities/tdmlXmlUtils.ts
+++ b/src/tdmlEditor/utilities/tdmlXmlUtils.ts
@@ -19,6 +19,7 @@ import { readFileSync, writeFileSync } from 'fs'
 import os from 'os'
 import { join, resolve, sep, relative, dirname } from 'path'
 import { Element, ElementCompact, js2xml, xml2js } from 'xml-js'
+import * as vscode from 'vscode'
 
 /*
  * Note that the functions in this file assumes the structure of a TDML file
@@ -290,10 +291,16 @@ export async function copyTestCase(
   )
 
   if (sourceTestSuite === undefined) {
+    vscode.window.showErrorMessage(
+      'TDML ERROR: No test suite found in source XML buffer'
+    )
     throw `No test suite found in source XML buffer`
   }
 
   if (sourceTestSuite.length !== 1) {
+    vscode.window.showErrorMessage(
+      'TDML ERROR: More than one test suite found in source XML buffer'
+    )
     throw `More than one test suite found in source XML buffer`
   }
 
@@ -302,10 +309,16 @@ export async function copyTestCase(
   )
 
   if (sourceTestCase === undefined) {
+    vscode.window.showErrorMessage(
+      'TDML ERROR: No test case found in source XML buffer'
+    )
     throw `No test case found in source XML buffer`
   }
 
   if (sourceTestCase.length !== 1) {
+    vscode.window.showErrorMessage(
+      'TDML ERROR: More than one test case found in source XML buffer'
+    )
     throw `More than one test case found in source XML buffer`
   }
 
@@ -379,10 +392,16 @@ export async function copyTestCase(
     )
 
     if (destinationTestSuite === undefined) {
+      vscode.window.showErrorMessage(
+        'TDML ERROR: No test suites found in destination XML buffer'
+      )
       throw `No test suites found in destination XML buffer`
     }
 
     if (destinationTestSuite.length !== 1) {
+      vscode.window.showErrorMessage(
+        'TDML ERROR: More than one test suite found in destination XML buffer'
+      )
       throw `More than one test suite found in destination XML buffer`
     }
 
@@ -398,6 +417,9 @@ export async function copyTestCase(
         testCase.attributes[testCaseNameAttribute] ===
           sourceTestCase[0].attributes[testCaseNameAttribute]
       ) {
+        vscode.window.showErrorMessage(
+          'TDML ERROR: Duplicate Test Case Name Found'
+        )
         throw `Duplicate Test Case Name Found`
       }
     })

Reply via email to