Skip to content

rust port: use enum for tag in load module #585

@fahdfady

Description

@fahdfady

functions like from_single_file in load module use tag as parameter:

pub fn from_single_file(
    tag: impl ToString,
    script: impl AsRef<Path>,
) -> Result<(), MetaCallLoaderError> {
    from_file(tag, [script])
}

and usage of this in example:

   // Load the file
    load::from_single_file("ts", "sum.ts").unwrap();

the problem is, MetaCall uses a set of tags. so for example if you tried to pass rust it'll fail, because it is expecting rs as a tag parameter.

Solution

Use enum for our provided tags, this will help developers predict the tag names through LSP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions