diff --git a/package.json b/package.json index 15629fd..0cea722 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ti18n", "displayName": "Ti18n", "description": "一个国际化字段提示插件,对国际化配置文件中提供的国际化字段进行特殊标注,鼠标移入时,可查看对应的国际化语言。", - "version": "0.1.0", + "version": "0.1.1", "author": "https://github.com/showlotus", "publisher": "showlotus", "license": "MIT", diff --git a/src/utils/index.ts b/src/utils/index.ts index 3a48967..077382b 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -33,17 +33,19 @@ export async function openDocumentRevealTokenRange(params: CommandTokenParams) { */ export async function getConfigJSON(folderPath: string) { const configDirs = getConfiguration('configDirs') - console.log(configDirs) - const res = await Promise.all( - configDirs.map(async dir => { - return await fg.glob([`**/${dir}/*.json`], { - cwd: folderPath, - ignore: ['**/node_modules/**'], - absolute: true, - }) - }), + if (!configDirs.length) { + return [] + } + + const res = await fg.glob( + configDirs.map(dir => `**/${dir}/*.json`), + { + cwd: folderPath, + ignore: ['**/node_modules/**'], + absolute: true, + }, ) - return res.flat() + return res } /**