JeremyYao commented on code in PR #1319: URL: https://github.com/apache/daffodil-vscode/pull/1319#discussion_r2192917996
########## src/language/providers/attributeCompletion.ts: ########## @@ -67,6 +67,81 @@ function getCompletionItems( return compItems } +/** Removes duplicate attribute suggestions from an element. Also handles cases where the element is prefixed with dfdl: + * + * @param originalAttributeSuggestions The completion item list + * @param position position object provided by VSCode of the cursor + * @param document vscode object + * @param nsPrefix namespace prefix of the element (includes the :) + * @returns + */ +function prunedDuplicateAttributes( + originalAttributeSuggestions: vscode.CompletionItem[] | undefined, + position: vscode.Position, + document: vscode.TextDocument, + nsPrefix: string +): vscode.CompletionItem[] | undefined { + if ( + originalAttributeSuggestions == undefined || + originalAttributeSuggestions.length == 0 + ) { + return originalAttributeSuggestions + } + + // Setting up stuff to create a full string representation of the XML element + const fullDocumentText = document.getText() + let indexLowerBound = document.offsetAt(position) // This gets the character right behind the cursor Review Comment: That's a good point. May cause memory constraints. Will look into this. -- 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-unsubscr...@daffodil.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org