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

Add glob support for custom file type language #12043

Merged

Conversation

farayolaj
Copy link
Contributor

Release Notes:

  • Added glob support for file_types configuration (#10765).

file_types can now be written like this:

"file_types": {
  "Dockerfile": [
    "Dockerfile",
    "Dockerfile.*",
  ]
}

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 20, 2024
Comment on lines 507 to 511
self: &Arc<Self>,
path: &Path,
content: Option<&Rope>,
user_file_types: Option<&HashMap<Arc<str>, Vec<String>>>,
user_file_types: Option<&HashMap<Arc<str>, GlobSet>>,
) -> impl Future<Output = Result<Arc<Language>>> {
Copy link
Contributor Author

@farayolaj farayolaj May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the comment to remove the Option wrapper as seen here, I think it'll affect uses of the function where user_file_types can be empty as seen here. In such cases, an empty hash map will need to be passed. So I have left the Option wrapper there for now.

Copy link
Contributor

@osiewicz osiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first contribution! This looks good to me; once you fix up the formatting (per https://github.com/zed-industries/zed/actions/runs/9151859199/job/25166477766?pr=12043), I think we're gonna be in a good spot to merge this.

@osiewicz osiewicz merged commit ab7ce32 into zed-industries:main May 20, 2024
8 checks passed
@farayolaj farayolaj deleted the use-glob-for-custom-file-type-language branch May 20, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants