apache / apache/daffodil-vscode

Community Questions: How should intellisense code determine which dfdl attributes to suggest with long form dfdl:elements?

Open
#1,200 2 comments 0 reactions 1 assignee Claimed by @rthomas320 View on GitHub
code completion enhancement
Dominant language
TypeScript
Stars
18
Forks
33
Avg merge
3d 6h
Merged PRs (30d)
7

Description

Looking at appendix G in https://daffodil.apache.org/docs/dfd,
dfdl:element is listed in 2 sections and 4 subsections

36.1 Parsing
- 36.1.1 dfdl:element (simple) and dfdl:simpleType
- 36.1.2 dfdl:element (complex)

36.2 Unparsing
- 36.2.1 dfdl:element (simple) and dfdl:simpleType
- 36.2.2 dfdl:element (complex)

Should all of the dfdl:attributes listed in these sections be presented as suggestions for dfdl:element?
Should the suggestions be narrowed down based on (simple) or (complex)?
If so, how is simple or complex determined?
Based on xs:element, xs:simple, or xs:complexType?
Appendix G separates dfdl:attributes by parsing or unparsing,
from an intellisense perspective is it correct that the parsing and unparsing dfdl attributes would be suggested for the same element?
Or is there some way to determine an element is defined for parsing or unparsing?

I have similar questions for

- 36.1.3 dfdl:sequence and dfdl:group (when reference is to a sequence)
- 36.1.4 dfdl:choice and dfdl:group (when reference is to a choice)
- 36.2.3 dfdl:sequence and dfdl:group (when reference is a sequence)
- 36.2.4 dfdl:choice and dfdl:group (when reference is a choice)

Is the determination of a reference type based on xs:sequence or xs:choice?
Should dfdl:sequence, dfdl:choice, and dfdl:group be suggested for xs:group?

Appendix G deals with parsing and unparsing order, but it seems to imply that certain dfdl:attributes should be suggested only if a "higher" level attribute is present. For instance, dfdl:length should only be suggested if dfdl:lengthKind = explicit. From an intellisense perspective does that mean intellisense suggestions should only include dfdl:length after the dfdl:lengthKind attribute with a value of explicit is added?
This would require parsing each attribute and its value in a tag to determine which attributes to add to the suggestion list.
If this were to be implemented would the dfdl:length and dfdl:lengthKind attributes be added to the existing list of attribute suggestions?
Or would dfdl:length and dfdl:lengthUnits appear as the only suggestions immediately following the insertion of the dfdl:lengthKind attribute with a value of explicit?
How would intellisense determine when to start suggesting the higher level items again?

Should all dfdl:attributes be suggested for the dfdl:format?

I have more questions but answers to these will help with the next phase of dfdl intellisense development.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.