Skip to content

Conversation

@remcohaszing
Copy link
Contributor

@remcohaszing remcohaszing commented Oct 24, 2025

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 #267333
Closes #267355

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
@remcohaszing
Copy link
Contributor Author

I’m not sure if I’m also supposed to update ThirdPartyNotices.txt manually or make any other changes elsewhere.

@alexr00
Copy link
Member

alexr00 commented Oct 24, 2025

@remcohaszing I'm seeing a schema validation issue in language-configuration.json:

image
@remcohaszing
Copy link
Contributor Author

I noticed this too. It’s a bug in the JSON schema. This affects all language-configuration.json files. I tried tweaking this line, but it doesn’t seem to make a difference.

Copy link
Member

@alexr00 alexr00 left a 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.

Copy link
Member

@alexr00 alexr00 left a 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?

@remcohaszing
Copy link
Contributor Author

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 dotenv-vscode provides cloaking capabilities and vscode-icons provides a dedicated dotenv icon.

Given your question and the loose ressemblence based on which dotenv files were marked as properties or shellscript, I am surprised #105371 was rejected.

@joaomoreno
Copy link
Member

@microsoft-github-policy-service rerun

@alexr00 alexr00 requested a review from aeschli October 27, 2025 10:47
@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 27, 2025
@alexr00 alexr00 enabled auto-merge (squash) October 30, 2025 09:31
@alexr00 alexr00 merged commit ec7b5e7 into microsoft:main Oct 30, 2025
17 checks passed
@remcohaszing remcohaszing deleted the dotenv branch October 30, 2025 10:16
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants