oscarlevin / pretext-tools

MIT License
7 stars 9 forks source link

Configuration setting for schema (default | experimental) doesn't save changes? #43

Closed jmhammond closed 1 year ago

jmhammond commented 1 year ago

This is related to #42. I found that I want to be using pretext-dev.rng, and I thought that I was using it. I have it configured in the VS Code User Settings:

2023-07-04_16-26-12

But when I run the schema validation, get this output from vscode-xml:

2023-07-04_16-25-57

Notice that it's redownloading only the pretext.rng file, not the version stored in .ptx, nor the ~/.ptx/pretext-dev.rng that I have requested in settings.

It seems that the extension is only using the default setting for the schema: https://github.com/oscarlevin/pretext-tools/blob/f875b453fc29fe52e1d83c70986f4663d9c641d3/package.json#L186

and the actual settings.json file holds only: "pretext-tools.schemaVersion": "Experimental",


When I manually add this to my settings.json file:

    "xml.fileAssociations": [
        {
            "pattern": "**/source/**.ptx",
            "systemId": "/User/john/.ptx/schema/pretext-dev.rng"
        }
    ]

my files validate correctly, using that dev schema.

jmhammond commented 1 year ago

Found it! The revision a03260d0f0861afff86814a000aa3cbd93b0b0d2 removed the call to setSchema();. We just need to add it back to the activate function.

Here's the GitLens view showing the removal during that revision.

2023-07-04_18-14-21