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

Highlight patternProperties a different colour #1012

Open
danielearwicker opened this issue Mar 5, 2024 · 0 comments
Open

Highlight patternProperties a different colour #1012

danielearwicker opened this issue Mar 5, 2024 · 0 comments

Comments

@danielearwicker
Copy link

Is your enhancement related to a problem? Please describe.

Some schemas have patternProperties so the author of the YAML file can specify any property names they like at some level. Whereas other properties are hard-wired by the schema.

Logically this is like a distinction between keywords of a programming language (built in) and identifiers for variables/functions invented by the programmer.

In this schema the author has defined a collection they've called UI, under which they've defined properties that they've called Service, SubsiteType, FilterGroup etc...

But the inventions of the author of the file are hard to distinguish visually from the "keywords" of the schema (collections, properties, constant, description...)

image

Describe the solution you would like

Properties that are covered by patternProperties in a schema could be another colour, just as coder-defined variable names are a different colour from language keywords.

Describe alternatives you have considered

My current workaround is to have the schema-defined keywords be lowercase/camelCase, and require the author-defined properties to be PascalCase. (I can't enforce this because it seems like this extension ignores the specific regex pattern supplied to patternProperties).

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

No branches or pull requests

1 participant