我的.env文件在VSCode中是不可见的,无法搜索它,看不到它

问题描述 投票:0回答:2

在 VSCode 中,我曾经能够在资源管理器视图中看到我的

.env
文件并使用“转到文件”搜索它,我不确定发生了什么,但现在我的 .env 不可见,无法搜索那个,看不到。

我还有其他文件

.env.staging
.env.production
这些都显示只是找到,但由于某种原因.env是不可见的

我目前使用的唯一插件是 Vim,但我禁用了它,问题仍然存在。

visual-studio-code environment-variables
2个回答
5
投票

前往您的

settings.json

enter image description here

找到

"files.exclude"
并注释掉或删除
.env

"files.exclude": {
  "**/.classpath": true,
  "**/.factorypath": true,
  "**/.project": true,
  "**/.settings": true,
  "**/node_modules": true
  // "**/.env": true
},

0
投票

就我而言,这是由于 .env 文件被 Git 忽略,并且在设置中设置了以下复选框:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.