JeremyYao opened a new issue, #1318: URL: https://github.com/apache/daffodil-vscode/issues/1318
### Description In `testDfdlMixedLineFormats.dfdl.xsd`, there seems to be inconsistent attribute suggestions   From the second screenshot, when I accept  it seems to insert a new element  ### Code behavior For the 4 element insertion suggestions, it doesn't seem to hit ``` Typescript export function getAttributeCompletionProvider() { return vscode.languages.registerCompletionItemProvider( { language: 'dfdl' }, { provideCompletionItems( document: vscode.TextDocument, position: vscode.Position ) { const triggerText = document .lineAt(position) .text.substring(0, position.character) const charBeforeTrigger = triggerText.charAt(position.character - 1) const charAfterTrigger = triggerText.charAt(position.character) let xmlItem = new XmlItem() xmlItem = nearestOpen(document, position) let nearestOpenItem = xmlItem.itemName let itemsOnLine = getItemsOnLineCount(triggerText) const nsPrefix = xmlItem.itemNS let additionalItems = getDefinedTypes( document, getSchemaNsPrefix(document) ) if (isInXPath(document, position)) return undefined if ( checkBraceOpen(document, position) || cursorWithinBraces(document, position) || cursorWithinQuotes(document, position) || cursorAfterEquals(document, position) || nearestOpenItem.includes('none') ) { return undefined } let preVal = !triggerText.includes('<' + nsPrefix + nearestOpenItem) && lineCount(document, position, nearestOpenItem) === 1 && itemsOnLine < 2 ? '\t' : '' return checkNearestOpenItem( nearestOpenItem, triggerText, nsPrefix, preVal, additionalItems, charBeforeTrigger, charAfterTrigger ) }, }, ' ', '\n' // triggered whenever a newline is typed ) } ``` in attributeCompletion.ts which handles attribute completion. It appears that there's no code logic to read the entire XML element and that it suggests the attribute suggestions if the line contains an XML opening (note triggerText)   ### Fix Criteria Attributes for suggestions should work uniformly for mult-line XML elements and single-line ones. -- 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.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org