gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
164 stars 92 forks source link

Using SDF schema for VSCode SDF validation and intellisense #1326

Open robobe opened 11 months ago

robobe commented 11 months ago

Hi i using VSCode XML redhat extension and schemas from http://sdformat.org/schemas/root.xsd to get SDF validation and code complete

https://github.com/redhat-developer/vscode-xml/blob/main/docs/Validation.md#validation-with-xsd-grammar

<sdf version="1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://sdformat.org/schemas/root.xsd">

It's work very nice but the the schema in http://sdformat.org/schemas/root.xsd are out dated

vscode schema validation

vscode autocomplete

I read the issue #2 and #138. Is it possible to update the schema. Can i contribute to maintain the schema

azeey commented 10 months ago

There's some work https://github.com/gazebosim/sdformat/pull/535 and https://github.com/gazebosim/sdformat/pull/643, but we haven't been able to get them landed. From what I recall, the problem was related to the fact that we have tags, such as <link> that have different definitions depending on what the parent tag is. For example, link has one definition when it's inside <model> (http://sdformat.org/spec?ver=1.10&elem=link) or another when it's inside //state/model (http://sdformat.org/spec?ver=1.10&elem=state#model_link). We just haven't had the time to find a good solution, but if you want to contribute, those two PRs would be a good starting point.