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

Test folder / directory names in file associations #143636

Closed
2 tasks done
aeschli opened this issue Feb 22, 2022 · 4 comments
Closed
2 tasks done

Test folder / directory names in file associations #143636

aeschli opened this issue Feb 22, 2022 · 4 comments

Comments

@aeschli
Copy link
Contributor

aeschli commented Feb 22, 2022

Refs: #136656

Complexity: 3

Create Issue


In file icon themes, the associations in folderNames, folderNamesExpanded, fileNames and fileExtensions can now also contain a folder name:

  "fileNames": {
    "system/win.ini": "_win_ini_file"
  },

system/win.ini means that the association matches files called win.ini directly in a folder system

  "fileExtensions": {
    "system/ini": "_ini_file"
  },

system/ini means that the association matches files called *.ini directly in a folder system

  "folderNames": {
    ".vscode/extensions": "_vscode_folder"
  },

Test this by creating a file icon theme and trying various rules

  "contributes": {
    "iconThemes": [
      {
        "id": "vs-seti-plus",
        "label": "Seti Plus",
        "path": "./icons/vs-seti-icon-theme.json"
      }
    ]
  }
  • Add new rules in vs-seti-icon-theme.json

To test:

  • folder/name is stronger than just name
  • folder/extension is stronger that extension, but loses to name
@aeschli aeschli added this to the February 2022 milestone Feb 22, 2022
@hediet hediet removed their assignment Feb 23, 2022
@hediet
Copy link
Member

hediet commented Feb 23, 2022

Nice work on the feature!
It is cool that the theme.json file supports hot reload!

@IanMatthewHuff
Copy link
Member

Awesome this seems really helpful. Handled everything that I tossed at it, though @aeschli I did have two quick questions. I initially expected that I might be able to specify multiple folders like FolderA\FolderB\filename this doesn't work, but looking at the test plan I believe that this is expected to only be a single folder, so I didn't file an issue here. For kicks I also tried with ~ as a folder for my home directory. This also didn't work, but might be expected.

  • fileNames + folder
  • fileExtensions + folder
  • folderNames + folder
  • folderNamesExpanded + folder
  • folder/name beats name
  • folder/extension beats extension loses to name
  • multiple folders deep (on rereading the item not expected to work?)
  • ~ folder
  • Odd folder names (special characters ect...)

@IanMatthewHuff IanMatthewHuff removed their assignment Feb 23, 2022
@aeschli
Copy link
Contributor Author

aeschli commented Feb 24, 2022

@hediet @IanMatthewHuff Thanks for testing.

Yes, it's only one folder, the direct parent. That fit well with the current implementation. More sophisticated associations like glob pattern would require a rewrite.

@ghost
Copy link

ghost commented Feb 26, 2022

I did mention . as alias for workspace root dir. I think it might require a different CSS selector in the implementation.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants