@lvce-editor/quick-pick-worker 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1779,7 +1779,7 @@ const requestFileIcons = async requests => {
1779
1779
 
1780
1780
  const toDirent = pick => {
1781
1781
  const dirent = {
1782
- name: pick.label,
1782
+ name: pick.iconName || pick.label,
1783
1783
  path: pick.uri,
1784
1784
  type: pick.direntType
1785
1785
  };
@@ -2865,19 +2865,32 @@ const getPicks$8 = async () => {
2865
2865
  }];
2866
2866
  };
2867
2867
 
2868
+ const getIconName = language => {
2869
+ const fileName = language.fileNames?.find(value => typeof value === 'string');
2870
+ if (fileName) {
2871
+ return fileName;
2872
+ }
2873
+ const extension = language.extensions?.find(value => typeof value === 'string');
2874
+ if (!extension) {
2875
+ return '';
2876
+ }
2877
+ return `file${extension.startsWith('.') ? extension : `.${extension}`}`;
2878
+ };
2868
2879
  const toProtoVisibleItem$1 = language => {
2880
+ const iconName = getIconName(language);
2869
2881
  const value = {
2870
2882
  languageId: language.id,
2871
2883
  tokenizePath: language.tokenize || ''
2872
2884
  };
2873
2885
  return {
2874
2886
  description: '',
2875
- direntType: 0,
2887
+ direntType: iconName ? File : None$2,
2876
2888
  fileIcon: '',
2877
2889
  icon: '',
2890
+ iconName,
2878
2891
  label: language.id,
2879
2892
  matches: [],
2880
- uri: '',
2893
+ uri: iconName,
2881
2894
  value
2882
2895
  };
2883
2896
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"