material-icon-theme 4.21.0 → 4.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscodeignore +2 -1
- package/CHANGELOG.md +1267 -1233
- package/README.md +7 -16
- package/icons/actionscript.svg +1 -1
- package/icons/android.svg +1 -1
- package/icons/antlr.svg +1 -0
- package/icons/architecture.svg +1 -5
- package/icons/asciidoc.svg +1 -1
- package/icons/assembly.svg +1 -1
- package/icons/astyle.svg +1 -4
- package/icons/aurelia.svg +1 -1
- package/icons/auto.svg +1 -10
- package/icons/auto_light.svg +1 -10
- package/icons/autohotkey.svg +1 -1
- package/icons/autoit.svg +1 -1
- package/icons/azure-pipelines.svg +1 -1
- package/icons/azure.svg +1 -10
- package/icons/ballerina.svg +1 -1
- package/icons/bazel.svg +1 -1
- package/icons/bitbucket.svg +1 -1
- package/icons/blink.svg +1 -1
- package/icons/blink_light.svg +1 -1
- package/icons/blitz.svg +1 -4
- package/icons/brainfuck.svg +1 -1
- package/icons/buck.svg +1 -1
- package/icons/bucklescript.svg +1 -1
- package/icons/buildkite.svg +1 -9
- package/icons/caddy.svg +1 -9
- package/icons/cadence.svg +1 -10
- package/icons/cloudfoundry.svg +1 -1
- package/icons/coala.svg +1 -1
- package/icons/codecov.svg +1 -1
- package/icons/coldfusion.svg +1 -1
- package/icons/commitlint.svg +1 -1
- package/icons/crystal.svg +1 -1
- package/icons/crystal_light.svg +1 -1
- package/icons/cucumber.svg +1 -1
- package/icons/cuda.svg +1 -1
- package/icons/cypress.svg +1 -4
- package/icons/dart_generated.svg +1 -9
- package/icons/dependabot.svg +1 -4
- package/icons/dinophp.svg +1 -16
- package/icons/docker.svg +1 -1
- package/icons/drawio.svg +1 -1
- package/icons/drone.svg +1 -6
- package/icons/drone_light.svg +1 -6
- package/icons/editorconfig.svg +1 -1
- package/icons/elm.svg +1 -1
- package/icons/figma.svg +1 -10
- package/icons/folder-angular-open.svg +1 -2
- package/icons/folder-angular.svg +1 -2
- package/icons/folder-ansible-open.svg +1 -1
- package/icons/folder-ansible.svg +1 -1
- package/icons/folder-apollo.svg +1 -1
- package/icons/folder-aurelia-open.svg +1 -1
- package/icons/folder-aurelia.svg +1 -1
- package/icons/folder-bower-open.svg +1 -1
- package/icons/folder-bower.svg +1 -1
- package/icons/folder-buildkite-open.svg +1 -9
- package/icons/folder-buildkite.svg +1 -8
- package/icons/folder-cart-open.svg +1 -1
- package/icons/folder-cart.svg +1 -1
- package/icons/folder-ci-open.svg +1 -1
- package/icons/folder-ci.svg +1 -1
- package/icons/folder-cobol-open.svg +1 -1
- package/icons/folder-cobol.svg +1 -1
- package/icons/folder-config-open.svg +1 -1
- package/icons/folder-config.svg +1 -1
- package/icons/folder-container-open.svg +1 -1
- package/icons/folder-container.svg +1 -1
- package/icons/folder-controller-open.svg +1 -1
- package/icons/folder-controller.svg +1 -1
- package/icons/folder-cypress-open.svg +1 -5
- package/icons/folder-cypress.svg +1 -5
- package/icons/folder-decorators-open.svg +2 -0
- package/icons/folder-decorators.svg +5 -0
- package/icons/folder-docker-open.svg +1 -1
- package/icons/folder-docker.svg +1 -1
- package/icons/folder-expo.svg +1 -1
- package/icons/folder-fastlane-open.svg +1 -1
- package/icons/folder-fastlane.svg +1 -1
- package/icons/folder-generator-open.svg +1 -1
- package/icons/folder-generator.svg +1 -1
- package/icons/folder-gitlab-open.svg +1 -2
- package/icons/folder-gitlab.svg +1 -2
- package/icons/folder-gradle-open.svg +1 -1
- package/icons/folder-gradle.svg +1 -1
- package/icons/folder-helper-open.svg +1 -1
- package/icons/folder-helper.svg +1 -1
- package/icons/folder-ios-open.svg +1 -1
- package/icons/folder-ios.svg +1 -1
- package/icons/folder-java-open.svg +1 -2
- package/icons/folder-java.svg +1 -2
- package/icons/folder-kubernetes-open.svg +1 -1
- package/icons/folder-kubernetes.svg +1 -1
- package/icons/folder-less-open.svg +1 -1
- package/icons/folder-less.svg +1 -1
- package/icons/folder-lib-open.svg +1 -1
- package/icons/folder-lib.svg +1 -1
- package/icons/folder-lua-open.svg +1 -1
- package/icons/folder-lua.svg +1 -1
- package/icons/folder-markdown-open.svg +1 -1
- package/icons/folder-markdown.svg +1 -1
- package/icons/folder-mjml.svg +1 -1
- package/icons/folder-netlify-open.svg +1 -5
- package/icons/folder-netlify.svg +1 -2
- package/icons/folder-next-open.svg +1 -2
- package/icons/folder-next.svg +1 -2
- package/icons/folder-nuxt-open.svg +1 -2
- package/icons/folder-nuxt.svg +1 -2
- package/icons/folder-pdf-open.svg +1 -2
- package/icons/folder-pdf.svg +1 -2
- package/icons/folder-php-open.svg +1 -1
- package/icons/folder-php.svg +1 -1
- package/icons/folder-pipe.svg +1 -1
- package/icons/folder-proto-open.svg +1 -2
- package/icons/folder-proto.svg +1 -2
- package/icons/folder-public-open.svg +1 -1
- package/icons/folder-python-open.svg +1 -1
- package/icons/folder-python.svg +1 -1
- package/icons/folder-queue-open.svg +1 -2
- package/icons/folder-queue.svg +1 -2
- package/icons/folder-react-components-open.svg +1 -1
- package/icons/folder-react-components.svg +1 -1
- package/icons/folder-redux-actions-open.svg +1 -1
- package/icons/folder-redux-actions.svg +1 -1
- package/icons/folder-redux-reducer-open.svg +1 -1
- package/icons/folder-redux-reducer.svg +1 -1
- package/icons/folder-redux-selector-open.svg +1 -1
- package/icons/folder-redux-selector.svg +1 -1
- package/icons/folder-redux-store-open.svg +1 -1
- package/icons/folder-redux-store.svg +1 -1
- package/icons/folder-resolver-open.svg +1 -2
- package/icons/folder-resolver.svg +1 -2
- package/icons/folder-resource-open.svg +1 -1
- package/icons/folder-resource.svg +1 -1
- package/icons/folder-sass-open.svg +1 -1
- package/icons/folder-sass.svg +1 -1
- package/icons/folder-scala-open.svg +1 -1
- package/icons/folder-scala.svg +1 -1
- package/icons/folder-server-open.svg +1 -1
- package/icons/folder-server.svg +1 -1
- package/icons/folder-serverless-open.svg +1 -5
- package/icons/folder-serverless.svg +1 -5
- package/icons/folder-shader-open.svg +1 -8
- package/icons/folder-shader.svg +1 -7
- package/icons/folder-src-open.svg +1 -1
- package/icons/folder-src.svg +1 -1
- package/icons/folder-stencil-open.svg +1 -1
- package/icons/folder-stencil.svg +1 -1
- package/icons/folder-supabase-open.svg +5 -0
- package/icons/folder-supabase.svg +2 -0
- package/icons/folder-svelte-open.svg +1 -1
- package/icons/folder-target-open.svg +1 -2
- package/icons/folder-target.svg +1 -2
- package/icons/folder-terraform-open.svg +1 -1
- package/icons/folder-terraform.svg +1 -1
- package/icons/folder-typescript-open.svg +1 -1
- package/icons/folder-typescript.svg +1 -1
- package/icons/folder-unity-open.svg +1 -2
- package/icons/folder-unity.svg +1 -2
- package/icons/folder-vercel-open.svg +1 -4
- package/icons/folder-vercel.svg +1 -4
- package/icons/folder-verdaccio-open.svg +1 -8
- package/icons/folder-verdaccio.svg +1 -8
- package/icons/folder-vue-directives-open.svg +1 -1
- package/icons/folder-vue-directives.svg +1 -1
- package/icons/folder-vue-open.svg +1 -1
- package/icons/folder-vue.svg +1 -1
- package/icons/folder-vuepress-open.svg +1 -1
- package/icons/folder-wakatime-open.svg +1 -1
- package/icons/folder-wakatime.svg +1 -1
- package/icons/folder-wordpress-open.svg +1 -1
- package/icons/folder-wordpress.svg +1 -1
- package/icons/forth.svg +1 -1
- package/icons/foxpro.svg +1 -1
- package/icons/fusebox.svg +1 -1
- package/icons/gatsby.svg +1 -1
- package/icons/gcp.svg +1 -1
- package/icons/gitlab.svg +1 -1
- package/icons/gleam.svg +1 -4
- package/icons/go-mod.svg +1 -1
- package/icons/go.svg +1 -1
- package/icons/graphcool.svg +1 -1
- package/icons/graphql.svg +1 -1
- package/icons/gridsome.svg +1 -4
- package/icons/grunt.svg +1 -1
- package/icons/hack.svg +1 -1
- package/icons/haml.svg +1 -1
- package/icons/hardhat.svg +1 -4
- package/icons/helm.svg +1 -1
- package/icons/heroku.svg +1 -1
- package/icons/hex.svg +1 -1
- package/icons/idris.svg +1 -1
- package/icons/jenkins.svg +1 -1
- package/icons/jest.svg +1 -1
- package/icons/jinja.svg +1 -1
- package/icons/jinja_light.svg +1 -1
- package/icons/kivy.svg +1 -1
- package/icons/kl.svg +1 -1
- package/icons/kusto.svg +1 -1
- package/icons/laravel.svg +1 -1
- package/icons/less.svg +1 -1
- package/icons/lighthouse.svg +1 -3
- package/icons/livescript.svg +1 -1
- package/icons/mdsvex.svg +1 -5
- package/icons/merlin.svg +1 -1
- package/icons/mjml.svg +1 -1
- package/icons/mocha.svg +1 -1
- package/icons/modernizr.svg +1 -1
- package/icons/nano-staged.svg +1 -0
- package/icons/nano-staged_light.svg +1 -0
- package/icons/ndst.svg +1 -7
- package/icons/netlify.svg +1 -1
- package/icons/next.svg +1 -3
- package/icons/next_light.svg +1 -3
- package/icons/npm.svg +1 -1
- package/icons/nrwl.svg +1 -1
- package/icons/nunjucks.svg +1 -1
- package/icons/nuxt.svg +1 -5
- package/icons/odin.svg +1 -6
- package/icons/otne.svg +1 -16
- package/icons/parcel.svg +1 -4
- package/icons/pdf.svg +1 -4
- package/icons/percy.svg +1 -1
- package/icons/pinejs.svg +1 -0
- package/icons/playwright.svg +1 -7
- package/icons/plop.svg +1 -4
- package/icons/pnpm.svg +1 -9
- package/icons/pnpm_light.svg +1 -7
- package/icons/poetry.svg +1 -1
- package/icons/postcss.svg +1 -1
- package/icons/posthtml.svg +1 -1
- package/icons/processing.svg +1 -10
- package/icons/prolog.svg +1 -1
- package/icons/protractor.svg +1 -1
- package/icons/pug.svg +1 -1
- package/icons/puppet.svg +1 -1
- package/icons/purescript.svg +1 -1
- package/icons/python.svg +1 -1
- package/icons/racket.svg +1 -1
- package/icons/red.svg +1 -1
- package/icons/remix.svg +1 -4
- package/icons/remix_light.svg +1 -4
- package/icons/replit.svg +1 -1
- package/icons/rescript-interface.svg +1 -5
- package/icons/restql.svg +1 -1
- package/icons/roadmap.svg +1 -1
- package/icons/robot.svg +1 -1
- package/icons/rollup.svg +1 -1
- package/icons/rome.svg +1 -5
- package/icons/rubocop.svg +1 -1
- package/icons/rubocop_light.svg +1 -1
- package/icons/ruby.svg +1 -1
- package/icons/san.svg +1 -1
- package/icons/sass.svg +1 -1
- package/icons/scala.svg +1 -1
- package/icons/sequelize.svg +1 -1
- package/icons/serverless.svg +1 -4
- package/icons/shader.svg +1 -4
- package/icons/silverstripe.svg +1 -1
- package/icons/siyuan.svg +1 -9
- package/icons/sketch.svg +1 -1
- package/icons/snyk.svg +1 -1
- package/icons/sonarcloud.svg +4 -0
- package/icons/steadybit.svg +1 -1
- package/icons/stencil.svg +1 -1
- package/icons/stitches.svg +1 -1
- package/icons/stitches_light.svg +1 -1
- package/icons/stylable.svg +10 -0
- package/icons/supabase.svg +4 -0
- package/icons/svgr.svg +1 -4
- package/icons/tauri.svg +1 -9
- package/icons/template.svg +1 -4
- package/icons/tobi.svg +1 -4
- package/icons/tobimake.svg +1 -14
- package/icons/tree.svg +1 -2
- package/icons/tsconfig.svg +1 -1
- package/icons/turborepo.svg +1 -12
- package/icons/turborepo_light.svg +1 -12
- package/icons/twine.svg +1 -1
- package/icons/vagrant.svg +1 -1
- package/icons/verdaccio.svg +1 -5
- package/icons/vscode.svg +1 -1
- package/icons/vue-config.svg +1 -1
- package/icons/vue.svg +1 -1
- package/icons/webhint.svg +1 -1
- package/icons/zig.svg +1 -1
- package/images/contributors.png +0 -0
- package/images/fileIcons.png +0 -0
- package/images/folderIcons.png +0 -0
- package/package.json +252 -267
- package/package.nls.de.json +0 -3
- package/package.nls.es.json +0 -3
- package/package.nls.fr.json +0 -3
- package/package.nls.ja.json +0 -3
- package/package.nls.json +0 -3
- package/package.nls.nl.json +0 -3
- package/package.nls.pl.json +0 -3
- package/package.nls.pt-BR.json +0 -3
- package/package.nls.pt-PT.json +0 -3
- package/package.nls.ru.json +0 -3
- package/package.nls.zh-CN.json +0 -3
- package/package.nls.zh-TW.json +0 -3
- package/src/commands/activate.ts +11 -9
- package/src/commands/explorerArrows.ts +18 -18
- package/src/commands/folderColor.ts +12 -12
- package/src/commands/folders.ts +17 -17
- package/src/commands/grayscale.ts +17 -17
- package/src/commands/iconPacks.ts +12 -16
- package/src/commands/index.ts +5 -5
- package/src/commands/opacity.ts +8 -8
- package/src/commands/saturation.ts +8 -8
- package/src/extension.ts +8 -13
- package/src/helpers/customIcons.ts +2 -2
- package/src/helpers/index.ts +10 -22
- package/src/i18n/index.ts +2 -2
- package/src/i18n/lang-de.ts +0 -11
- package/src/i18n/lang-en.ts +5 -15
- package/src/i18n/lang-es.ts +0 -10
- package/src/i18n/lang-fr.ts +0 -10
- package/src/i18n/lang-ja.ts +0 -11
- package/src/i18n/lang-nl.ts +0 -11
- package/src/i18n/lang-pl.ts +0 -9
- package/src/i18n/lang-pt-br.ts +0 -10
- package/src/i18n/lang-pt-pt.ts +0 -10
- package/src/i18n/lang-ru.ts +0 -9
- package/src/i18n/lang-uk.ts +0 -11
- package/src/i18n/lang-zh-cn.ts +0 -9
- package/src/i18n/lang-zh-tw.ts +0 -9
- package/src/icons/fileIcons.ts +2159 -2113
- package/src/icons/folderIcons.ts +804 -790
- package/src/icons/generator/folderGenerator.ts +7 -7
- package/src/icons/generator/iconOpacity.ts +10 -10
- package/src/icons/generator/iconSaturation.ts +10 -10
- package/src/icons/generator/jsonGenerator.ts +21 -17
- package/src/icons/languageIcons.ts +1 -0
- package/src/models/i18n/translation.ts +0 -9
- package/src/models/iconConfiguration.ts +1 -1
- package/src/models/icons/iconJsonOptions.ts +0 -2
- package/src/models/index.ts +0 -1
- package/src/scripts/contributors/index.ts +14 -14
- package/src/scripts/helpers/screenshots.ts +4 -4
- package/src/scripts/icons/checks/checkIconAvailability.ts +12 -12
- package/src/scripts/icons/checks/checkIconConflicts.ts +6 -8
- package/src/scripts/icons/checks/checkIconUsage.ts +9 -13
- package/src/scripts/icons/checks/index.ts +6 -6
- package/src/scripts/preview/preview.ts +8 -10
- package/src/test/runTest.ts +3 -3
- package/src/test/spec/i18n/i18n.spec.ts +13 -20
- package/src/test/spec/icons/fileIcons.spec.ts +5 -5
- package/src/test/spec/icons/folderIcons.spec.ts +8 -8
- package/src/test/spec/icons/languageIcons.spec.ts +6 -6
- package/images/oneclickactivation.png +0 -0
- package/src/helpers/versioning.ts +0 -73
- package/src/messages/outdated.ts +0 -33
- package/src/messages/reload.ts +0 -32
- package/src/messages/start.ts +0 -12
- package/src/messages/update.ts +0 -48
- package/src/messages/welcome.ts +0 -47
- package/src/models/helpers/index.ts +0 -1
- package/src/models/helpers/themeStatus.ts +0 -5
package/package.nls.ru.json
CHANGED
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"configuration.files.associations": "Настройка пользовательских ассоциаций значков файлов.",
|
|
11
11
|
"configuration.folders.associations": "Настройка пользовательских ассоциаций значков папок.",
|
|
12
12
|
"configuration.languages.associations": "Настройка ассоциаций значков пользовательского языка.",
|
|
13
|
-
"configuration.showWelcomeMessage": "Показывать приветственное сообщение после первой установки.",
|
|
14
|
-
"configuration.showUpdateMessage": "Показывать сообщение об обновлении после каждого обновления.",
|
|
15
|
-
"configuration.showReloadMessage": "Показывать сообщение перезагрузки.",
|
|
16
13
|
"configuration.activeIconPack": "Выберите набор значков, которые включают определенные значки.",
|
|
17
14
|
"configuration.activeIconPack.angular": "Иконки для Angular.",
|
|
18
15
|
"configuration.activeIconPack.angular_ngrx": "Иконки для Angular и ngrx.",
|
package/package.nls.zh-CN.json
CHANGED
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"configuration.files.associations": "设置自定义文件图标关联。",
|
|
11
11
|
"configuration.folders.associations": "设置自定义文件夹图标关联。",
|
|
12
12
|
"configuration.languages.associations": "定义自定义语言映射的图标。",
|
|
13
|
-
"configuration.showWelcomeMessage": "首次安装后显示欢迎信息。",
|
|
14
|
-
"configuration.showUpdateMessage": "更新后显示升级信息。",
|
|
15
|
-
"configuration.showReloadMessage": "显示重启消息。",
|
|
16
13
|
"configuration.activeIconPack": "选择一个图标包。",
|
|
17
14
|
"configuration.activeIconPack.angular": "Angular的图标。",
|
|
18
15
|
"configuration.activeIconPack.angular_ngrx": "Angular和ngrx的图标。",
|
package/package.nls.zh-TW.json
CHANGED
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"configuration.files.associations": "設置自定義文件圖標關聯。",
|
|
11
11
|
"configuration.folders.associations": "設置自定義文件夾圖標關聯。",
|
|
12
12
|
"configuration.languages.associations": "定義自定義語言映射的圖標。",
|
|
13
|
-
"configuration.showWelcomeMessage": "首次安裝後顯示歡迎信息。",
|
|
14
|
-
"configuration.showUpdateMessage": "更新後顯示升級信息。",
|
|
15
|
-
"configuration.showReloadMessage": "顯示重啟消息。",
|
|
16
13
|
"configuration.activeIconPack": "選擇一個圖標包。",
|
|
17
14
|
"configuration.activeIconPack.angular": "Angular的圖標。",
|
|
18
15
|
"configuration.activeIconPack.angular_ngrx": "Angular和ngrx的圖標。",
|
package/src/commands/activate.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { window as codeWindow } from 'vscode';
|
|
2
|
+
import { getConfig } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
4
4
|
|
|
5
5
|
/** Activate the icon theme by changing the settings for the iconTheme. */
|
|
6
6
|
export const activateIcons = () => {
|
|
@@ -11,15 +11,17 @@ export const activateIcons = () => {
|
|
|
11
11
|
const setIconTheme = async () => {
|
|
12
12
|
// global user config
|
|
13
13
|
try {
|
|
14
|
-
await
|
|
15
|
-
.
|
|
16
|
-
|
|
14
|
+
await getConfig().update(
|
|
15
|
+
'workbench.iconTheme',
|
|
16
|
+
'material-icon-theme',
|
|
17
|
+
true
|
|
18
|
+
);
|
|
17
19
|
|
|
18
20
|
// local workspace config
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
+
if (getConfig().inspect('workbench.iconTheme')?.workspaceValue) {
|
|
22
|
+
getConfig().update('workbench.iconTheme', 'material-icon-theme');
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
codeWindow.showInformationMessage(translate('activated'));
|
|
23
25
|
} catch (error) {
|
|
24
26
|
console.error(error);
|
|
25
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { QuickPickItem, window as codeWindow } from 'vscode';
|
|
2
|
+
import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
4
4
|
|
|
5
5
|
/** Command to toggle the explorer arrows. */
|
|
6
6
|
export const toggleExplorerArrows = async () => {
|
|
@@ -16,33 +16,33 @@ export const toggleExplorerArrows = async () => {
|
|
|
16
16
|
/** Show QuickPick items to select preferred configuration for the explorer arrows. */
|
|
17
17
|
const showQuickPickItems = (
|
|
18
18
|
status: boolean
|
|
19
|
-
): Thenable<
|
|
20
|
-
const on:
|
|
21
|
-
description:
|
|
22
|
-
detail:
|
|
19
|
+
): Thenable<QuickPickItem | undefined> => {
|
|
20
|
+
const on: QuickPickItem = {
|
|
21
|
+
description: translate('toggleSwitch.on'),
|
|
22
|
+
detail: translate('explorerArrows.enable'),
|
|
23
23
|
label: !status ? '\u2714' : '\u25FB',
|
|
24
24
|
};
|
|
25
|
-
const off:
|
|
26
|
-
description:
|
|
27
|
-
detail:
|
|
25
|
+
const off: QuickPickItem = {
|
|
26
|
+
description: translate('toggleSwitch.off'),
|
|
27
|
+
detail: translate('explorerArrows.disable'),
|
|
28
28
|
label: status ? '\u2714' : '\u25FB',
|
|
29
29
|
};
|
|
30
|
-
return
|
|
31
|
-
placeHolder:
|
|
30
|
+
return codeWindow.showQuickPick([on, off], {
|
|
31
|
+
placeHolder: translate('explorerArrows.toggle'),
|
|
32
32
|
ignoreFocusOut: false,
|
|
33
33
|
matchOnDescription: true,
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/** Handle the actions from the QuickPick. */
|
|
38
|
-
const handleQuickPickActions = (value:
|
|
38
|
+
const handleQuickPickActions = (value: QuickPickItem | undefined) => {
|
|
39
39
|
if (!value?.description) return;
|
|
40
40
|
switch (value.description) {
|
|
41
|
-
case
|
|
42
|
-
return
|
|
41
|
+
case translate('toggleSwitch.on'): {
|
|
42
|
+
return setThemeConfig('hidesExplorerArrows', false, true);
|
|
43
43
|
}
|
|
44
|
-
case
|
|
45
|
-
return
|
|
44
|
+
case translate('toggleSwitch.off'): {
|
|
45
|
+
return setThemeConfig('hidesExplorerArrows', true, true);
|
|
46
46
|
}
|
|
47
47
|
default:
|
|
48
48
|
return;
|
|
@@ -51,5 +51,5 @@ const handleQuickPickActions = (value: vscode.QuickPickItem | undefined) => {
|
|
|
51
51
|
|
|
52
52
|
/** Check if arrows are enabled. */
|
|
53
53
|
export const checkArrowStatus = (): boolean => {
|
|
54
|
-
return !!
|
|
54
|
+
return !!getMaterialIconsJSON()?.hidesExplorerArrows;
|
|
55
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { QuickPickItem, window as codeWindow } from 'vscode';
|
|
2
|
+
import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
2
4
|
import { getDefaultIconOptions, validateHEXColorCode } from '../icons';
|
|
3
|
-
import * as helpers from './../helpers';
|
|
4
|
-
import * as i18n from './../i18n';
|
|
5
5
|
|
|
6
6
|
interface FolderColor {
|
|
7
7
|
label: string;
|
|
@@ -35,25 +35,25 @@ export const changeFolderColor = async () => {
|
|
|
35
35
|
/** Show QuickPick items to select preferred color for the folder icons. */
|
|
36
36
|
const showQuickPickItems = (currentColor: string) => {
|
|
37
37
|
const options = iconPalette.map(
|
|
38
|
-
(color):
|
|
38
|
+
(color): QuickPickItem => ({
|
|
39
39
|
description: color.label,
|
|
40
40
|
label: isColorActive(color, currentColor) ? '\u2714' : '\u25FB',
|
|
41
41
|
})
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
-
return
|
|
45
|
-
placeHolder:
|
|
44
|
+
return codeWindow.showQuickPick(options, {
|
|
45
|
+
placeHolder: translate('folders.color'),
|
|
46
46
|
ignoreFocusOut: false,
|
|
47
47
|
matchOnDescription: true,
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
/** Handle the actions from the QuickPick. */
|
|
52
|
-
const handleQuickPickActions = async (value:
|
|
52
|
+
const handleQuickPickActions = async (value: QuickPickItem) => {
|
|
53
53
|
if (!value || !value.description) return;
|
|
54
54
|
if (value.description === 'Custom Color') {
|
|
55
|
-
const value = await
|
|
56
|
-
placeHolder:
|
|
55
|
+
const value = await codeWindow.showInputBox({
|
|
56
|
+
placeHolder: translate('folders.hexCode'),
|
|
57
57
|
ignoreFocusOut: true,
|
|
58
58
|
validateInput: validateColorInput,
|
|
59
59
|
});
|
|
@@ -70,7 +70,7 @@ const handleQuickPickActions = async (value: vscode.QuickPickItem) => {
|
|
|
70
70
|
|
|
71
71
|
const validateColorInput = (colorInput: string) => {
|
|
72
72
|
if (!validateHEXColorCode(colorInput)) {
|
|
73
|
-
return
|
|
73
|
+
return translate('folders.wrongHexCode');
|
|
74
74
|
}
|
|
75
75
|
return undefined;
|
|
76
76
|
};
|
|
@@ -78,12 +78,12 @@ const validateColorInput = (colorInput: string) => {
|
|
|
78
78
|
/** Check status of the folder color */
|
|
79
79
|
export const checkFolderColorStatus = (): string => {
|
|
80
80
|
const defaultOptions = getDefaultIconOptions();
|
|
81
|
-
const config =
|
|
81
|
+
const config = getMaterialIconsJSON();
|
|
82
82
|
return config?.options?.folders?.color ?? defaultOptions.folders.color!;
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
const setColorConfig = (value: string) => {
|
|
86
|
-
|
|
86
|
+
setThemeConfig('folders.color', value.toLowerCase(), true);
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
const isColorActive = (color: FolderColor, currentColor: string): boolean => {
|
package/src/commands/folders.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { QuickPickItem, window as codeWindow } from 'vscode';
|
|
2
|
+
import {
|
|
3
|
+
capitalizeFirstLetter,
|
|
4
|
+
getMaterialIconsJSON,
|
|
5
|
+
setThemeConfig,
|
|
6
|
+
} from '../helpers';
|
|
7
|
+
import { translate } from '../i18n';
|
|
2
8
|
import { folderIcons } from '../icons';
|
|
3
|
-
import * as helpers from './../helpers';
|
|
4
|
-
import * as i18n from './../i18n';
|
|
5
9
|
|
|
6
10
|
/** Command to toggle the folder icons. */
|
|
7
11
|
export const changeFolderTheme = async () => {
|
|
@@ -19,37 +23,33 @@ export const changeFolderTheme = async () => {
|
|
|
19
23
|
/** Show QuickPick items to select preferred configuration for the folder icons. */
|
|
20
24
|
const showQuickPickItems = (activeTheme: string) => {
|
|
21
25
|
const options = folderIcons.map(
|
|
22
|
-
(theme):
|
|
23
|
-
description:
|
|
26
|
+
(theme): QuickPickItem => ({
|
|
27
|
+
description: capitalizeFirstLetter(theme.name),
|
|
24
28
|
detail:
|
|
25
29
|
theme.name === 'none'
|
|
26
|
-
?
|
|
27
|
-
:
|
|
30
|
+
? translate('folders.disabled')
|
|
31
|
+
: translate(
|
|
28
32
|
'folders.theme.description',
|
|
29
|
-
|
|
33
|
+
capitalizeFirstLetter(theme.name)
|
|
30
34
|
),
|
|
31
35
|
label: theme.name === activeTheme ? '\u2714' : '\u25FB',
|
|
32
36
|
})
|
|
33
37
|
);
|
|
34
38
|
|
|
35
|
-
return
|
|
36
|
-
placeHolder:
|
|
39
|
+
return codeWindow.showQuickPick(options, {
|
|
40
|
+
placeHolder: translate('folders.toggleIcons'),
|
|
37
41
|
ignoreFocusOut: false,
|
|
38
42
|
matchOnDescription: true,
|
|
39
43
|
});
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
/** Handle the actions from the QuickPick. */
|
|
43
|
-
const handleQuickPickActions = (value:
|
|
47
|
+
const handleQuickPickActions = (value: QuickPickItem) => {
|
|
44
48
|
if (!value || !value.description) return;
|
|
45
|
-
return
|
|
46
|
-
'folders.theme',
|
|
47
|
-
value.description.toLowerCase(),
|
|
48
|
-
true
|
|
49
|
-
);
|
|
49
|
+
return setThemeConfig('folders.theme', value.description.toLowerCase(), true);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/** Get the current folder theme. */
|
|
53
53
|
export const getFolderIconTheme = (): string => {
|
|
54
|
-
return
|
|
54
|
+
return getMaterialIconsJSON()?.options?.folders?.theme ?? '';
|
|
55
55
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { QuickPickItem, window as codeWindow } from 'vscode';
|
|
2
|
+
import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
4
4
|
|
|
5
5
|
/** Command to toggle grayscale. */
|
|
6
6
|
export const toggleGrayscale = async () => {
|
|
@@ -17,32 +17,32 @@ export const toggleGrayscale = async () => {
|
|
|
17
17
|
|
|
18
18
|
/** Show QuickPick items to select preferred configuration for grayscale icons. */
|
|
19
19
|
const showQuickPickItems = (status: boolean) => {
|
|
20
|
-
const on:
|
|
21
|
-
description:
|
|
22
|
-
detail:
|
|
20
|
+
const on: QuickPickItem = {
|
|
21
|
+
description: translate('toggleSwitch.on'),
|
|
22
|
+
detail: translate('grayscale.enable'),
|
|
23
23
|
label: status ? '\u2714' : '\u25FB',
|
|
24
24
|
};
|
|
25
|
-
const off:
|
|
26
|
-
description:
|
|
27
|
-
detail:
|
|
25
|
+
const off: QuickPickItem = {
|
|
26
|
+
description: translate('toggleSwitch.off'),
|
|
27
|
+
detail: translate('grayscale.disable'),
|
|
28
28
|
label: !status ? '\u2714' : '\u25FB',
|
|
29
29
|
};
|
|
30
|
-
return
|
|
31
|
-
placeHolder:
|
|
30
|
+
return codeWindow.showQuickPick([on, off], {
|
|
31
|
+
placeHolder: translate('grayscale.toggle'),
|
|
32
32
|
ignoreFocusOut: false,
|
|
33
33
|
matchOnDescription: true,
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/** Handle the actions from the QuickPick. */
|
|
38
|
-
const handleQuickPickActions = (value:
|
|
38
|
+
const handleQuickPickActions = (value: QuickPickItem) => {
|
|
39
39
|
if (!value || !value.description) return;
|
|
40
40
|
switch (value.description) {
|
|
41
|
-
case
|
|
42
|
-
return
|
|
41
|
+
case translate('toggleSwitch.on'): {
|
|
42
|
+
return setThemeConfig('saturation', 0, true);
|
|
43
43
|
}
|
|
44
|
-
case
|
|
45
|
-
return
|
|
44
|
+
case translate('toggleSwitch.off'): {
|
|
45
|
+
return setThemeConfig('saturation', 1, true);
|
|
46
46
|
}
|
|
47
47
|
default:
|
|
48
48
|
return;
|
|
@@ -51,5 +51,5 @@ const handleQuickPickActions = (value: vscode.QuickPickItem) => {
|
|
|
51
51
|
|
|
52
52
|
/** Is grayscale icons enabled? */
|
|
53
53
|
export const checkGrayscaleStatus = (): boolean => {
|
|
54
|
-
return
|
|
54
|
+
return getMaterialIconsJSON()?.options?.saturation === 0;
|
|
55
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { QuickPickItem, window as codeWindow } from 'vscode';
|
|
2
|
+
import { getMaterialIconsJSON, setThemeConfig, toTitleCase } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
4
|
+
import { IconPack } from '../models';
|
|
5
5
|
|
|
6
6
|
/** Command to toggle the icons packs */
|
|
7
7
|
export const toggleIconPacks = async () => {
|
|
@@ -19,14 +19,14 @@ export const toggleIconPacks = async () => {
|
|
|
19
19
|
/** Show QuickPick items to select preferred configuration for the icon packs. */
|
|
20
20
|
const showQuickPickItems = (activePack: string) => {
|
|
21
21
|
const packs = [...getAllIconPacks().sort(), 'none'];
|
|
22
|
-
const options = packs.map((pack):
|
|
23
|
-
const packLabel =
|
|
22
|
+
const options = packs.map((pack): QuickPickItem => {
|
|
23
|
+
const packLabel = toTitleCase(pack.replace('_', ' + '));
|
|
24
24
|
const active = isPackActive(activePack, pack);
|
|
25
25
|
const iconPacksDeactivated = pack === 'none' && activePack === '';
|
|
26
26
|
|
|
27
27
|
return {
|
|
28
28
|
description: packLabel,
|
|
29
|
-
detail:
|
|
29
|
+
detail: translate(
|
|
30
30
|
`iconPacks.${pack === 'none' ? 'disabled' : 'description'}`,
|
|
31
31
|
packLabel
|
|
32
32
|
),
|
|
@@ -34,8 +34,8 @@ const showQuickPickItems = (activePack: string) => {
|
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
return
|
|
38
|
-
placeHolder:
|
|
37
|
+
return codeWindow.showQuickPick(options, {
|
|
38
|
+
placeHolder: translate('iconPacks.selectPack'),
|
|
39
39
|
ignoreFocusOut: false,
|
|
40
40
|
matchOnDescription: true,
|
|
41
41
|
matchOnDetail: true,
|
|
@@ -43,19 +43,15 @@ const showQuickPickItems = (activePack: string) => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/** Handle the actions from the QuickPick. */
|
|
46
|
-
const handleQuickPickActions = (value:
|
|
46
|
+
const handleQuickPickActions = (value: QuickPickItem) => {
|
|
47
47
|
if (!value || !value.description) return;
|
|
48
48
|
const decision = value.description.replace(' + ', '_').toLowerCase();
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
'activeIconPack',
|
|
52
|
-
decision === 'none' ? '' : decision,
|
|
53
|
-
true
|
|
54
|
-
);
|
|
50
|
+
setThemeConfig('activeIconPack', decision === 'none' ? '' : decision, true);
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
const getActiveIconPack = (): string => {
|
|
58
|
-
return
|
|
54
|
+
return getMaterialIconsJSON()?.options?.activeIconPack ?? '';
|
|
59
55
|
};
|
|
60
56
|
|
|
61
57
|
/** Get all packs that can be used in this icon theme. */
|
package/src/commands/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { commands } from 'vscode';
|
|
2
2
|
import { activateIcons } from './activate';
|
|
3
3
|
import { toggleExplorerArrows } from './explorerArrows';
|
|
4
4
|
import { changeFolderColor } from './folderColor';
|
|
@@ -9,7 +9,7 @@ import { changeOpacity } from './opacity';
|
|
|
9
9
|
import { restoreDefaultConfig } from './restoreConfig';
|
|
10
10
|
import { changeSaturation } from './saturation';
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const extensionCommands: { [commmand: string]: () => Promise<void> } = {
|
|
13
13
|
activateIcons,
|
|
14
14
|
toggleIconPacks,
|
|
15
15
|
changeFolderTheme,
|
|
@@ -21,9 +21,9 @@ const commands: { [commmand: string]: () => Promise<void> } = {
|
|
|
21
21
|
changeSaturation,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
export const registered = Object.keys(
|
|
25
|
-
const callCommand = () =>
|
|
26
|
-
return
|
|
24
|
+
export const registered = Object.keys(extensionCommands).map((commandName) => {
|
|
25
|
+
const callCommand = () => extensionCommands[commandName]();
|
|
26
|
+
return commands.registerCommand(
|
|
27
27
|
`material-icon-theme.${commandName}`,
|
|
28
28
|
callCommand
|
|
29
29
|
);
|
package/src/commands/opacity.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { window as codeWindow } from 'vscode';
|
|
2
|
+
import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
2
4
|
import { getDefaultIconOptions, validateOpacityValue } from '../icons';
|
|
3
|
-
import * as helpers from './../helpers';
|
|
4
|
-
import * as i18n from './../i18n';
|
|
5
5
|
|
|
6
6
|
/** Command to toggle the folder icons. */
|
|
7
7
|
export const changeOpacity = async () => {
|
|
@@ -18,8 +18,8 @@ export const changeOpacity = async () => {
|
|
|
18
18
|
|
|
19
19
|
/** Show input to enter the opacity value. */
|
|
20
20
|
const showInput = (opacity: number) => {
|
|
21
|
-
return
|
|
22
|
-
placeHolder:
|
|
21
|
+
return codeWindow.showInputBox({
|
|
22
|
+
placeHolder: translate('opacity.inputPlaceholder'),
|
|
23
23
|
ignoreFocusOut: true,
|
|
24
24
|
value: opacity.toString(),
|
|
25
25
|
validateInput: validateOpacityInput,
|
|
@@ -29,7 +29,7 @@ const showInput = (opacity: number) => {
|
|
|
29
29
|
/** Validate the opacity value which was inserted by the user. */
|
|
30
30
|
const validateOpacityInput = (opacityInput: string) => {
|
|
31
31
|
if (!validateOpacityValue(+opacityInput)) {
|
|
32
|
-
return
|
|
32
|
+
return translate('opacity.wrongValue');
|
|
33
33
|
}
|
|
34
34
|
return undefined;
|
|
35
35
|
};
|
|
@@ -37,10 +37,10 @@ const validateOpacityInput = (opacityInput: string) => {
|
|
|
37
37
|
/** Get the current value of the opacity of the icons. */
|
|
38
38
|
export const getCurrentOpacityValue = (): number => {
|
|
39
39
|
const defaultOptions = getDefaultIconOptions();
|
|
40
|
-
const config =
|
|
40
|
+
const config = getMaterialIconsJSON();
|
|
41
41
|
return config?.options?.opacity ?? defaultOptions.opacity;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const setOpacityConfig = (opacity: number) => {
|
|
45
|
-
return
|
|
45
|
+
return setThemeConfig('opacity', opacity, true);
|
|
46
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { window as codeWindow } from 'vscode';
|
|
2
|
+
import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
|
|
3
|
+
import { translate } from '../i18n';
|
|
2
4
|
import { getDefaultIconOptions, validateSaturationValue } from '../icons';
|
|
3
|
-
import * as helpers from './../helpers';
|
|
4
|
-
import * as i18n from './../i18n';
|
|
5
5
|
|
|
6
6
|
/** Command to toggle the folder icons. */
|
|
7
7
|
export const changeSaturation = async () => {
|
|
@@ -18,8 +18,8 @@ export const changeSaturation = async () => {
|
|
|
18
18
|
|
|
19
19
|
/** Show input to enter the saturation value. */
|
|
20
20
|
const showInput = (saturation: number) => {
|
|
21
|
-
return
|
|
22
|
-
placeHolder:
|
|
21
|
+
return codeWindow.showInputBox({
|
|
22
|
+
placeHolder: translate('saturation.inputPlaceholder'),
|
|
23
23
|
ignoreFocusOut: true,
|
|
24
24
|
value: saturation.toString(),
|
|
25
25
|
validateInput: validateSaturationInput,
|
|
@@ -29,7 +29,7 @@ const showInput = (saturation: number) => {
|
|
|
29
29
|
/** Validate the saturation value which was inserted by the user. */
|
|
30
30
|
const validateSaturationInput = (saturationInput: string) => {
|
|
31
31
|
if (!validateSaturationValue(+saturationInput)) {
|
|
32
|
-
return
|
|
32
|
+
return translate('saturation.wrongValue');
|
|
33
33
|
}
|
|
34
34
|
return undefined;
|
|
35
35
|
};
|
|
@@ -37,10 +37,10 @@ const validateSaturationInput = (saturationInput: string) => {
|
|
|
37
37
|
/** Get the current value of the saturation of the icons. */
|
|
38
38
|
export const getCurrentSaturationValue = (): number => {
|
|
39
39
|
const defaultOptions = getDefaultIconOptions();
|
|
40
|
-
const config =
|
|
40
|
+
const config = getMaterialIconsJSON();
|
|
41
41
|
return config?.options?.saturation ?? defaultOptions.saturation;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const setSaturationConfig = (saturation: number) => {
|
|
45
|
-
return
|
|
45
|
+
return setThemeConfig('saturation', saturation, true);
|
|
46
46
|
};
|
package/src/extension.ts
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { ExtensionContext, window as codeWindow, workspace } from 'vscode';
|
|
4
|
+
import { registered } from './commands';
|
|
5
5
|
import { detectConfigChanges } from './helpers/changeDetection';
|
|
6
|
-
import {
|
|
7
|
-
import * as i18n from './i18n';
|
|
8
|
-
import { showStartMessages } from './messages/start';
|
|
6
|
+
import { initTranslations } from './i18n';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* This method is called when the extension is activated.
|
|
12
10
|
* It initializes the core functionality of the extension.
|
|
13
11
|
*/
|
|
14
|
-
export const activate = async (context:
|
|
12
|
+
export const activate = async (context: ExtensionContext) => {
|
|
15
13
|
try {
|
|
16
|
-
await
|
|
17
|
-
context.globalState.setKeysForSync([versionKey]);
|
|
18
|
-
const status = await checkThemeStatus(context.globalState);
|
|
19
|
-
showStartMessages(status);
|
|
14
|
+
await initTranslations();
|
|
20
15
|
|
|
21
16
|
// Subscribe to the extension commands
|
|
22
|
-
context.subscriptions.push(...
|
|
17
|
+
context.subscriptions.push(...registered);
|
|
23
18
|
|
|
24
19
|
// Initially trigger the config change detection
|
|
25
20
|
detectConfigChanges();
|
|
26
21
|
|
|
27
22
|
// Observe changes in the config
|
|
28
|
-
|
|
23
|
+
workspace.onDidChangeConfiguration(detectConfigChanges);
|
|
29
24
|
|
|
30
25
|
// Observe if the window got focused to trigger config changes
|
|
31
|
-
|
|
26
|
+
codeWindow.onDidChangeWindowState((state) => {
|
|
32
27
|
if (state.focused) {
|
|
33
28
|
detectConfigChanges();
|
|
34
29
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { dirname, join } from 'path';
|
|
1
2
|
import { IconJsonOptions } from '../models';
|
|
2
|
-
import * as path from 'path';
|
|
3
3
|
|
|
4
4
|
export const getCustomIconPaths = (options: IconJsonOptions) => {
|
|
5
5
|
return Object.values(options?.files?.associations ?? {})
|
|
6
6
|
.filter((v) => v.match(/^[.\/]+/)) // <- custom dirs have a relative path to the dist folder
|
|
7
|
-
.map((v) =>
|
|
7
|
+
.map((v) => dirname(join(__dirname, v)));
|
|
8
8
|
};
|
package/src/helpers/index.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { extensions, workspace } from 'vscode';
|
|
4
4
|
import { iconJsonName } from '../icons/index';
|
|
5
5
|
import { IconConfiguration } from '../models/index';
|
|
6
|
-
import * as reloadMessages from './../messages/reload';
|
|
7
6
|
|
|
8
7
|
/** Get configuration of vs code. */
|
|
9
8
|
export const getConfig = (section?: string) => {
|
|
10
|
-
return
|
|
9
|
+
return workspace.getConfiguration(section);
|
|
11
10
|
};
|
|
12
11
|
|
|
13
12
|
/** Get list of configuration entries of package.json */
|
|
14
13
|
export const getConfigProperties = (): { [config: string]: unknown } => {
|
|
15
|
-
return
|
|
16
|
-
?.
|
|
14
|
+
return extensions.getExtension('PKief.material-icon-theme')?.packageJSON
|
|
15
|
+
?.contributes?.configuration?.properties;
|
|
17
16
|
};
|
|
18
17
|
|
|
19
18
|
/** Update configuration of vs code. */
|
|
@@ -60,16 +59,15 @@ export const isThemeNotVisible = (): boolean => {
|
|
|
60
59
|
};
|
|
61
60
|
|
|
62
61
|
/** Return the path of the extension in the file system. */
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'';
|
|
62
|
+
const getExtensionPath = () =>
|
|
63
|
+
extensions.getExtension('PKief.material-icon-theme')?.extensionPath ?? '';
|
|
66
64
|
|
|
67
65
|
/** Get the configuration of the icons as JSON Object */
|
|
68
66
|
export const getMaterialIconsJSON = (): IconConfiguration => {
|
|
69
|
-
const iconJSONPath =
|
|
67
|
+
const iconJSONPath = join(getExtensionPath(), 'dist', iconJsonName);
|
|
70
68
|
|
|
71
69
|
try {
|
|
72
|
-
const data =
|
|
70
|
+
const data = readFileSync(iconJSONPath, 'utf8');
|
|
73
71
|
return JSON.parse(data);
|
|
74
72
|
} catch (error) {
|
|
75
73
|
console.error(error);
|
|
@@ -77,16 +75,6 @@ export const getMaterialIconsJSON = (): IconConfiguration => {
|
|
|
77
75
|
}
|
|
78
76
|
};
|
|
79
77
|
|
|
80
|
-
/** Reload vs code window */
|
|
81
|
-
export const promptToReload = async () => {
|
|
82
|
-
const result = await reloadMessages.showConfirmToReloadMessage();
|
|
83
|
-
if (result) reloadWindow();
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const reloadWindow = () => {
|
|
87
|
-
return vscode.commands.executeCommand('workbench.action.reloadWindow');
|
|
88
|
-
};
|
|
89
|
-
|
|
90
78
|
/** Capitalize the first letter of a string */
|
|
91
79
|
export const capitalizeFirstLetter = (name: string): string =>
|
|
92
80
|
name.charAt(0).toUpperCase() + name.slice(1);
|
package/src/i18n/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { env } from 'vscode';
|
|
2
2
|
import { getObjectPropertyValue } from '../helpers/objects';
|
|
3
3
|
import { Translation } from '../models';
|
|
4
4
|
|
|
5
5
|
// Get current language of the vs code workspace
|
|
6
|
-
export const getCurrentLanguage = (): string =>
|
|
6
|
+
export const getCurrentLanguage = (): string => env.language;
|
|
7
7
|
|
|
8
8
|
let currentTranslation: Translation;
|
|
9
9
|
let fallbackTranslation: Translation;
|