Skip to content

Commit 3a81f1c

Browse files
committed
fix: add VERSION to builtin function completion
1 parent c84d913 commit 3a81f1c

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

pgcli/packages/pgliterals/pgliterals.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@
439439
"TRUNC",
440440
"UNNEST",
441441
"UPPER",
442+
"VERSION",
442443
"WIDTH",
443444
"WIDTH_BUCKET",
444445
"XMLAGG"

tests/test_naive_completion.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ def test_function_name_completion(completer, complete_event):
4949
])
5050

5151

52+
def test_version_function_name_completion(completer, complete_event):
53+
text = "SELECT VE"
54+
position = len(text)
55+
result = completions_to_set(completer.get_completions(Document(text=text, cursor_position=position), complete_event))
56+
assert result == completions_to_set([Completion(text="VERSION", start_position=-2)])
57+
58+
5259
def test_column_name_completion(completer, complete_event):
5360
text = "SELECT FROM users"
5461
position = len("SELECT ")

tests/test_smart_completion_public_schema_only.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def test_builtin_function_name_completion(completer):
160160
])
161161

162162

163+
@parametrize("completer", completers())
164+
def test_builtin_version_function_completion(completer):
165+
result = get_result(completer, "SELECT VE")
166+
assert completions_to_set(result) == completions_to_set([function("VERSION", -2)])
167+
168+
163169
@parametrize("completer", completers())
164170
def test_builtin_function_matches_only_at_start(completer):
165171
text = "SELECT IN"

0 commit comments

Comments
 (0)