Shanedell opened a new issue, #165:
URL: https://github.com/apache/daffodil-vscode/issues/165

   I still don't understand these `wholeLine.includes` checks. The context to 
use for autocompletion doesn't have do with the line of text--it has to do with 
things like what is the name of the current tag that the cursor is inside, what 
are the values of it's attributes, etc. This just feels very fragile and likely 
to give the wrong results.
   
   It seems like instead you want something like
   ```
   if (nearestOpenItem.includes("element)) {
     if (nearesOpenItem.hasAttribute("name") || 
nearestOpenItem.hasAttribute("ref")) {
        ...
     }
   }
   ```
   
   A simple examle where this breaks, it's not uncommon for schemas to use 
"xsd" instead of "xs" (or even no prefix). In those cases looking for 
"xs:element" is going to fail.
   
   I wont' block this merging for this, but hope it's updated in the future to 
improve how it determines the appropriate context for choosing completions.
   
   _Originally posted by @stevedlawrence in 
https://github.com/apache/daffodil-vscode/pull/117#discussion_r889129269_


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