From 39426f84f77c11db7d5ce204aab404f053843015 Mon Sep 17 00:00:00 2001 From: Benas Svipas Date: Mon, 29 Oct 2018 16:33:03 +0200 Subject: [PATCH 01/11] add __test__, __tests__, out foldernames and fix build foldername (#279) --- src/icons/partials/folderNames.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/icons/partials/folderNames.js b/src/icons/partials/folderNames.js index 9b128b4..3bd2561 100644 --- a/src/icons/partials/folderNames.js +++ b/src/icons/partials/folderNames.js @@ -2,6 +2,8 @@ "ci": "_folder_ci", "test": "_folder_test", "tests": "_folder_test", + "__test__": "_folder_test", + "__tests__": "_folder_test", "node_modules": "_folder_node", "assets": "_folder_assets", "bower_components": "_folder_bower", @@ -18,13 +20,16 @@ ".vscode": "_folder_vscode", ".gulp": "_folder_gulp", "gulp": "_folder_gulp", - "build": "_folder_dark_dist", - "dist": "_folder_dist" + "build": "_folder_dist", + "dist": "_folder_dist", + "out": "_folder_dist" }, "folderNamesExpanded": { "ci": "_folder_ci_open", "test": "_folder_test_open", "tests": "_folder_test_open", + "__test__": "_folder_test_open", + "__tests__": "_folder_test_open", "node_modules": "_folder_node_open", "bower_components": "_folder_bower_open", "assets": "_folder_assets_open", @@ -40,6 +45,7 @@ ".github": "_folder_github_open", ".gulp": "_folder_gulp_open", ".vscode": "_folder_vscode_open", - "build": "_folder_open_dist", - "dist": "_folder_dist_open" + "build": "_folder_dist_open", + "dist": "_folder_dist_open", + "out": "_folder_dist_open" } From 77067d0b4fadd31151e6e3cc75e32736e40f569a Mon Sep 17 00:00:00 2001 From: Mattia Astorino Date: Mon, 29 Oct 2018 15:46:14 +0100 Subject: [PATCH 02/11] update to 2.5.1 --- extensions/defaults.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/defaults.json b/extensions/defaults.json index 0c0f7be..94773e4 100644 --- a/extensions/defaults.json +++ b/extensions/defaults.json @@ -116,7 +116,7 @@ } }, "changelog": { - "lastversion": "2.5.0" + "lastversion": "2.5.1" }, "icons": { "theme": { From cac30f7339bd7ed3c6f1487c9421bf14491bf11a Mon Sep 17 00:00:00 2001 From: Benas Svipas Date: Wed, 31 Oct 2018 18:21:58 +0200 Subject: [PATCH 03/11] Add more languageids (#282) * add support for db, jsonc and fix sql file extension * add missing languageIds --- src/icons/partials/fileExtensions.js | 3 +- src/icons/partials/languageIds.js | 53 +++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/icons/partials/fileExtensions.js b/src/icons/partials/fileExtensions.js index f8b5f81..72ade70 100644 --- a/src/icons/partials/fileExtensions.js +++ b/src/icons/partials/fileExtensions.js @@ -17,7 +17,6 @@ "lnk": "_file_lnk", "pm": "_file_perl", "pl": "_file_perl", - "sql": "_file_sql", "jl": "_file_julia", "gv": "_file_graphviz", "erl": "_file_erlang", @@ -63,6 +62,7 @@ "sass": "_file_sass", "less": "_file_less", "json": "_file_json", + "jsonc": "_file_json", "yaml": "_file_yaml", "YAML-tmLanguage": "_file_yaml", "yml": "_file_yaml", @@ -185,6 +185,7 @@ "prop": "_file_settings", "settings": "_file_settings", "sql": "_file_database", + "db": "_file_database", "accdb": "_file_database", "mdb": "_file_database", "cer": "_file_certificate", diff --git a/src/icons/partials/languageIds.js b/src/icons/partials/languageIds.js index a82cb1b..77d207c 100644 --- a/src/icons/partials/languageIds.js +++ b/src/icons/partials/languageIds.js @@ -5,5 +5,56 @@ "hxml": "_file_haxe", "polymer": "_file_polymer", "matlab": "_file_matlab", - "makefile": "_file_settings" + "bat": "_file_cmd", + "c": "_file_c", + "csharp": "_file_csharp", + "cpp": "_file_cpp", + "css": "_file_css", + "clojure": "_file_clojure", + "coffeescript": "_file_coffee", + "dart": "_file_dart", + "diff": "_file_git", + "dockerfile": "_file_docker", + "fsharp": "_file_fsharp", + "git-commit": "_file_git", + "git-rebase": "_file_git", + "go": "_file_go", + "groovy": "_file_groovy", + "html": "_file_html", + "handlebars": "_file_handlebars", + "ignore": "_file_git", + "ini": "_file_settings", + "json": "_file_json", + "jsonc": "_file_json", + "java": "_file_java", + "javascript": "_file_js", + "javascriptreact": "_file_react", + "less": "_file_less", + "lua": "_file_lua", + "makefile": "_file_settings", + "markdown": "_file_markdown", + "objective-c": "_file_matlab", + "objective-cpp": "_file_cpp", + "php": "_file_php", + "perl": "_file_perl", + "perl6": "_file_perl", + "plaintext": "_file_document", + "powershell": "_file_console", + "properties": "_file_settings", + "proto3": "_file_protobuf", + "jade": "_file_pug", + "python": "_file_python", + "r": "_file_r", + "ruby": "_file_ruby", + "rust": "_file_rust", + "scss": "_file_sass", + "sql": "_file_database", + "shellscript": "_file_console", + "swift": "_file_swift", + "typescript": "_file_typescript", + "typescriptreact": "_file_react", + "vb": "_file_visualstudio", + "xml": "_file_xml", + "xsl": "_file_xml", + "yaml": "_file_yaml" }, From 1bf6a0be2e7dadea6a242c2e60216250b34aa48c Mon Sep 17 00:00:00 2001 From: Mattia Astorino Date: Sat, 10 Nov 2018 11:20:59 +0100 Subject: [PATCH 04/11] fix: Add borders to section headers for HC variants --- src/themes/theme-template-color-theme.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/themes/theme-template-color-theme.json b/src/themes/theme-template-color-theme.json index 3ea746a..4a7d64e 100644 --- a/src/themes/theme-template-color-theme.json +++ b/src/themes/theme-template-color-theme.json @@ -742,6 +742,7 @@ "titleBar.border": "{{variant.scheme.contrastBorder}}60", "sideBarTitle.foreground": "{{variant.scheme.foreground}}", "sideBarSectionHeader.background": "{{variant.scheme.backgroundAlt}}", + "sideBarSectionHeader.border": "{{variant.scheme.contrastBorder}}60", "input.background": "{{variant.scheme.inputBackground}}", "input.foreground": "{{variant.scheme.inputForeground}}", "input.placeholderForeground": "{{variant.scheme.foreground}}60", From 29e656e04fe9aa917aa3b8d2e8c18d1627a02962 Mon Sep 17 00:00:00 2001 From: Daniel Mahon Date: Fri, 16 Nov 2018 15:15:27 -0500 Subject: [PATCH 05/11] Update fileNames to support recommended babel config files (#283) https://babeljs.io/docs/en/configuration#babelrc --- src/icons/partials/fileNames.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/icons/partials/fileNames.js b/src/icons/partials/fileNames.js index 315167a..1432c89 100644 --- a/src/icons/partials/fileNames.js +++ b/src/icons/partials/fileNames.js @@ -77,7 +77,9 @@ "license.md": "_file_license", "license.md.rendered": "_file_license", "license.txt": "_file_license", + "babel.config.js": "_file_babel", ".babelrc": "_file_babel", + ".babelrc.js": "_file_babel", ".babelrc.json": "_file_babel", ".eslintrc": "_file_eslint", ".eslintignore": "_file_eslint", From 46ff0f2d0f2aecc9200a41ee86235a79da6d83e9 Mon Sep 17 00:00:00 2001 From: Mattia Astorino Date: Fri, 16 Nov 2018 21:24:21 +0100 Subject: [PATCH 06/11] feat: Add mix.lock file icon Close #284 --- src/icons/partials/fileNames.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/icons/partials/fileNames.js b/src/icons/partials/fileNames.js index 315167a..d9b733b 100644 --- a/src/icons/partials/fileNames.js +++ b/src/icons/partials/fileNames.js @@ -125,5 +125,6 @@ ".angular-cli.json": "_file_angular", "directive.ts": "_file_angular-directive", "directive.js": "_file_angular-directive", - "favicon.ico": "_file_favicon" + "favicon.ico": "_file_favicon", + "mix.lock": "_file_elixir-lock" }, From d9ae6d0dca7b86986fdb020685f6a44fa3460213 Mon Sep 17 00:00:00 2001 From: Alessio Occhipinti Date: Fri, 16 Nov 2018 21:25:18 +0100 Subject: [PATCH 07/11] chore: switch reference theme on settings from label to id (#285) --- extensions/helpers/settings.ts | 4 ++-- extensions/interfaces/ipackage.json.ts | 1 + package.json | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/extensions/helpers/settings.ts b/extensions/helpers/settings.ts index 15e4ba8..da1a811 100644 --- a/extensions/helpers/settings.ts +++ b/extensions/helpers/settings.ts @@ -40,11 +40,11 @@ export function isAccent(accentName: string, defaults: IDefaults): boolean { } /** - * Determines if the passing theme label is a material theme + * Determines if the passing theme id is a material theme */ export function isMaterialTheme(themeName: string): boolean { const packageJSON = getPackageJSON(); - return Boolean(packageJSON.contributes.themes.find(contrib => contrib.label === themeName)); + return Boolean(packageJSON.contributes.themes.find(contrib => contrib.id === themeName)); } /** diff --git a/extensions/interfaces/ipackage.json.ts b/extensions/interfaces/ipackage.json.ts index edd732a..0c1b572 100644 --- a/extensions/interfaces/ipackage.json.ts +++ b/extensions/interfaces/ipackage.json.ts @@ -24,6 +24,7 @@ export interface IPackageJSONCommand { } export interface IPackageJSONTheme { + id: string; label: string; path: string; uiTheme: string; diff --git a/package.json b/package.json index cb38e63..913f2ae 100644 --- a/package.json +++ b/package.json @@ -122,51 +122,61 @@ }, "themes": [ { + "id": "eq-material-theme-default", "label": "Material Theme", "path": "./themes/Material-Theme-Default.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-default-high-contrast", "label": "Material Theme High Contrast", "path": "./themes/Material-Theme-Default-High-Contrast.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-darker", "label": "Material Theme Darker", "path": "./themes/Material-Theme-Darker.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-darker-high-contrast", "label": "Material Theme Darker High Contrast", "path": "./themes/Material-Theme-Darker-High-Contrast.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-palenight", "label": "Material Theme Palenight", "path": "./themes/Material-Theme-Palenight.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-palenight-high-contrast", "label": "Material Theme Palenight High Contrast", "path": "./themes/Material-Theme-Palenight-High-Contrast.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-ocean", "label": "Material Theme Ocean", "path": "./themes/Material-Theme-Ocean.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-ocean-high-contrast", "label": "Material Theme Ocean High Contrast", "path": "./themes/Material-Theme-Ocean-High-Contrast.json", "uiTheme": "vs-dark" }, { + "id": "eq-material-theme-lighter", "label": "Material Theme Lighter", "path": "./themes/Material-Theme-Lighter.json", "uiTheme": "vs" }, { + "id": "eq-material-theme-lighter-high-contrast", "label": "Material Theme Lighter High Contrast", "path": "./themes/Material-Theme-Lighter-High-Contrast.json", "uiTheme": "vs" From bdbeee80f81a4e53d6192377b79a10219c5bf5b3 Mon Sep 17 00:00:00 2001 From: Mattia Astorino Date: Mon, 19 Nov 2018 17:55:10 +0100 Subject: [PATCH 08/11] Update README Close #286 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b77b11..500d8d1 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,11 @@ Launch *Quick Open* Paste the following command and press `Enter`: ```shell -ext install vsc-material-theme +ext install material theme ``` +And pick the one by **Mattia Astorino** (me) as author. + #### Packaged VSIX Extension [Download the latest .vsix release](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/Equinusocio/vsextensions/vsc-material-theme/latest/vspackage) file from the marketplace and install it from the command line From 0ac0165f50e6eff87c766589e02b51a9407b8056 Mon Sep 17 00:00:00 2001 From: Mattia Astorino Date: Sat, 24 Nov 2018 15:12:59 +0100 Subject: [PATCH 09/11] chore: Update issue bug template --- .github/ISSUE_TEMPLATE/Bug_report.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 4de26c7..edf7fa9 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -20,16 +20,5 @@ A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - **Additional context** Add any other context about the problem here. From 85238745fe61b588b8b3f8f77d9a38a6531647fd Mon Sep 17 00:00:00 2001 From: Alessio Occhipinti Date: Sun, 25 Nov 2018 15:05:10 +0100 Subject: [PATCH 10/11] fix: "Remove accents" command now will remove custom color conf (#289) --- extensions/commands/accents-setter/consts.ts | 3 + extensions/commands/accents-setter/index.ts | 63 ++++++++----------- .../commands/accents-setter/quick-pick.ts | 9 +++ extensions/commands/index.ts | 1 + extensions/material.theme.config.ts | 7 +-- 5 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 extensions/commands/accents-setter/consts.ts create mode 100644 extensions/commands/accents-setter/quick-pick.ts diff --git a/extensions/commands/accents-setter/consts.ts b/extensions/commands/accents-setter/consts.ts new file mode 100644 index 0000000..ed3b8fc --- /dev/null +++ b/extensions/commands/accents-setter/consts.ts @@ -0,0 +1,3 @@ +export default { + PURGE_KEY: 'Remove accents' +}; diff --git a/extensions/commands/accents-setter/index.ts b/extensions/commands/accents-setter/index.ts index 8f716c2..272f6bd 100644 --- a/extensions/commands/accents-setter/index.ts +++ b/extensions/commands/accents-setter/index.ts @@ -1,29 +1,27 @@ import * as vscode from 'vscode'; -import {updateAccent} from './../../helpers/settings'; import {getDefaultValues, getAccentsProperties} from './../../helpers/fs'; +import consts from './consts'; const REGEXP_HEX: RegExp = /^#([0-9A-F]{6}|[0-9A-F]{8})$/i; /** * Assigns colours */ -const assignColorCustomizations = (colour: string, config: any): void => { +const assignColorCustomizations = (colour: string): Object => { const accentsProperties = getAccentsProperties(); const newColour = isValidColour(colour) ? colour : undefined; - - Object.keys(accentsProperties).forEach(propertyName => { - const accent = accentsProperties[propertyName]; + return Object.keys(accentsProperties).reduce((acc: any, propName) => { + const accent = accentsProperties[propName]; let colorProp = newColour; if (colour && accent.alpha < 100) { colorProp = `${ colour }${ accent.alpha > 10 ? accent.alpha : `0${ accent.alpha }` }`; } - if (accent) { - config[propertyName] = colorProp; - } - }); + acc[propName] = colorProp; + return acc; + }, {}); }; /** @@ -38,43 +36,32 @@ const isValidColour = (colour: string | null | undefined): boolean => const setWorkbenchOptions = (config: any): Thenable => vscode.workspace.getConfiguration().update('workbench.colorCustomizations', config, true) .then(() => true, reason => vscode.window.showErrorMessage(reason)); - /** * VSCode command */ export default async (accent?: string): Promise => { const themeConfigCommon = getDefaultValues(); - const purgeColourKey: string = 'Remove accents'; - const shouldUpdateAccent = Boolean(!accent); - let accentToSelect = accent; - - // If called without accent shows the quick pick dropdown and wait response - if (!accentToSelect) { - const options: string[] = Object.keys(themeConfigCommon.accents).concat(purgeColourKey); - const accentSelected = await vscode.window.showQuickPick(options); - - if (accentSelected === null || accentSelected === undefined) { - return Promise.resolve(null); - } - - accentToSelect = accentSelected; - } - const config: any = vscode.workspace.getConfiguration().get('workbench.colorCustomizations'); - switch (accentToSelect) { - case purgeColourKey: - assignColorCustomizations(undefined, config); - return setWorkbenchOptions(config) - .then(() => updateAccent(undefined)) - .then(() => Promise.resolve(true)); - default: - assignColorCustomizations(themeConfigCommon.accents[accentToSelect], config); - return setWorkbenchOptions(config) - .then(() => - shouldUpdateAccent ? updateAccent(accentToSelect) : Promise.resolve(accentToSelect) - ) + switch (accent) { + case consts.PURGE_KEY: { + const newConfig = { + ...config, + ...assignColorCustomizations(undefined) + }; + + return setWorkbenchOptions(newConfig) .then(() => Promise.resolve(true)); + } + default: { + const newConfig = { + ...config, + ...assignColorCustomizations(themeConfigCommon.accents[accent]) + }; + + return setWorkbenchOptions(newConfig) + .then(() => Boolean(accent)); + } } }; diff --git a/extensions/commands/accents-setter/quick-pick.ts b/extensions/commands/accents-setter/quick-pick.ts new file mode 100644 index 0000000..013c0ff --- /dev/null +++ b/extensions/commands/accents-setter/quick-pick.ts @@ -0,0 +1,9 @@ +import * as vscode from 'vscode'; +import {getDefaultValues} from '../../helpers/fs'; +import consts from './consts'; + +export default async () => { + const themeConfigCommon = getDefaultValues(); + const options: string[] = Object.keys(themeConfigCommon.accents).concat(consts.PURGE_KEY); + return vscode.window.showQuickPick(options); +}; diff --git a/extensions/commands/index.ts b/extensions/commands/index.ts index 2c3543a..79ff089 100644 --- a/extensions/commands/index.ts +++ b/extensions/commands/index.ts @@ -1,3 +1,4 @@ export {default as accentsSetter} from './accents-setter'; +export {default as accentsQuickPick} from './accents-setter/quick-pick'; export {default as fixIcons} from './theme-icons'; export {default as toggleApplyIcons} from './toggle-apply-icons'; diff --git a/extensions/material.theme.config.ts b/extensions/material.theme.config.ts index 24ccd4f..a7568f2 100644 --- a/extensions/material.theme.config.ts +++ b/extensions/material.theme.config.ts @@ -5,13 +5,12 @@ import { } from 'vscode'; import * as ThemeCommands from './commands'; -import {setCustomSetting} from './helpers/settings'; +import {setCustomSetting, updateAccent} from './helpers/settings'; import {onChangeConfiguration} from './helpers/configuration-change'; import {changelogMessage, installationMessage} from './helpers/messages'; import checkInstallation from './helpers/check-installation'; import writeChangelog from './helpers/write-changelog'; import {ReleaseNotesWebview} from './webviews/ReleaseNotes'; -import handleAutoapply from './helpers/handle-autoapply'; export async function activate(context: ExtensionContext) { const config = Workspace.getConfiguration(); @@ -42,8 +41,8 @@ export async function activate(context: ExtensionContext) { // Registering commands Commands.registerCommand('materialTheme.setAccent', async () => { - const wasSet = await ThemeCommands.accentsSetter(); - handleAutoapply(wasSet); + const accentPicked = await ThemeCommands.accentsQuickPick(); + await updateAccent(accentPicked); }); Commands.registerCommand('materialTheme.fixIcons', () => ThemeCommands.fixIcons()); Commands.registerCommand('materialTheme.toggleApplyIcons', () => ThemeCommands.toggleApplyIcons()); From 13a640fa2098a1db315e0d5d66d1cdfe1d4109af Mon Sep 17 00:00:00 2001 From: Mattia Astorino Date: Sun, 25 Nov 2018 15:17:20 +0100 Subject: [PATCH 11/11] feat: Add now icon to now.json files Close #288 --- src/icons/partials/fileNames.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/icons/partials/fileNames.js b/src/icons/partials/fileNames.js index 3488218..e0ef431 100644 --- a/src/icons/partials/fileNames.js +++ b/src/icons/partials/fileNames.js @@ -128,5 +128,6 @@ "directive.ts": "_file_angular-directive", "directive.js": "_file_angular-directive", "favicon.ico": "_file_favicon", - "mix.lock": "_file_elixir-lock" + "mix.lock": "_file_elixir-lock", + "now.json": "_file_now" },