Skip to main content

add_section

Function add_section 

Source
pub fn add_section(
    cst: &CabalCst,
    keyword: &str,
    name: Option<&str>,
    fields: &[(&str, &str)],
    indent: usize,
) -> TextEdit
Expand description

Add a new top-level section to the end of the file.

keyword is the section type (e.g., "library", "executable"). name is the optional section argument (e.g., "my-exe"). fields is a list of (field_name, field_value) pairs. indent is the number of spaces to indent fields within the section.