-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Add dotenv support #273074
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 dotenv support #273074
Conversation
This adds basic language support for the dotenv language. This includes syntax highlighting and a language configuration file. The dotenv language is applied to files with the `.env` extension, files named `.env`, `.flaskenv`, or `user-dirs.dirs`, and file names starting with `.env.`. The grammar is downloaded from https://github.com/dotenv-org/dotenv-vscode. Closes microsoft#267333
|
I’m not sure if I’m also supposed to update |
|
@remcohaszing I'm seeing a schema validation issue in language-configuration.json:
|
|
I noticed this too. It’s a bug in the JSON schema. This affects all vscode/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.ts Line 550 in c7e7ef5
|
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I have a few comments. Not sure if we want to conflict with shellscript and ini.
alexr00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, one last question: why is this change better than using the existing shellscript grammar to highlight dotenv files?
|
Dotenv is a strict subset. Only variable assignments and comments are allowed. You can also use the TypeScript grammar to highlight JavaScript files, or the TypeScript, JavaScript, or YAML grammar to highlight JSON files. Their results would be fine, as long as the content is valid JSON. Besides syntax highlighting it’s nice to have a builtin defined language ID that extensions can hook into. For example Given your question and the loose ressemblence based on which dotenv files were marked as |
|
@microsoft-github-policy-service rerun |

This adds basic language support for the dotenv language. This includes syntax highlighting and a language configuration file.
The dotenv language is applied to files with the
.envextension, files named.env,.flaskenv, oruser-dirs.dirs, and file names starting with.env..The grammar is downloaded from https://github.com/dotenv-org/dotenv-vscode.
Closes #267333
Closes #267355