You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2021/12/02 17:06:00 UTC

[jira] [Commented] (DAFFODIL-2593) VS Code extension for Auto-Completion of DFDL Schemas

    [ https://issues.apache.org/jira/browse/DAFFODIL-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452515#comment-17452515 ] 

Mike Beckerle commented on DAFFODIL-2593:
-----------------------------------------


I particularly appreciated the feature where one types "disc" and it recognizes you want a discriminator, and automatically puts in the annotation-appinfo boilerplate. 

This does need to be strongly context sensitive, e.g., if you are editing a simpleType, the properties like dfdl:nilvalues should not be provided as options, since those aren't expressible on non-element decls. 

Another thing is if you have a default format in use, then it should somehow not bother you with all the properties which are possible, but are already in the default format. But this is subtle. For example dfdl:lengthKind might have a default format where it is 'implicit', but many things, especially simpleTypes,  will want to override that with a different length kind. Maybe the pop-up menus giving you property choices should make some visual distinction between properties unspecified at all, and properties you may want to override?
Another good example here: initiator/terminator/separator. Those are almost always going to be specified in the default format as "" (empty string). And many things in the schema will want to inherit that default behavior, but some things will want to override them in delimited formats. 

Section 36: Appendix G of the DFDL Specification gives a tree nest of what properties are relevant depending on other properties in the context. This could be used to provide a narrowing of the available properties displayed based on context of what else is already specified on a schema component, or defaulted in the default format for the schema file. 

The available named formats that you can use via dfdl:ref="...qname of format ", should also be available on the completion menus that pop up, so you can choose from those pre-defined ones.  This is tricky, because they will commonly be defined in include/import files, so you don't even know they exist until the include/import are processed. 

Something to consider for the future is recognizing when multiple schema components share the same values for multiple properties. Factoring those out into a shared named format should be a supported action, replacing them by a dfdl:ref to the named format. 



> VS Code extension for Auto-Completion of DFDL Schemas
> -----------------------------------------------------
>
>                 Key: DAFFODIL-2593
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2593
>             Project: Daffodil
>          Issue Type: Brainstorming
>          Components: DFDL Language, DFDL Schemas
>            Reporter: Regis Thomas
>            Assignee: Regis Thomas
>            Priority: Minor
>         Attachments: vscodeDFDLCompletion2.gif
>
>
> I am looking for some feedback on a work in progress on a VS Code Extension for DFDL language auto completion.  The extension is based on a TypeScript sample. Attached is an animated GIF showing a schema written with the auto completion extension.  The extension is still "plain-text" so no key word coloration.  Any feedback/suggestions appreciated.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)