Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

.env file configuring to use properties langauge #77

Closed
ConnorJennison opened this issue Dec 19, 2022 · 5 comments
Closed

.env file configuring to use properties langauge #77

ConnorJennison opened this issue Dec 19, 2022 · 5 comments

Comments

@ConnorJennison
Copy link
Collaborator

For some reason files named exactly .env are auto-configuring to use the properties language instead of dotenv for syntax highlighting. Making this issue to be able to track this.

@PaulMEdwards
Copy link

PaulMEdwards commented Apr 14, 2023

Same here on version 0.23.0.

I also noticed that other .env.* files are not being detected as dotenv nor Properties type. I had to configure VSCode to apply the dotenv language mode to my .env.* files manually.

@jmevel
Copy link

jmevel commented May 25, 2023

If anybody is passing by here and wondering how to configure it in VS Code.
Add this in your settings file

"files.associations": {
  ".env.*": "dotenv"
},

@motdotla
Copy link
Member

motdotla commented May 31, 2023

Thank you @jmevel.

We're investigating whether we can configure that setting as part of our extension so the user would not have to.

We've configured languages.extensions already in package.json but that does not seem to do the trick in all cases.

Seems VScode extensions have many configuration quirks.

@jmevel
Copy link

jmevel commented May 31, 2023

@motdotla thanks for your answer, yes I imagine it could sometimes be tricky to configure such thing in a VS Code extension. At least this issue has a workaround for now.

Thanks a lot for your work !

@motdotla
Copy link
Member

I think 0.27.0 and greater solves this. Working well on my machine. It now sets ".env.*": "dotenv" under files.associations in the user's settings.json

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants