typst-lsp
typst-lsp copied to clipboard
Autogenerate parts of editors/vscode/package.json based on `Config`
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
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.