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/08 18:01:10 UTC

[GitHub] [daffodil-vscode] mbeckerle commented on a diff in pull request #286: renamed wholeLine variable to triggerText

mbeckerle commented on code in PR #286:
URL: https://github.com/apache/daffodil-vscode/pull/286#discussion_r966267156


##########
src/language/providers/attributeCompletion.ts:
##########
@@ -75,19 +75,19 @@ export function getAttributeCompletionProvider() {
         document: vscode.TextDocument,
         position: vscode.Position
       ) {
-        const wholeLine = document
+        const triggerText = document
           .lineAt(position)
           .text.substr(0, position.character)
         var nearestOpenItem = nearestOpen(document, position)
 
         if (
           !checkBraceOpen(document, position) &&
-          !wholeLine.includes('assert') &&
+          !triggerText.includes('assert') &&
           !nearestOpenItem.includes('none')
         ) {
           if (nearestOpenItem.includes('element')) {
             var preVal = ''
-            if (!wholeLine.includes('xs:element')) {
+            if (!triggerText.includes('xs:element')) {

Review Comment:
   None of my schemas have "xs:" on the XSD elements anymore. 
   
   I do them all like:
   ```
   <schema xmlns="...the url for XML schema" ....>
     <element name="foo">
       <complexType>
         <sequence>
         ...
   
   ```
   I also have a binding of xmlns:xs to this same namespace URI, for explicit use in references to QNames like xs:int, But I avoid having to type "xs:" endlessly on almost every line for xs:element, xs:simpleType, xs:complexType, etc. etc.
   
   
   To cope with this I think "nearest open item" logic will have to find an open element name without requiring a namespace prefix, and these things looking for specific keywords like xs:element would have to generalize. 
   
   I am ok with addressing this in a subsequent change set, as I expect it's a pretty significant change. 



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