Coder Social home page Coder Social logo

dotenv-org / dotenv-vscode Goto Github PK

View Code? Open in Web Editor NEW
69.0 2.0 10.0 2.74 MB

Add auto-cloaking, auto-completion, in-code secret peeking, and more to VSCode.

Home Page: https://dotenv.org/vscode

License: MIT License

JavaScript 99.02% Ruby 0.04% Python 0.21% PHP 0.22% Go 0.04% Java 0.05% C# 0.12% Rust 0.12% Dart 0.08% Kotlin 0.05% Elixir 0.06%
dotenv dotenv-cli dotenv-vault env environment environment-variables visual-studio visual-studio-code visual-studio-code-extension visual-studio-extension vscode

dotenv-vscode's People

Contributors

connorjennison avatar dragon-fish avatar motdotla avatar socheatsok78 avatar woodywoodsta avatar ykrx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dotenv-vscode's Issues

VSCode create new file: JavaScript language switches to .env

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.

Create new file

CleanShot 2022-11-03 at 00 26 47@2x

Click Select a language and find JavaScript

CleanShot 2022-11-03 at 00 27 04@2x

Click on JavaScript to select and find out that instead of JavaScript the .env was selected

CleanShot 2022-11-03 at 00 27 18@2x

It 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.

Jupyter Notebook python cell format issue

image

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:

image

Linux vscode: Link for toggling auto-cloaking doesn't show

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

Linux vscode image for reference

Auto-cloaking is replacing "editor.tokenColorCustomizations" settings

Steps to Reproduce

  1. Open any .env file and click on "Toogle auto-cloaking".

Expected result

The auto-cloaking works and I keep my custom color customizations for other tokens defined in "editor.tokenColorCustomizations"

Actual result

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.

Additional notes

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.

Issues related

#73

error when opening env files

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

Publish to OpenVSX

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/

Autocomplete only works with.env

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 :-)

Extension failed on macOS

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.)

Workaround

I was able to get it working by adding this block to my User settings.json and reinstalling the extension

"editor.tokenColorCustomizations": {
     "textMateRules": []
 }

Ability to disable Auto-cloaking

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.

add option to cloak/hide auto-suggestions

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:

Screenshot 2022-11-08 at 09 06 10

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, '*...*')
}

Toggling Autocloaking causing workplace settings to change

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.

Add blur mode

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.

Do not treat IP addresses as numbers

Single or double quotes are optional in most cases, such as when using IP addresses. Unfortunately, the extension thinks the IP address is a number when no quotes are surrounded:

Screen Shot 2022-09-04 at 11 30 48 PM

no syntax highlight in insiders

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

Wrong syntax highlighting in .env.* files

Syntax highlighting in the original .env file is OK. But if you append different environment names to it, e.g. .env.production, .env.development, or .env.example - it isn't correct.

CleanShot 2022-11-03 at 16 06 21@2x

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.