panoply / vscode-liquid

💧Liquid language support for VS Code
https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid
Other
173 stars 22 forks source link

[4.0] settings_schema.json validations tweaks #161

Closed muchisx closed 12 months ago

muchisx commented 1 year ago

Hi, I have a few proposed tweaks for the validations in this file. I am using the latest vsix file in the next branch.

All of the tests can be found in my Tests Repo for Liquify for easy replicating https://github.com/muchisx/Liquify-Shopify-test-bench

1) Don't throw warning on Missing property "theme_support_email"

Current

image

Reasoning

If you can see, most themes not longer use this, so maybe enforning this with a warning can be not too good for DX, not even Dawn adds it !

https://github.com/Shopify/dawn/blob/95ac432f3477b005bf1e665b38a131bc1dac689d/config/settings_schema.json#L2-L9

2) Add the following input-setting types to the accepted values for settings/type for the first set of settings.

So, seems like the first set of settings in the settings_schema array don't benefit from the updated list of possible setting-types, so there might be an issue here.

header

image

color

image

color_background

image

paragraph

image

... etc, there might be others but it should be the same idea.

You can see here that the second settings item in the settings_schema array doesn't have any problem with the updated types.

image

3) Schema Autocomplete only works in the first item of the settings_schema array

These seem like useful snippets, but only work on the first item of the settings_schema with a settings property for some reason, also they are very limited, don't include all of the possible types.

https://github.com/panoply/vscode-liquid/assets/34131801/a5e07a48-5390-4667-b9c7-5918d2d7bac1

panoply commented 1 year ago

Thanks for this @muchisx

I'll upstream to Liquify Schema which is responsible for this Schema Stores. It seems I've done some work on this but I'll need to go over it again. If you are familiar with JSON Schema Store specifications feel free to PR but I'll likely have this patched tonight.

panoply commented 1 year ago

@muchisx test this in the latest VSIX - We need to do some work on the new structure, but I have published the .old suffixed files within Liquify schema before your overhaul.