Skip to content

Cross-database autocomplete breaks after typing the first character #1238

Description

@xqdd

Environment

  • DBCode: 1.38.5
  • Database: MySQL
  • VS Code Remote Development
  • Database metadata has already been loaded/introspected

Problem

Autocomplete works correctly for tables in the current active database, but cross-database autocomplete does not.

For example, assuming database_a is the current active database:

SELECT *
FROM task

Table autocomplete works normally.

Cross-database autocomplete initially also shows the table list:

SELECT *
FROM database_b.

After typing ., all tables from database_b are shown correctly.

However, as soon as I type the first character of the table name:

SELECT *
FROM database_b.t

the table suggestions disappear completely.

This only happens when referencing another database. Autocomplete for the current active database works normally.

Steps to reproduce

  1. Connect to a MySQL instance containing multiple databases.
  2. Set database_a as the active database.
  3. Make sure metadata for database_b has already been loaded.
  4. Type:
SELECT *
FROM database_b.
  1. The table list appears correctly.
  2. Type one character of a table name:
SELECT *
FROM database_b.t
  1. All table suggestions disappear.

For comparison:

SELECT *
FROM ta

when using the active database continues to autocomplete normally.

Expected behavior

Cross-database autocomplete should continue filtering the existing table list after typing a prefix.

For example:

database_b.

shows:

task
task_log
tenant
user
...

Then:

database_b.t

should show something like:

task
task_log
tenant

instead of returning no suggestions.

Notes

DBCode 1.38.2 changelog mentions a fix for:

schema-qualified autocomplete dropping the table list after you start typing the table name

However, this issue is still reproducible for cross-database MySQL autocomplete in DBCode 1.38.5.

It may be specific to cross-database resolution rather than normal autocomplete.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions