fix(ui): localize hardcoded strings

This commit is contained in:
t8y2
2026-05-30 10:01:12 +08:00
parent 8e04889745
commit ed1db7db6b
17 changed files with 383 additions and 153 deletions
-23
View File
@@ -354,7 +354,6 @@ test("suggests DATE_FORMAT as parameter snippet", () => {
const snippet = items.find((item) => item.type === "function" && item.label === "DATE_FORMAT");
assert.ok(snippet);
assert.equal(snippet.detail, "按指定格式格式化日期");
assert.equal(snippet.apply, "DATE_FORMAT(${date}, ${format})");
});
@@ -872,18 +871,6 @@ test("prefix matches still rank above fuzzy matches", () => {
assert.equal(items[0]?.label, "name");
});
// --- Function inline docs ---
test("shows function description in detail", () => {
const items = buildSqlCompletionItems("select cou", "select cou".length, {
tables,
columnsByTable,
});
const countItem = items.find((item) => item.label === "COUNT");
assert.ok(countItem);
assert.equal(countItem.detail, "返回行数");
});
// --- Type-aware comparison hints ---
test("suggests NULL and IS NULL after comparison operator", () => {
@@ -918,16 +905,6 @@ test("shows SELECT * column expansion", () => {
assert.ok(starItem, "should show column expansion for *");
});
test("star expansion item includes column count in detail", () => {
const sql = "select *";
const items = buildSqlCompletionItems(sql, sql.length, {
tables,
columnsByTable,
});
const starItem = items.find((item) => item.label === "* → columns");
assert.ok(starItem?.detail?.includes("列"), "detail should mention column count");
});
// --- History-based ranking ---
test("recordCompletionSelection boosts future ranking", () => {