修复了i18n提示中找不到当前组件的i18n信息的bug,为提示列表提供了更加友好的顺序显示
This commit is contained in:
parent
00fa81c3d4
commit
7daa599355
|
|
@ -109,13 +109,14 @@ const oakLocalesProvider = vscode.languages.registerCompletionItemProvider(
|
|||
prefix
|
||||
);
|
||||
|
||||
return localeItems.map((item) => {
|
||||
return localeItems.map((item, index) => {
|
||||
const completionItem = new vscode.CompletionItem(
|
||||
item.label,
|
||||
vscode.CompletionItemKind.Text
|
||||
);
|
||||
completionItem.detail = item.desc;
|
||||
completionItem.insertText = item.value;
|
||||
completionItem.sortText = index.toString();
|
||||
return completionItem;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -262,12 +262,14 @@ const getCachedComponentItems = (path: string): LocaleItem[] => {
|
|||
* @returns 返回一个LocaleItem数组
|
||||
*/
|
||||
export const getLocalesData = (
|
||||
path: string,
|
||||
rawPath: string,
|
||||
prefix: string = '',
|
||||
force?: boolean
|
||||
): LocaleItem[] => {
|
||||
setLoadingLocale(true);
|
||||
|
||||
const path = normalizePath(rawPath);
|
||||
|
||||
if (force) {
|
||||
updatePathCached(path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue