Repro
- Connect to a Postgres DB that has tables outside the
public schema (e.g. an app.users table).
- In a SQL tab type:
SELECT * FROM app
- Observe: autocomplete lists
app.users, app.products, etc. ✓
- Type
.
- Observe: all suggestions disappear. The list collapses to empty.
Expected
After typing app., the autocomplete should narrow to app.users, app.products, etc. — the schema-qualified tables under the app schema. (Or alternatively, drop the app. prefix and show users, products — both are reasonable.)
What's actually happening
src/components/editor/QueryEditor.tsx lines 738-754 (the completion provider) DO extend the range back across the dot when computing the replacement range, so the provider returns the full app.users-style labels with range covering app.. That part is correct.
The breakdown looks like Monaco's default fuzzy matcher: when the cursor is right after a ., Monaco appears to apply member-access semantics — it expects each suggestion to have a label representing the member (e.g. users), not the full path (app.users). Labels that contain a . early in the string get filtered out.
This is consistent with how Monaco treats . in other language modes (TS, JS) where obj. shows methods/properties of obj, with bare property names as labels.
Suggested fix sketch
Two approaches, either works:
-
Detect the schema-prefix context and return bare labels with a smaller range. In the provider, if the char preceding startColumn is ., extract the schema name to the left, filter items.tables to only entries starting with <schema>., and return them with the table name only as the label and the range covering only the text after the dot.
-
Override Monaco's filter. Set filterText explicitly on each suggestion to a value Monaco's fuzzy matcher will accept after a dot. Less clean.
Approach #1 matches how DataGrip and DBeaver handle this and is the more user-friendly behaviour.
Scope
Pre-existing bug. Not introduced by today's PRs (#22, #23, #25). Discovered while smoke-testing PR #22's schema cache reset on disconnect — the data path is correct (schema items load with app.users-style entries), the rendering filter is what breaks.
Workaround
Type the full table name without the schema prefix (SELECT * FROM users) — autocomplete suggests app.users and resolves correctly once selected. Or type app.users manually without relying on completion.
Repro
publicschema (e.g. anapp.userstable).SELECT * FROM appapp.users,app.products, etc. ✓.Expected
After typing
app., the autocomplete should narrow toapp.users,app.products, etc. — the schema-qualified tables under theappschema. (Or alternatively, drop theapp.prefix and showusers,products— both are reasonable.)What's actually happening
src/components/editor/QueryEditor.tsxlines 738-754 (the completion provider) DO extend the range back across the dot when computing the replacement range, so the provider returns the fullapp.users-style labels with range coveringapp.. That part is correct.The breakdown looks like Monaco's default fuzzy matcher: when the cursor is right after a
., Monaco appears to apply member-access semantics — it expects each suggestion to have a label representing the member (e.g.users), not the full path (app.users). Labels that contain a.early in the string get filtered out.This is consistent with how Monaco treats
.in other language modes (TS, JS) whereobj.shows methods/properties ofobj, with bare property names as labels.Suggested fix sketch
Two approaches, either works:
Detect the schema-prefix context and return bare labels with a smaller range. In the provider, if the char preceding
startColumnis., extract the schema name to the left, filteritems.tablesto only entries starting with<schema>., and return them with the table name only as the label and the range covering only the text after the dot.Override Monaco's filter. Set
filterTextexplicitly on each suggestion to a value Monaco's fuzzy matcher will accept after a dot. Less clean.Approach #1 matches how DataGrip and DBeaver handle this and is the more user-friendly behaviour.
Scope
Pre-existing bug. Not introduced by today's PRs (#22, #23, #25). Discovered while smoke-testing PR #22's schema cache reset on disconnect — the data path is correct (schema items load with
app.users-style entries), the rendering filter is what breaks.Workaround
Type the full table name without the schema prefix (
SELECT * FROM users) — autocomplete suggestsapp.usersand resolves correctly once selected. Or typeapp.usersmanually without relying on completion.