-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
A settings to allow mapping file types to known languages in Zed #5178
Comments
I'm not sure if this qualifies as the same issue; however, I work on a project which for historic reasons is C++ code with |
I'm wondering if the suggested structure should be flipped so that a list could be used. The structure would be saying "apply this language's syntax highlighting to the following languages": {
"files": {
"associations": {
"json": ["*.avsc"],
"toml": ["Cargo.lock"],
}
}
} I'm not sure. This would reduce duplication, but maybe it feels a bit backwards? |
This would be a great stop-gap for Svelte support, as Svelte users could associate their .svelte files with HTML |
A million times, yes. |
since there are already many many requests for language support it would make sense to allow custom languages and also to easily install language defs from others. really you would only need file extensions and lsps |
+1 This seems easier and more practical. Simply list all associated filetypes per language. |
In addition to adding this type of configuration, we should also populate some defaults, such as those suggested in: |
This would be a huge step forward for Zed already. Currently, Zed becomes not useable for most of my projects, just because it lacks some languages (e.g. SCSS). But if I am able to map SCSS to the CSS engine (syntax highlighting, basic formatting/completion) it would be a huge step forward. |
Has anyone started working on this? |
Not that I'm aware of. Feel free to open a PR if it's something you're interested in. :) |
I'm trying to implement this, but I found that the current architecture assumes |
Another solution may be to pass |
) Closes #5178 Release Notes: - Added a `file_types` setting that can be used to associate languages with file names and file extensions. For example, to interpret all `.c` files as C++, and files called `MyLockFile` as TOML, add the following to `settings.json`: ```json { "file_types": { "C++": ["c"], "TOML": ["MyLockFile"] } } ``` As with most zed settings, this can be configured on a per-directory basis by including a local `.zed/settings.json` file in that directory. --------- Co-authored-by: Marshall <marshall@zed.dev>
Check for existing issues
Is your feature request related to a problem?
I want to see Cargo.lock content with highlights syntax’s.
Describe the solution you'd like
Add a setting to settings.json
If applicable, add mockups / screenshots to help present your vision of the feature
settings.json
The text was updated successfully, but these errors were encountered: