-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Syntax highlighting for .env.* #8466
Comments
I think you'd just have to add it here, right?
But would that fix your problem? From reading through those docs it sounds like you also want to support |
Most likely, all configurations are contained within the Zed binary, as I was unable to locate any separate configuration files. Therefore, I am unable to test this myself.
We can add the most commonly used names as
If a wildcard cannot be applied, we can enumerate a short list of files:
|
Yep, sorry, I meant: you can add this in a PR :) But yeah, we don't seem to support wildcards so far, only suffixes. What we need is a path_prefix. |
Also note that there's #8453 for extension-less files, and it looks like its logic matches what one would want for |
Ahh, interesting. Yeah, |
I've looked into it on how to get this done, as i thought it would be trivial, while it is not hard per-se it requires a change here: language_registry.rs :: language_for_file will need a change, as it uses the
Additionally, it would be an option to enable support for globbing / wildcard matches in Sorry I wasn't more help, but I gave it an honest try. |
Just to mention it, we do have a // An object whose keys are language names, and whose values
// are arrays of filenames or extensions of files that should
// use those languages.
//
// For example, to treat files like `foo.notjs` as JavaScript,
// and 'Embargo.lock' as TOML:
//
// {
// "JavaScript": ["notjs"],
// "TOML": ["Embargo.lock"]
// }
//
"file_types": {}, |
Please whatever the solution, allow syntax highlighting |
you can simply add in your settings : "file_types": {
"Shell Script": [".env.*"]
} At least works for me : ) |
Closing as @lpillonel has provided a straightforward example for how Zed can be configured to support syntax highlighting for these files. Thanks for reporting. |
Since this could be considered a workaround, why not enable it by default? It would be user friendly. |
Sure, why not. |
Check for existing issues
Describe the bug / provide steps to reproduce it
If I edit the .env.local file, Zed does not recognize it as an environment file. Therefore, there is no highlighting, commenting, or other editor features.
I suggest that every env file should be handled properly. Refer to https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used for more information.
Environment
Zed: v0.123.6 (Zed)
OS: macOS 14.1.1
Memory: 32 GiB
Architecture: x86_64
The text was updated successfully, but these errors were encountered: