Add glob support for custom file type language (#12043)
Release Notes: - Added glob support for file_types configuration ([#10765](https://github.com/zed-industries/zed/issues/10765)). `file_types` can now be written like this: ```json "file_types": { "Dockerfile": [ "Dockerfile", "Dockerfile.*", ] } ```
This commit is contained in:
parent
4e935f9f0f
commit
ab7ce32888
4 changed files with 39 additions and 15 deletions
|
@ -651,18 +651,19 @@ The result is still `)))` and not `))))))`, which is what it would be by default
|
|||
## File Types
|
||||
|
||||
- Setting: `file_types`
|
||||
- Description: Configure how Zed selects a language for a file based on its filename or extension.
|
||||
- Description: Configure how Zed selects a language for a file based on its filename or extension. Supports glob entries.
|
||||
- Default: `{}`
|
||||
|
||||
**Examples**
|
||||
|
||||
To interpret all `.c` files as C++, and files called `MyLockFile` as TOML:
|
||||
To interpret all `.c` files as C++, files called `MyLockFile` as TOML and files starting with `Dockerfile` as Dockerfile:
|
||||
|
||||
```json
|
||||
{
|
||||
"file_types": {
|
||||
"C++": ["c"],
|
||||
"TOML": ["MyLockFile"]
|
||||
"TOML": ["MyLockFile"],
|
||||
"Dockerfile": ["Dockerfile*"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue