You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2022/09/16 11:06:44 UTC
[GitHub] [daffodil-vscode] rt320 commented on a diff in pull request #294: Resolves Remove Prefixes Issue #120
rt320 commented on code in PR #294:
URL: https://github.com/apache/daffodil-vscode/pull/294#discussion_r972910319
##########
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:
document.lineAt() returns a TextLine. The includes() property isn't available on a TextLine, It is available on a string, which is what is returned by the proprty text.substr().

--
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: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org