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/29 19:01:01 UTC

[GitHub] [daffodil-vscode] stevedlawrence commented on a diff in pull request #310: Complete the default namespace work

stevedlawrence commented on code in PR #310:
URL: https://github.com/apache/daffodil-vscode/pull/310#discussion_r983922359


##########
src/language/providers/intellisense/commonItems.ts:
##########
@@ -16,12 +16,12 @@
  */
 
 // prettier-ignore
-export const commonCompletion = (additionalItems) => {
+export const commonCompletion = (additionalItems, nsPrefix: string) => {
   return {
     items: [
       {
         item: 'type=',
-        snippetString: 'type="${1|xs:string,xs:decimal,xs:float,xs:double,xs:integer,xs:nonNegativeInteger,xs:int,xs:unsignedInt,xs:short,xs:unsignedShort,xs:long,xs:unsignedLong,xs:byte,xs:unsignedByte,xs:hexBinary,xs:boolean' + additionalItems + '|}"$0',
+        snippetString: 'type="${1|' + nsPrefix + 'string,' + nsPrefix + 'decimal,' + nsPrefix + 'float,' + nsPrefix + 'double,' + nsPrefix + 'integer,' + nsPrefix + 'nonNegativeInteger,' + nsPrefix + 'int,' + nsPrefix + 'unsignedInt,' + nsPrefix + 'short,' + nsPrefix + 'unsignedShort,' + nsPrefix + 'long,' + nsPrefix + 'unsignedLong,' + nsPrefix + 'byte,' + nsPrefix + 'unsignedByte,' + nsPrefix + 'hexBinary,' + nsPrefix + 'boolean' + additionalItems + '|}"$0',

Review Comment:
   Same question as above, should we keep the xs prefix for primitive types?



##########
src/language/providers/intellisense/attributeItems.ts:
##########
@@ -160,11 +160,11 @@ export const attributeCompletion = (additionalItems) => {
       },
       {
         item: 'dfdl:simpleType',
-        snippetString: '<xs:annotation>\n\t<xs:appinfo source="http://www.ogf.org/dfdl/">\n\t\trepresentation="${1|binary,|"\n\t</xs:appinfo>\n</xs:annotation>$0',
+        snippetString: '<' + nsPrefix + 'annotation>\n\t<' + nsPrefix + 'appinfo source="http://www.ogf.org/dfdl/">\n\t\trepresentation="${1|binary,|"\n\t</' + nsPrefix + 'appinfo>\n</' + nsPrefix + 'annotation>$0',
       },
       {
-        item: 'xs:restriction',
-        snippetString: '<xs:restriction base="${1|xs:string,xs:decimal,xs:float,xs:double,xs:integer,xs:nonNegativeInteger,xs:int,xs:unsignedInt,xs:short,xs:unsignedShort,xs:long,xs:unsignedLong,xs:byte,xs:unsignedByte,xs:hexBinary,xs:boolean|}"/>$0',
+        item: nsPrefix + 'restriction',
+        snippetString: '<' + nsPrefix + 'restriction base="${1|' + nsPrefix + 'string,' + nsPrefix + 'decimal,' + nsPrefix + 'float,' + nsPrefix + 'double,' + nsPrefix + 'integer,' + nsPrefix + 'nonNegativeInteger,' + nsPrefix + 'int,' + nsPrefix + 'unsignedInt,' + nsPrefix + 'short,' + nsPrefix + 'unsignedShort,' + nsPrefix + 'long,' + nsPrefix + 'unsignedLong,' + nsPrefix + 'byte,' + nsPrefix + 'unsignedByte,' + nsPrefix + 'hexBinary,' + nsPrefix + 'boolean|}"/>$0',

Review Comment:
   Should we keep the `base="foo"` as using the `xs:` prefix? In the schemas where we drop the prefix, we usually only do so for the tags. We still use the xs prefix for primitive types do differentiate them from custom simple types. This does mean that we have two namespace declarations, e.g. `xmlns="..." xmlns:xs=".."`



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