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

Add support to specify a relative path for custom icons folder path. #1422

Conversation

JimiC
Copy link
Member

@JimiC JimiC commented Jan 14, 2018

References #1416

Changes proposed:

  • Add

This PR adds the functionality to set the vsicons.customIconFolderPath with a relative path to the root of the opening project. This is handy when distributing custom icons with the project source code.

I have also done some code refactoring which normally should have been submitted in another PR but I'm getting lazy lately.

Also, once this PR gets merged the wiki page needs to be updated to include the added ability.

@JimiC JimiC added this to the Next milestone Jan 14, 2018
@JimiC JimiC requested a review from a team January 14, 2018 19:11
@@ -80,6 +80,18 @@ export class IconGenerator implements models.IIconGenerator {
}
}

public getCustomIconFolderPath(folderPath: string): string {
if (!!!folderPath) { return this.settings.vscodeAppData; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One ! should be enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm converting them to boolean.

Copy link
Member

@robertohuertasm robertohuertasm Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, that's why I say you only need one

Copy link
Member Author

@JimiC JimiC Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually one is a null check. Three is a boolean negated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no such thing as a null check in JavaScript. ! is a logical operator and also implies a casting to bool due to the concepts of falsy and truthy. !!! is not idiomatic JavaScript.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@JimiC JimiC Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just my preferred way of coding, explicitly expressing the fact that I'm doing !!(!a).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok but it's not really necessary and thus it's not used in JavaScript. I would prefer to get rid of this if possible as I think we should stick to common practices. 😉

if (!!!folderPath) { return this.settings.vscodeAppData; }

const fPath = folderPath.trim();
if (path.isAbsolute(fPath) || !!!this.settings.workspacePath || !this.settings.workspacePath.length) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same here

@JimiC JimiC force-pushed the support_custom_icon_folder_relative_path branch from 69a047b to 9fced60 Compare January 14, 2018 21:44
@codecov
Copy link

codecov bot commented Jan 14, 2018

Codecov Report

Merging #1422 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1422   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          48      48           
  Lines        2572    2621   +49     
  Branches      130     134    +4     
======================================
+ Hits         2572    2621   +49
Impacted Files Coverage Δ
src/utils/index.ts 100% <ø> (ø) ⬆️
src/utils/vscode-extensions.ts 100% <100%> (ø) ⬆️
test/iconGenerator/functionality.test.ts 100% <100%> (ø) ⬆️
test/settings/settings.test.ts 100% <100%> (ø) ⬆️
src/icon-manifest/iconGenerator.ts 100% <100%> (ø) ⬆️
src/init/projectAutoDetection.ts 100% <100%> (ø) ⬆️
src/settings/settingsManager.ts 100% <100%> (ø) ⬆️
src/icon-manifest/manifestReader.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40d14b6...9fced60. Read the comment docs.

@robertohuertasm robertohuertasm merged commit 7d6a5ed into vscode-icons:master Jan 15, 2018
@JimiC JimiC deleted the support_custom_icon_folder_relative_path branch January 15, 2018 16:27
robertohuertasm pushed a commit that referenced this pull request Feb 26, 2018
* Update vscode icon to new color (blue). (#1288)

* Add `.prettierignore` to prettier icon (#1339)

closes #1338

* Extend Storybook supported extensions. (#1343)

* Add ability to hide folder arrows in explorer. (#1342)

* Translations (#1344)

* New translations package.nls.json (Chinese Simplified)

* New translations lang.en.json (Chinese Simplified)

* New translations package.nls.json (Spanish)

* New translations lang.en.json (Spanish)

* New translations package.nls.json (German)

* New translations lang.en.json (German)

* New translations lang.en.json (Italian)

* New translations package.nls.json (Italian)

* New translations lang.en.json (Russian)

* New translations package.nls.json (Russian)

* New translations lang.en.json (French)

* New translations package.nls.json (French)

* Update README.md: Docs (#1351)

* Next release (#1352)

* preparing 7.18.0

* Make some entries more descriptive.

* latest additions

* version bump

* Adds webpack.prod.conf.js support (#1357)

* New Crowdin translations (#1355)

* New translations package.nls.json (Japanese)

* New translations lang.en.json (Japanese)

* New translations package.nls.json (Japanese)

* New translations package.nls.json (Japanese)

* New translations lang.en.json (Japanese)

* Map `screenshot(s)?` to `image` folder icon (#1362)

* Replace GitHub Emoji of right arrow. (#1360)

It doesn't render in `vscode` marketplace.

* Update Yarn version in CI. (#1359)

* Add wiki page icons list generator as submodule. (#1366)

* Add wiki page icons list generator as submodule.

* Update wpilgenerator.

* Added .stylelintcache (#1369)

* Add examples generator tool as submodule. (#1370)

* support for cargo (#1371)

* Update submodule wpilgenerator. (#1372)

* Add support for pip. (#1373)

* Add support for Cypress. (#1374)

* Add support for Bazel. (#1375)

* Add support for Kivy. (#1376)

* Update submodule wpilgenerator. (#1380)

* Update submodule wpilgenerator. (#1386)

* Update wpilgenerator to v0.1.1. (#1388)

* Add support for Conan. (#1390)

* Add support for Stata. (#1389)

* Update submodule examples-generator (#1387)

* Add new extensions for tsconfig (#1384)

* [Icon Request] tsconfig new extensions #1379

relates to: #1379

* remove trailing

* Add support for more folder names. (#1383)

* Exclude specific folders and files from distribution. (#1382)

* Add script to initialize submodules. (#1393)

* Update dependencies. (#1394)

* Preparing 7.19.0 (#1399)

* preparing next release

* coffee typo

* version bump

* Update wpilgenerator to v0.2.0. (#1401)

* support for jsonc (#1403)

* support for jsonc

* fix duplicated language id

* Improve GitHub templates. (#1381)

* Improve GitHub templates.


Update wpilgenerator to v0.1.1. (#1388)


Add support for Conan. (#1390)


Add support for Stata. (#1389)


Update submodule examples-generator (#1387)


Add new extensions for tsconfig (#1384)

* [Icon Request] tsconfig new extensions #1379

relates to: #1379

* remove trailing

Add support for more folder names. (#1383)


Exclude specific folders and files from distribution. (#1382)


Add script to initialize submodules. (#1393)


Update dependencies. (#1394)


Merge branch 'master' into improve_templates
Move comments to wiki.

* Fix links to wiki pages.

* Fix typo.

* Add support for Jupyter. (#1409)

* Add support for PhraseApp. (#1410)

* Add support for Django. (#1411)

* Add support for NGINX. (#1412)

* add solidarity file type and icon (#1413)

* add solidarity file type and icon

* Apply art guidelines.

* Add proper support for Elixir templates. (#1419)

* Fix PAD icon disabled matcher. (#1421)

* Add support to specify a relative path for custom icons folder path. (#1422)

* Update dependencies. (#1423)

* Fix errors when debugging test cases. (#1424)

* added support for stylable (#1426)

* added support for stylable

* remove light attribute for stylable

* removed stylable file extension definition

* Change icon to comply to art guidelines.

* fixed docker scripts (#1432)

* Use bundler icon for files with .gemfile extension (#1430)

* Add support for rubocop (#1436)

* Add support for rubocop

* Adjust icons to art guidelines.

* Add support for tslint.yaml & tslint.yml (#1438)

* #1434 Support for tsconfig.yaml and tsconfig.yml

* Fixed tslint

* Removed yaml extension for tsconfig

* Add "asm" id to assembly. (#1450)

* Remove "yml" file extension declaration. (#1451)

This file extension is already supported natively from the editor.

* Add support for docker test filename. (#1452)

* Add support for SystemVerilog. (#1453)

* Add support for Verilog. (#1454)

* Fix rejection handling of "findFiles". (#1463)

* Add vscode-icons-js to related (#1464)

* Update dependencies. (#1467)

* README fix link: Customization, not Configuration (#1448)

* README fie link: Customization, not Configuration

* Correcting typo link.

* Fix package managers lock files. (#1468)

* 7.20.0 (#1466)

* 7.20.0

* 1464 added

* Update CHANGELOG.

* version bump

* Typo?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants