Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Associate dotenv language with .env files #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ const autocloaking = require('./lib/autocloaking')
const autocompletion = require('./lib/autocompletion')
const commands = require('./lib/commands')
const peeking = require('./lib/peeking')
const fileAssociations = require('./lib/fileAssociations')

async function activate (context) {
console.log('Dotenv is active')

console.log('Set file associations')
fileAssociations.run()

console.log('Load autocompletion')
await autocompletion.run(context)

Expand Down
9 changes: 0 additions & 9 deletions lib/fileAssociations.js

This file was deleted.

14 changes: 0 additions & 14 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ const enableSecretpeekingKey = 'dotenv.enableSecretpeeking'
// other settings from vscode or other extensions
const editorTokenColorCustomizationsKey = 'editor.tokenColorCustomizations'

// actions
async function populateFileAssociations () {
const fileAssociationsKeys = 'files.associations'

const existingFileAssociations = userConfig().get(fileAssociationsKeys) || {}

existingFileAssociations['.env*'] = 'dotenv'

await userConfig().update(fileAssociationsKeys, existingFileAssociations, vscode.ConfigurationTarget.Global)

return true
}

async function autocloakingOff () {
await userConfig().update(enableAutocloakingKey, false, vscode.ConfigurationTarget.Global)
return false
Expand Down Expand Up @@ -125,7 +112,6 @@ module.exports.autocloakingOff = autocloakingOff
module.exports.autocloakingOn = autocloakingOn
module.exports.mask = mask
module.exports.unmask = unmask
module.exports.populateFileAssociations = populateFileAssociations

// settings
module.exports.autocloakingEnabled = autocloakingEnabled
Expand Down
53 changes: 7 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,58 +107,19 @@
"dotenv-vault"
],
"extensions": [
".env",
".env.vault",
".env.me",
".flaskenv",
".env-sample",
".env.sample",
".env.example",
".env.local",
".env.dev",
".env.dev.local",
".env.build",
".env.build.local",
".env.development",
".env.development.local",
".env.test",
".env.test.local",
".env.testing",
".env.qa",
".env.qa.local",
".env.ci",
".env.ci.local",
".env.fart",
".env.uat",
".env.uat.local",
".env.stag",
".env.stag.local",
".env.stage",
".env.stage.local",
".env.staging",
".env.staging.local",
".env.live",
".env.live.local",
".env.production",
".env.production.local",
".env.prod",
".env.prod.local",
".env.previous",
".env.staging.previous",
".env.production.previous",
".env.fat",
".fart",
".vault",
".project",
".me",
".secret",
".env.secret",
".env.secrets",
".env.sync",
".sync",
".sync"
],
"filenamePatterns": [
".env*"
],
"filenames": [
".flaskenv",
".env.deploy",
".env.deployment"
"user-dirs.dirs"
],
"configuration": "./syntaxes/language-configuration.json"
}
Expand Down