Skip to content

Fix file icon mapping #33855

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

Merged
merged 1 commit into from
Mar 11, 2025
Merged

Conversation

wxiaoguang
Copy link
Contributor

Use the file extension mapping from VSCode's extensions. Otherwise js/ts/vba/... files won't get correct icons.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 11, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 11, 2025
@wxiaoguang wxiaoguang added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Mar 11, 2025
@wxiaoguang wxiaoguang added this to the 1.24.0 milestone Mar 11, 2025
@yardenshoham
Copy link
Member

How do we update tools/generate-svg-vscode-extensions.json?

@wxiaoguang
Copy link
Contributor Author

How do we update tools/generate-svg-vscode-extensions.json?

Manually, it doesn't need to update too much.

@yardenshoham
Copy link
Member

How to do it manually? What are the instructions?

@wxiaoguang
Copy link
Contributor Author

How to do it manually? What are the instructions?

Just follow the file's syntax. If you'd like to keep the original script, here it is:

<?php
$path = '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions';
$dirs = glob("$path/*", GLOB_ONLYDIR);
$res = [];
foreach ($dirs as $dir) {
    $json = json_decode(file_get_contents("$dir/package.json"), true);
    $key = "pkg:" . basename($dir);
    foreach ($json['contributes']['languages'] ?? [] as $lang) {
        foreach ($lang['extensions'] ?? [] as $ext) {
            $res[$key][$lang['id']][] = $ext;
        }
    }
}
echo json_encode($res, JSON_PRETTY_PRINT);

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 11, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 11, 2025
@wxiaoguang wxiaoguang merged commit f61f301 into go-gitea:main Mar 11, 2025
26 checks passed
@wxiaoguang wxiaoguang deleted the fix-fileicon-rule branch March 11, 2025 13:07
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 12, 2025
* giteaofficial/main:
  Fix various Fomantic UI and htmx problems (go-gitea#33851)
  Add workflow_job webhook (go-gitea#33694)
  Fix file icon mapping (go-gitea#33855)
  Drop fomantic build (go-gitea#33845)
  Fix auto concurrency cancellation skips commit status updates (go-gitea#33764)
  Fix test code (go-gitea#33829)
  Remove "noscript" tag from html head (go-gitea#33846)
  Fix material icon & diff highlight (go-gitea#33844)
  Fix LFS URL (go-gitea#33840)
  Add material icons for file list (go-gitea#33837)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants