rt320 commented on code in PR #294:
URL: https://github.com/apache/daffodil-vscode/pull/294#discussion_r973127992


##########
src/language/providers/utils.ts:
##########
@@ -283,6 +293,31 @@ export function checkSetVariableOpen(
   return false
 }
 
+//returns an empty value or a prefix plus a colon
+export function getXsdNsPrefix(
+  document: vscode.TextDocument,
+  position: vscode.Position
+) {
+  var initialLineNum = position.line
+  var lineNum = 0
+  while (initialLineNum !== 0 && lineNum <= initialLineNum) {
+    const lineText = document
+      .lineAt(lineNum)
+      .text.substr(0, document.lineAt(lineNum).range.end.character)
+    // returns either empty prefix value or a prefix plus a colon
+    if (lineText.includes('schema')) {

Review Comment:
   I can test the code without the if statement, but I believe without this 
test, the code would pass back empty for the first line in the file, which in 
the examples I have seen is the <?xml version="1.0" encoding="UTF-8"?>.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to