I can add them. On Fri, Dec 2, 2022 at 1:38 PM Shearer, Davin <shear...@ctc.com> wrote:
> Thanks for these Mike. We need to get all these rough edges accounted for > in the issue tracker so we can get them addressed in the next release cycle. > > Would you mind adding them or would you prefer that I do it? > > -Davin > > On 12/2/22, 1:19 PM, "Mike Beckerle" <mbecke...@apache.org> wrote: > > These items below do not block the release, but were things I observed: > > SITE: > - I did notice a bug on the VSCode Extension 1.2.0 release page which > is > that the link is broken to Intellisense Documentation > < > https://github.com/apache/daffodil-vscode/wiki/Using-DFDL-Intelli-sense>. > It takes you to a wiki for new page creation. > > OMEGA-EDIT > - I enabled experimental features then selected Omega Edit - the VS > Code UI > then froze entirely, never recovered. Had to kill and restart. > Repeatable. > > INTELLISENSE: > - I was unable to figure out how to enable intellisense from the > documentation here: > > https://github.com/apache/daffodil-vscode/wiki/Apache-Daffodil%E2%84%A2-Extension-for-Visual-Studio-Code > The animation showing how to do that goes too quickly, and I cannot > see how > the features it is using are being activated. > > Intellisense does seem to work however, after I set a file association > of > "*.dfdl.xsd" to "dfdl". Actually it may have just worked anyway, as > I'm > not sure this setting was needed. > > I created a new foo.dfdl.xsd schema file with it. > > The completion for a schema chooses elementFormDefault="qualified" > which is > incorrect. (a bug) The preferred style for DFDL schemas (or any XSD) > should > be elementFormDefault="unqualified". > Alas, I wish I had known this when we created the TDML language. It > would > be so much nicer without the "tdml:" prefixes required everywhere. > > The intellisense completion for a schema provides this namespace > prefix: > xmlns:math="www.w3.org/2005/xpath-functions/math" > which contains functions not supported by the DFDL schema language. > So I am not sure why this namespace prefix is provided. Perhaps these > functions can be used in schematron annotations or other annotations > than > DFDL? > > I wanted to insert a dfdl:format annotation. I typed "for" and was > prompted > with dfdl:format. Clicking on that embeds a giant pile of code as if > this > was the start of an empty dfdl schema file. This is not helpful. I was > hoping it would insert this: > > <xs:annotation> > <xs:appinfo source="http://www.ogf.org/dfdl/"> > <dfdl:format /> > </xs:appinfo> > </xs:annotation> > > and leave me positioned after the dfdl:format to add properties or a > ref. > If I type "ann" I am offered xs:annotation, and clicking that inserts > most > of what I wanted. > > <xs:annotation> > <xs:appinfo source="http://www.ogf.org/dfdl/"> > > </xs:appinfo> > </xs:annotation> > > In this context, if I type dfdl:format in the middle and click on the > offered "dfdl:format" choice it still inserts the entirely wrong "whole > file" contents, in the middle of my appinfo, so clearly the context is > not > being taken into account. > > If I type my own <dfdl:format /> element then try to complete > properties > inside it, I get no selection support for possible properties. I am > offered > top-level annotations and XSD elements. > > In fact, I found that the intellisense seems keyed to writing new > schemas > from the start. E.g., if you type this: > > <xs:element name="foo" > > And then ctrl-space will give you DFDL property choices. But if you > type: > > <xs:element name="foo" /> > > Then position the cursor just before the "/>" and ctrl-space, the > offerings > are for top-level annotations, not properties. > > Clearly the intellisense is working sufficiently that a lengthy > discussion > of exactly the contexts and things it should do for a user in those > contexts is warranted now. > I'd actually like to learn how to add context sensitive intellsense > completions to this so that I can try-out ones I think would be > helpful. > > After some time intellisense stopped working. I could easily get it > into a > mode where any Ctrl-Space to see completions just puts up a box saying > "Loading..." which never goes away unless you select some other window > or > hit escape. Other modes it got stuck in were where I selected an option > from the intellisense choices offered, but nothing was inserted, just a > blank line added. I had to restart VSCode in these cases. > > BTW: My preferred style for writing DFDL schemas now is using no "xs:" > prefixes on elements at all. E.g., like this example: > > <?xml version='1.0' encoding='utf-8' ?> > <schema xmlns:xs="http://www.w3.org/2001/xmlSchema" > xmlns="http://www.w3.org/2001/xmlSchema" > xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" > xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext" > xmlns:fn="http:/www.w3.org/2005/xpath-functions" > elementFormDefault="unqualified" > xmlns:foo="urn:foo" > xmlns:tns="urn:foo" > targetNamespace="urn:foo"> > > <include > schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" > /> > > <element name="bar" type="xs:string" byteOrder="bigEndian" /> > > </schema> > > In the above, notice the element declaration for the element named > "bar". > Note the byteOrder property lacks the "dfdl:" prefix, which is > required. > This was inserted by intellisense. I'm not sure what caused this, but > I'm > not able to get back to the behavior where it inserts properties with > the > dfdl: prefix on them any longer. Even if remove the default > xmlns="..." > binding, put all the xs: back on everything, save, restart VSCode, it > still > inserts properties like byteOrder without the required dfdl: prefix. > > That's it for now. > > Mike Beckerle > Apache Daffodil PMC | daffodil.apache.org > OGF DFDL Workgroup Co-Chair | > www.ogf.org/ogf/doku.php/standards/dfdl/dfdl > Owl Cyber Defense | www.owlcyberdefense.com > > > ----------------------------------------------------------------- > This message and any files transmitted within are intended > solely for the addressee or its representative and may contain > company proprietary information. If you are not the intended > recipient, notify the sender immediately and delete this > message. Publication, reproduction, forwarding, or content > disclosure is prohibited without the consent of the original > sender and may be unlawful. > > Concurrent Technologies Corporation and its Affiliates. > www.ctc.com 1-800-282-4392 > ----------------------------------------------------------------- >