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


##########
src/language/providers/utils.ts:
##########
@@ -283,6 +291,33 @@ export function checkSetVariableOpen(
   return false
 }
 
+export function getNsPrefix(
+  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)

Review Comment:
   but `TextLine` has a `.text` property, the [TextLine 
doc](https://code.visualstudio.com/api/references/vscode-api#TextLine) says:
   
   > text: string
   >
   > The text of this line without the line separator characters.
   
   So calling `document.lineAt(lineNum).text` should get the entire line as a 
string.



-- 
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