Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch evenBetterToml.schema.associations and auto-reload on change #499

Open
loynoir opened this issue Nov 1, 2023 · 4 comments
Open

Watch evenBetterToml.schema.associations and auto-reload on change #499

loynoir opened this issue Nov 1, 2023 · 4 comments

Comments

@loynoir
Copy link

loynoir commented Nov 1, 2023

actual

        "json.schemas": [
            {
                "fileMatch": [
                    "**/.cargo/config.json"
                ],
                "url": "http://127.0.0.1:8000/schema/cargo-config.schema.json?from=json&ts=v1"
            }
        ],
        "yaml.schemas": {
            "http://127.0.0.1:8000/schema/cargo-config.schema.json?from=yaml&ts=v1": [
                "**/.cargo/config.yaml"
            ]
        },
        "evenBetterToml.schema.associations": {
            "^.*/\\.cargo/config\\.toml$": "http://127.0.0.1:8000/schema/cargo-config.schema.json?from=toml&ts=v1"
        },

Change

  • ts=v1

To

  • ts=v2

See http.server log

127.0.0.1 - - [xxx] "GET /schema/cargo-config.schema.json?ts=v2&from=json HTTP/1.1" 200 -
127.0.0.1 - - [xxx] "GET /schema/cargo-config.schema.json?ts=v2&from=yaml HTTP/1.1" 200 -

vscode builtin json and redhat.vscode-yaml auto reload schema, but tamasfe.even-better-toml does not auto reload schema.

Thus, need to Ctrl+p Reload Window

expected

tamasfe.even-better-toml auto reload schema, like json and redhat.vscode-yaml.

@ia0
Copy link
Collaborator

ia0 commented Nov 3, 2023

This is a duplicate of #375 that has been closed after updating the documentation in #452. I'll keep this open in case someone wants to write a PR. But note that there are others LSP that behave similarly, like rust-analyzer for Rust (needs a reload to change the config because they are provided as initializationParams).

@ia0 ia0 changed the title [BUG] should watch config change Watch config and auto-reload on change Nov 3, 2023
@loynoir
Copy link
Author

loynoir commented Nov 3, 2023

I don't mean to watch all config.

Just watch jsonschema related config, such as evenBetterToml.schema.associations, should be fine.

Like vscode watch json.schemas, and redhat.vscode-yaml watch yaml.schemas.

@loynoir loynoir changed the title Watch config and auto-reload on change Watch evenBetterToml.schema.associations and auto-reload on change Nov 3, 2023
@ia0
Copy link
Collaborator

ia0 commented Nov 3, 2023

I see, I misunderstood. But then this looks even more niche, because those configs should very rarely change. This looks only useful for schema development. Still keeping open in case someone wants to implement it.

@loynoir
Copy link
Author

loynoir commented Nov 4, 2023

This looks only useful for schema development

Yes, partial schema as workaround for rust-lang/cargo#12883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants