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


##########
src/language/providers/utils.ts:
##########
@@ -25,31 +25,47 @@ export function insertSnippet(snippetString: string, 
backpos: vscode.Position) {
   )
 }
 
-//Checks if the line at the current position is the last opened tag
+//Checks if the text at the current position is the last opened tag
 export function checkLastItemOpen(
   document: vscode.TextDocument,
   position: vscode.Position
 ) {
   var lineNum = position.line
-  const wholeLine = document
+  const triggerText = document
     .lineAt(lineNum)
     .text.substr(0, document.lineAt(lineNum).range.end.character)
-  while (wholeLine.length === 0) {
+  while (triggerText.length === 0) {
     --lineNum
   }
-  const previousLine = document
-    .lineAt(lineNum)
-    .text.substr(0, document.lineAt(lineNum - 1).range.end.character)
-  if (
-    previousLine.includes('</') ||
-    previousLine.includes('/>') ||
-    ((wholeLine.includes('element') ||
-      wholeLine.includes('sequence') ||
-      wholeLine.includes('group') ||
-      wholeLine.includes('Variable')) &&
-      (wholeLine.includes('</') || wholeLine.includes('/>')))
-  ) {
-    return false
+  if (lineNum > 0) {

Review Comment:
   I think it was part of the fix for incorrect suggestions for multiple tags 
on the same line not returning the correct suggestions.  If the schema tag was 
missing, as in test snippets of code, it prevent trying to get a negative line 
number. I missed removing it when removed the rest of that code. I'll remove it 
for this PR



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