redhat-developer / vscode-xml

Editing XML in Visual Studio Code made easy
Eclipse Public License 2.0
259 stars 80 forks source link

feature request: support for .odd documents #887

Open BalduinLandolt opened 1 year ago

BalduinLandolt commented 1 year ago

I'm super happy that .rng support has been added to this extension! This has been an immense improvement for working with TEI XML files.

Another thing that would be really nice for the TEI ecosystem would be if you could add support for .odd files:
.odd is a file extension commonly used in the context of TEI, see e.g. here.
ODD documents are simply XML (TEI XML to be precise), see an example here.

The only issue issue is that when opening a .odd file, VSCode doesn't know that it's XML and the XML extension doesn't get kicked off.
I'm assuming this wouldn't require anything more than adding .odd to the list of files that should be handled by the extension. So hopefully not much work to implement - but it would provide quite a lot of value to the people working with ODD files.

fbricon commented 1 year ago

I tried https://github.com/TEIC/TEI-Simple/blob/master/odd/teisimple.odd and it was properly opened as an XML file, given its 1st line contains the <?xml version="1.0" encoding="utf-8"?> directive.

fbricon commented 1 year ago

Default file associations are defined in VS Code itself: https://github.com/microsoft/vscode/blob/main/extensions/xml/package.json#L78

angelozerr commented 1 year ago

I'm super happy that .rng support has been added to this extension! This has been an immense improvement for working with TEI XML files.

Glad it please you! It is not perfect but I think it should provide most usecases. If you are using id in yourTEI, pleasse see https://github.com/redhat-developer/vscode-xml/blob/main/docs/Features/XMLReferencesFeatures.md#prefix

Another thing that would be really nice for the TEI ecosystem would be if you could add support for .odd files:

In your sample, there is a link to tei-pm.nvdl, should we support too .nvdl as well?

If I understand correctly, you need just to map .odd and perhaps .nvdl with XML language? Is it enough?

If it is enough, as @fbricon said, we need to contribute to vscode himself in https://github.com/microsoft/vscode/blob/699b73f7db9f18e2178e90e54a6f35195e861073/extensions/xml/package.json#L15

to add those extension files. I think you could do that @BalduinLandolt