-
Notifications
You must be signed in to change notification settings - Fork 33.3k
[icon-themes] Support glob keys in file icon associations #174286
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
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
Can you explain what css classes you generate? |
Done in PR description |
While we are here:
|
Sorry, can you give examples how this works (maybe a table covering the various cases, prefix, suffix,
Give some example of resources in the explorer and how the class names match. The tricky part is that file name matches are always stronger than file extension matches and stronger than fold name matches. |
This comment was marked as outdated.
This comment was marked as outdated.
Now ready for review |
Made some small tweaks in my work lunch, but please feel free to review now @aeschli |
ok, now I understand. So The problem is to make sure the matching order holds: 'full file match' beats 'file match with pattern' beats 'file extension match' beats 'file extension with pattern' beats language beats folder name beats folder name with How this is implemented is the number of classes matching IMO we're at a dead end with CSS class name matching. I'm reluctant in adding even more class names. |
NB: I wanted to add an extra level of depth in generating |
Refs: [#issuecomment-1429874059](github.com/microsoft/pull/174286#issuecomment-1429874059)
This comment was marked as outdated.
This comment was marked as outdated.
344562d
to
6cf396e
Compare
Looking forward to this PR merging! |
@zm-cttae Thanks for all the work. I didn't realize the ripples we get from adding I think its best to tackle that first, in a separate PR. |
I take it the signature is, then will be |
Hi! Thanks for all the work done so far. |
Closes #12493.
Background
The feature request is for glob support in the key of icon mappings for file icon themes
This PR allows multiple use cases - see table:
*
Makefile
,Dockerfile
Jenkinsfile.*
Jenkinsfile.prod
test_*.py
test_component.py
*_test.go
component_test.go
*Test.cs
CalculatorTest.cs
.env.*
.env.development
web.*.config
web.prod.config
webpack.*.config.js
webpack.dev.config.js
*.webpack.config.js
shared.dev.webpack.config.js
.env.*.*
.env.development.docker.example.env
*.md
pop goes ...................................... the weasel.md
Specification
File icon theme keys are separated by the last dot into
basename
andext
.The
basename
segment allows any number of.
characters.Both segments can be globbed like so:
*
accepts any value.prefix*
.*suffix
.*middle*
.prefix*suffix
Implementation
File/folder icon association keys that can be augmented by globs:
folderNames
,folderNamesExpanded
,fileNames
Any
*
in the key of the file/folder icon mapping:basename
and/orextname
attr values in the file icon themeThis PR introduces extraAttributes option to icon label APIs. These attributes are anchors that the CSS from the file icon theme side can target. This is necessary to prevent a FOUC after opening any collapsed folder or any text document, caused by file icon themes running 100s of globs per each file label.
EDIT:
EDIT 2:
EDIT 3: