fix(editor): restore custom snippet trigger matching

This commit is contained in:
zipg authored and GitHub committed 2026-07-30 00:08:04 +08:00
1 parent 682b9d53c5
commit 87ef514188
5 files changed
+80 -2

No files matched your search

@@ -50,6 +50,18 @@ describe("buildSnippetItems", () => {
expect(items[0].apply).toBe("SELECT *\nFROM my_table;");
});
it("keeps a distinct trigger available to CodeMirror filtering", () => {
const items = buildSnippetItemsForTest("ssf", [{ id: "custom", label: "SELECT *", prefix: "ssf", body: "SELECT * FROM" }]);
expect(items).toEqual([
expect.objectContaining({
label: "SELECT *",
filterText: "ssf",
type: "snippet",
}),
]);
});
it("uses CodeMirror placeholders for the built-in select snippet", () => {
const items = buildSnippetItemsForTest("sel", [BUILTIN_SELECT]);