Tab completion: offer parens as appropriate in CREATE/ALTER TEXT SEARCH.
Jeff Janes, Georgios Kokolatos
Discussion:
@@ -2140,7 +2140,7 @@ psql_completion(const char *text, int start, int end)
else if (Matches("ALTER", "TEXT", "SEARCH", "TEMPLATE|PARSER", MatchAny))
COMPLETE_WITH("RENAME TO", "SET SCHEMA");
else if (Matches("ALTER", "TEXT", "SEARCH", "DICTIONARY", MatchAny))
- COMPLETE_WITH("OWNER TO", "RENAME TO", "SET SCHEMA");
+ COMPLETE_WITH("(", "OWNER TO", "RENAME TO", "SET SCHEMA");
else if (Matches("ALTER", "TEXT", "SEARCH", "CONFIGURATION", MatchAny))
COMPLETE_WITH("ADD MAPPING FOR", "ALTER MAPPING",
"DROP MAPPING FOR",
@@ -2635,7 +2635,7 @@ psql_completion(const char *text, int start, int end)
/* CREATE TEXT SEARCH */
else if (Matches("CREATE", "TEXT", "SEARCH"))
COMPLETE_WITH("CONFIGURATION", "DICTIONARY", "PARSER", "TEMPLATE");
- else if (Matches("CREATE", "TEXT", "SEARCH", "CONFIGURATION", MatchAny))
+ else if (Matches("CREATE", "TEXT", "SEARCH", "CONFIGURATION|DICTIONARY|PARSER|TEMPLATE", MatchAny))
COMPLETE_WITH("(");
/* CREATE SUBSCRIPTION */
