stevedlawrence commented on code in PR #294:
URL: https://github.com/apache/daffodil-vscode/pull/294#discussion_r974150149
##########
src/language/providers/utils.ts:
##########
@@ -283,16 +272,35 @@ 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
+ // returns either empty prefix value or a prefix plus a colon
+ let text = lineText.match(schemaPrefixRegEx)
+ if (text != null) {
+ return text[1]
+ }
+ ++lineNum
+ }
+ //returns the standard prefix plus a colon in the case of missing schema tag
+ return 'xs:'
+}
+
export function checkBraceOpen(
document: vscode.TextDocument,
position: vscode.Position
) {
var lineNum = position.line
while (lineNum !== 0) {
- const wholeLine = document
- .lineAt(lineNum)
- .text.substring(0, document.lineAt(lineNum).range.end.character)
+ const wholeLine = document.lineAt(lineNum).text
+ //.text.substring(0, document.lineAt(lineNum).range.end.character)
Review Comment:
Remove comment
--
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]