├── .env.example ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── extension.toml ├── languages └── env │ ├── config.toml │ └── highlights.scm ├── public └── screenshot.png └── test.conf /.env.example: -------------------------------------------------------------------------------- 1 | # Database configuration 2 | DB_HOST=localhost 3 | DB_PORT=5432 4 | DB_NAME=mydatabase 5 | DB_USER=myuser 6 | DB_PASSWORD=mypassword 7 | 8 | # Application configuration 9 | APP_ENV=development 10 | APP_DEBUG=true 11 | APP_URL=http://localhost:3000 12 | 13 | # Security settings 14 | JWT_SECRET=mysecretkey 15 | ENCRYPTION_KEY=myencryptionkey 16 | 17 | # API keys 18 | API_KEY_GOOGLE=mygoogleapikey 19 | API_KEY_SENDGRID=mysendgridapikey 20 | 21 | # Email configuration 22 | EMAIL_HOST="smtp.mailtrap.io" 23 | EMAIL_PORT=2525 24 | EMAIL_USER=myemailuser 25 | EMAIL_PASSWORD=myemailpassword 26 | 27 | # Other configuration 28 | CACHE_DRIVER=redis 29 | QUEUE_DRIVER=sqs 30 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: zarifpour 4 | buy_me_a_coffee: zarifpour 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.wasm 3 | tree-sitter-* 4 | target/ 5 | grammars/ 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | 4 | Copyright (c) 2024 Daniel Zarifpour 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🔐 Environment Support for Zed 2 | 3 | Enhance Zed with environment syntax highlighting! 4 | 5 | - Supports `.env` and `.conf` files. 6 | - Tree Sitter: [tree-sitter-dotenv](https://github.com/zarifpour/tree-sitter-dotenv) 7 | 8 | ![screenshot.png](public/screenshot.png) 9 | 10 | ## 🛠️ Development Setup 11 | 12 | ### 1. Clone the repository 13 | 14 | ```shell 15 | git clone https://github.com/zarifpour/zed-env 16 | ``` 17 | 18 | ### 2. Uninstall the existing extension 19 | 20 | If you have the existing extension installed, you need to uninstall it before installing the development version. 21 | 22 | ### 3. Load the extension 23 | 24 | - Open `zed: extensions`. 25 | - Click `Install Dev Extension`. 26 | - Select the `zed-env` directory. 27 | 28 | ### 4. Rebuild the extension as needed 29 | 30 | As you make changes to the extension, you may need to rebuild it. To do so: 31 | 32 | - Open `zed: extensions`. 33 | - Click the `Rebuild` button next to the extension. 34 | 35 | ## 🎸 Contributing 36 | 37 | Contributions are welcome! 38 | 39 | To contribute: 40 | 41 | 1. Fork the repo and create a new branch. 42 | 2. Make changes and test them. 43 | 3. Submit a pull request with a clear description. 44 | 45 | Check open issues for areas needing improvement. Thanks for helping improve Solidity support in Zed! 46 | 47 | 48 | contrib.rocks 49 | 50 | 51 | ## 🏆 Acknowledgments 52 | 53 | - [@EpocSquadron](https://github.com/EpocSquadron) for providing the [tree-sitter-dotenv](https://github.com/EpocSquadron/tree-sitter-dotenv) repository. 54 | 55 | --- 56 | 57 |
58 | 59 | Made with 🖤 by Daniel Zarifpour 60 | 61 | 62 | 63 |
64 | -------------------------------------------------------------------------------- /extension.toml: -------------------------------------------------------------------------------- 1 | id = "env" 2 | name = "env" 3 | version = "0.0.2" 4 | schema_version = 1 5 | authors = ["Daniel Zarifpour "] 6 | description = "🔐 Environment support. ✰ and report issues ➩" 7 | repository = "https://github.com/zarifpour/zed-env" 8 | 9 | [grammars.env] 10 | repository = "https://github.com/zarifpour/tree-sitter-dotenv" 11 | commit = "a854096808a5c1da0de998b31e5887995a98a89f" 12 | -------------------------------------------------------------------------------- /languages/env/config.toml: -------------------------------------------------------------------------------- 1 | name = "env" 2 | grammar = "env" 3 | path_suffixes = ["conf", "env", "envrc", "example", "local", "test"] 4 | autoclose_before = ";:.,=}])>" 5 | line_comments = ["# "] 6 | brackets = [ 7 | { start = "{", end = "}", close = true, newline = true }, 8 | { start = "[", end = "]", close = true, newline = true }, 9 | { start = "(", end = ")", close = true, newline = true }, 10 | ] 11 | -------------------------------------------------------------------------------- /languages/env/highlights.scm: -------------------------------------------------------------------------------- 1 | (comment) @comment 2 | (raw_value) @constant 3 | (variable) @variable 4 | (bool) @boolean 5 | (integer) @number 6 | 7 | (interpolated_variable) @string.escape 8 | 9 | [ 10 | (string_interpolated) 11 | (string_literal) 12 | ] @string 13 | 14 | (url) @link_uri 15 | 16 | [ 17 | "=" 18 | ] @operator 19 | -------------------------------------------------------------------------------- /public/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zarifpour/zed-env/e3157c31fa3cf9511af16aae3e40b712b7eec549/public/screenshot.png -------------------------------------------------------------------------------- /test.conf: -------------------------------------------------------------------------------- 1 | # References: 2 | # - https://www.npmjs.com/package/dotenv 3 | # - https://packagist.org/packages/vlucas/phpdotenv 4 | # - https://github.com/bkeepers/dotenv 5 | # - https://github.com/motdotla/dotenv-expand 6 | 7 | # A comment 8 | 9 | # Empty var 10 | EMPTY= 11 | 12 | # Empty string var 13 | EMPTY="" 14 | 15 | # Unquoted string 16 | USER=someone 17 | 18 | # Unquoted integer 19 | DEBUG=0 20 | 21 | # Unquoted boolean 22 | DEBUG=true 23 | 24 | # Single quoted boolean 25 | DEBUG='true' 26 | 27 | DEBUG="On" 28 | 29 | DEBUG="Yes" 30 | 31 | # Interpolated string with shell commands 32 | DATABASE_URL="postgres://$(whoami)@localhost/my_database" 33 | 34 | # Interpolated string with other env var 35 | DATABASE_URL="postgres://$USER@localhost/my_database" 36 | 37 | # Interpolated string with other env var, with braces 38 | DATABASE_URL="postgres://${USER}@localhost/my_database" 39 | 40 | # Interpolated string with other env var, with default value 41 | DATABASE_URL="postgres://${USER:-default}@localhost/my_database" 42 | 43 | # String literal to avoid interpolation 44 | PASSWORD='pas$word' 45 | 46 | BACKEND_URL=https://localhost:8000 # End of line comment, unquoted 47 | BACKEND_URL="https://localhost:8000" # End of line comment, quoted 48 | 49 | # Multiline sring via interpolated escaped newline 50 | PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nHkVN9...\n-----END DSA PRIVATE KEY-----\n" 51 | 52 | # Multiline string via regular newlines 53 | PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY----- 54 | ... 55 | HkVN9... 56 | ... 57 | -----END DSA PRIVATE KEY-----" 58 | 59 | # Multiline string via regular newlines in literal 60 | PRIVATE_KEY='-----BEGIN RSA PRIVATE KEY----- 61 | ... 62 | HkVN9... 63 | ... 64 | -----END DSA PRIVATE KEY-----' 65 | 66 | # String containing a hash 67 | HASH_CONTAINER="something-with-a-#-in-it" 68 | --------------------------------------------------------------------------------