fix: correct CAST completion signature
This commit is contained in:
parent
49bb28ecf0
commit
8ac0038ad7
|
|
@ -786,7 +786,7 @@ const SQL_FUNCTION_SIGNATURES = new Map<string, string[]>([
|
|||
["COALESCE", ["value", "...values"]],
|
||||
["IFNULL", ["expression", "fallback"]],
|
||||
["NULLIF", ["expression1", "expression2"]],
|
||||
["CAST", ["expression", "type"]],
|
||||
["CAST", ["expression AS type"]],
|
||||
["CONVERT", ["expression", "type"]],
|
||||
["GREATEST", ["...values"]],
|
||||
["LEAST", ["...values"]],
|
||||
|
|
|
|||
|
|
@ -974,6 +974,18 @@ test("returns function signature help inside function arguments", () => {
|
|||
});
|
||||
});
|
||||
|
||||
test("returns cast signature with AS syntax", () => {
|
||||
const sql = "select cast(created_at ";
|
||||
const signature = getSqlFunctionSignatureHelp(sql, sql.length);
|
||||
|
||||
assert.deepEqual(signature, {
|
||||
name: "CAST",
|
||||
signature: "CAST(expression AS type)",
|
||||
activeParameter: 0,
|
||||
parameters: ["expression AS type"],
|
||||
});
|
||||
});
|
||||
|
||||
test("returns null signature help outside function calls", () => {
|
||||
assert.equal(getSqlFunctionSignatureHelp("select created_at from users", "select created_at".length), null);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue