2
This commit is contained in:
1 parent
5ac164b407
commit
f93f6095af
94 files changed
+7877
-4018
No files matched your search
@@ -48,5 +48,22 @@ NoticeDisplay resolveNoticeDisplay(AppLocalizations l10n, NoticeText text) {
|
||||
title: l10n.probeFailedTitle(text.moduleDisplayName),
|
||||
subtitle: subtitle,
|
||||
);
|
||||
case ComponentInstallPhaseText():
|
||||
final title = text.isQueued
|
||||
? l10n.componentQueued(text.componentName)
|
||||
: (text.isUninstall
|
||||
? l10n.uninstallingComponent(text.componentName)
|
||||
: l10n.installingComponent(text.componentName));
|
||||
return NoticeDisplay(title: title, subtitle: text.detail);
|
||||
case ComponentInstallDoneText():
|
||||
final title = text.isUninstall
|
||||
? l10n.uninstallComponentSuccess(text.componentName)
|
||||
: l10n.installComponentSuccess(text.componentName);
|
||||
return NoticeDisplay(title: title);
|
||||
case ComponentInstallFailureText():
|
||||
final title = text.isUninstall
|
||||
? l10n.uninstallComponentFailed(text.error ?? '')
|
||||
: l10n.installComponentFailed(text.error ?? '');
|
||||
return NoticeDisplay(title: title, subtitle: text.error);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:re_editor/re_editor.dart';
|
||||
import 'package:re_highlight/languages/all.dart';
|
||||
import 'package:re_highlight/re_highlight.dart';
|
||||
|
||||
/// 语法高亮辅助类:
|
||||
/// 1. 基于文件后缀与特殊文件名的 O(1) 语法匹配,彻底避免全量遍历
|
||||
@@ -175,4 +176,11 @@ class SyntaxHighlightHelper {
|
||||
}
|
||||
return {langId: mode};
|
||||
}
|
||||
|
||||
/// 获取指定文件对应的 re_highlight 原始 Mode 定义(用于提取语言关键字等)
|
||||
static Mode? getGrammarModeForFile(String? filePath) {
|
||||
final langId = getLanguageId(filePath);
|
||||
if (langId == null) return null;
|
||||
return builtinAllLanguages[langId];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user