dotenv-org / dotenv-vscode Goto Github PK
View Code? Open in Web Editor NEWAdd auto-cloaking, auto-completion, in-code secret peeking, and more to VSCode.
Home Page: https://dotenv.org/vscode
License: MIT License
Add auto-cloaking, auto-completion, in-code secret peeking, and more to VSCode.
Home Page: https://dotenv.org/vscode
License: MIT License
Add dotenv sidebar icon similar to https://github.com/microsoft/vscode-docker
When you create new file, choose language as JavaScript - it ignores it and for some reason set the language to .env. Below are the screenshots with the steps to reproduce.
Select a language
and find JavaScript
JavaScript
to select and find out that instead of JavaScript
the .env
was selectedIt breaks syntax highlighting everywhere. You can switch to JavaScript
if you've already pasted JS code here, but syntax highlighting will be broken. It gets fixed after the "reload window" command. Very weird tho, I hope it will be fixed.
https://github.com/bolorundurowb/dotenv.net#read-environment-variables
var envVars = DotEnv.Read();
Console.WriteLine(envVars["KEY"]);
Matching Regex:
Anything that starts with envVars[
When installed and edited a jupyter notebook will change the python format to .env its only the formating as the language and the cell still run fine. but all the python auto completion and formating gets striped.
Expected to not interfere with formatting or auto complete. like how it is not installed:
Was working and found that on Linux vscode I'm not seeing the link in the .env file to toggle autocloaking that I see when I'm working on .env files on my Mac. I'm able to disable/enable autocloaking fine through command palette but might be good to look into this, or maybe also roll that toggle in to the .env sidebar item if possible
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.
Interested in migrating your code to TypeScript? I want to contribute.
.env
file and click on "Toogle auto-cloaking".The auto-cloaking works and I keep my custom color customizations for other tokens defined in "editor.tokenColorCustomizations"
The auto-cloaking works, but I lose my custom color customizations for other tokens because the extension replaces all the content of "editor.tokenColorCustomizations"
in my User settings.json
.
This extension does what it says, but I don't want to lose my personal settings for other tokens I have defined. Not sure if this is a bug or a new feature.
Unable to create a new vault / project, or login from the extension sidebar because apparently it is using dotenv-vault
version 1.12.0
which does not exist at this point.
Latest published version of dotenv-vault
is 1.11.2
- changelog
might be related #69
[Extension Host] TypeError: Cannot read properties of undefined (reading 'uri')
at /Users/ctf0/.vscode-insiders/extensions/dotenv.dotenv-vscode-0.19.0/lib/autocloaking.js:92:55
at Array.filter (<anonymous>)
at /Users/ctf0/.vscode-insiders/extensions/dotenv.dotenv-vscode-0.19.0/lib/autocloaking.js:90:57
at d.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
at w.deliver (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
at g.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:9579
at d.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
at w.deliver (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
at g.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
at w.acceptDocumentsAndEditorsDelta (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:13717)
at w.$acceptDocumentsAndEditorsDelta (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:96:12158)
at u.O (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:104:11207)
at u.N (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:104:10925)
at u.I (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:104:10018)
at u.H (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:104:8999)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:104:7787
at d.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
at w.deliver (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
at g.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
at fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:72:14313)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:120:15788
at d.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
at w.deliver (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
at g.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
at fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:72:14313)
at MessagePortMain.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:120:13944)
at MessagePortMain.emit (node:events:526:28)
at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:5:364) (at console.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:94:136281))
Version: 1.74.0-insider
Commit: 1b1e2a2c5794df1f475976062c754651827634a9
Date: 2022-11-18T05:24:51.315Z
Electron: 19.1.3
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: Yes
The extension is not avilable for coder/code-server VSCode Web .
Probably it is also not available on other web IDEs like GithHub Codespace or Gitpod.
The extension can still be installed via VSIX file but make it available on those IDEs.
publish to https://open-vsx.org/
Hi there,
Autocomplete seems to only work with .env
files.
Is there a setting somewhere that I can use to get this to work with .env.local
Thanks :-)
macOS Monterey: 12.5.1
VSCode: Version: 1.71.2 (Universal)
Extension: dotenv.dotenv-vscode v0.9.0 Last updated 11/Sep/2022, 07:08:26
Here's the error from the Extension Host log:
[2022-09-19 11:28:15.770] [exthost] [error] Activating extension dotenv.dotenv-vscode failed due to an error:
[2022-09-19 11:28:15.770] [exthost] [error] TypeError: Cannot read properties of undefined (reading 'textMateRules')
at hideValues (/Users/Dave/.vscode/extensions/dotenv.dotenv-vscode-0.9.0/lib/autocloaking.js:24:24)
at Object.run (/Users/Dave/.vscode/extensions/dotenv.dotenv-vscode-0.9.0/lib/autocloaking.js:7:5)
at activate (/Users/Dave/.vscode/extensions/dotenv.dotenv-vscode-0.9.0/extension.js:9:16)
at Function._callActivateOptional (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:17649)
at Function._callActivate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:17307)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:15118
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at E._activate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8224)
at E._waitForDepsThenActivate (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:8166)
at E._initialize (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:7530)
In my config, I didn't appear to have a setting named textMateRules
. (It may not have been mac specific.)
I was able to get it working by adding this block to my User settings.json and reinstalling the extension
"editor.tokenColorCustomizations": {
"textMateRules": []
}
Currently other syntax highlighters like are missing handling of all .env files like .env.me and .env.vault. Fix this.
I miss the ability to disable the Auto-cloaking feature. Not everybody who is working with .env files is streaming or has to worry about visually leaked data.
First: ๐๐๐
This extension is fantastic. Thank you so much ๐
The cloak mode is also a great option. However it's kinda problematic that it shows the values when auto-completing:
I would love if it was doing something in between like development
becomes *...*nt
.
export function hideString(str: string | undefined) {
if (!str) return typeof str
const hideChars = str.length > 8 ? 2 : 1
const re = new RegExp(`.*(?=.{${hideChars}}$)`, 'i')
return str.replace(re, '*...*')
}
Create overview gif like https://github.com/microsoft/vscode-docker
Very nice extension. It would be great if the extension could also cloak the environment variables in .yaml files.
Typing process.env should attempt to autocomplete the key from your .env file.
Autocloaking is great, but when I configure it in my User Settings then toggle it in my editor it always updates the Workplace Settings instead. We check our Workplace Settings into our repo and would prefer not to have this change show up when creating PRs.
Ability to have local .env file values blurred out by default. This way you can give demos and not be so worried about leaking variables.
#removed
Version: 1.74.0-insider
Commit: 1b1e2a2c5794df1f475976062c754651827634a9
Date: 2022-11-18T05:24:51.315Z
Electron: 19.1.3
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: Yes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.