Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Autogenerate parts of editors/vscode/package.json based on Config #382

Open
astrale-sharp opened this issue Dec 7, 2023 · 1 comment
Open

Comments

@astrale-sharp
Copy link
Collaborator

This would use a trait on each field

pub trait T: Deserialize {
    fn get_description();
    fn get_type();
    fn get_enum();
    fn get_enum_descriptions();
}

we could have a macro to generate an implementation for the trait

impl_T!(typsfmt_lib::Config,"description","type","enum","enum description")

The plan would be to be able to skip "enum" and "type" at least.

One design problem left is : It works well for an enum but typsfmt_lib::Config is a struct with other fields, it should create a "section" with all it's own field inside which might mean we would need a more powerful trait

#381

@nvarner
Copy link
Owner

nvarner commented Dec 26, 2023

I recently realized that I want to generate this file programmatically for other reasons (to support syntax highlighting for other languages in fenced code blocks). I'll take a look at this today, and I'll see if I can work in something like this.

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

No branches or pull requests

2 participants