Skip to content

Autocomplete does not work correctly with bracketed identifiers containing spaces and dots #1200

Description

@WesleyDieterich

Bug Description

Autocomplete does not work correctly when using bracketed identifiers containing spaces and dots in a Microsoft Fabric Warehouse connection.

For example, in my Gold Warehouse, I have a table called NotasVendas with a column named:

[Cód. Estabelecimento]

When typing the column name without brackets, the current behavior is fine. For example, typing Cód correctly suggests [Cód. Estabelecimento].

The issue occurs when I explicitly use brackets. In this case, autocomplete stops working when typing spaces or dots inside the brackets. Additionally, selecting an autocomplete suggestion can result in duplicated brackets.

Repro steps

  1. Connect to a Microsoft Fabric Warehouse containing a column with spaces and/or dots in its name, such as [Cód. Estabelecimento].
  2. Open a SQL query against the Warehouse.
  3. Start typing the column name without brackets, for example Cód, and observe that autocomplete correctly suggests [Cód. Estabelecimento].
  4. Start typing the same column using brackets, for example [Cód.
  5. Type the . or a space while continuing to type the column name.
  6. Observe that autocomplete suggestions disappear.
  7. Alternatively, select the autocomplete suggestion while already inside the brackets.
  8. Observe that DBCode produces [[Cód. Estabelecimento]] instead of [Cód. Estabelecimento].

Expected Behavior

When the user has already started a bracketed identifier, autocomplete should continue working normally, including when the identifier contains spaces and dots.

For example, after typing:

[Cód

autocomplete should still be able to suggest:

[Cód. Estabelecimento]

Selecting the suggestion should produce exactly:

[Cód. Estabelecimento]

without adding an additional pair of brackets.

The behavior outside brackets can remain unchanged. The main expectation is that autocomplete recognizes the context of a bracketed identifier and handles spaces, dots, and the existing brackets correctly.

Actual Behavior

When typing a column name without brackets, autocomplete initially works correctly, but typing a . or space causes the suggestions to disappear.

When using brackets, autocomplete also stops working when typing . or spaces. If an autocomplete suggestion is selected while the opening bracket has already been typed, DBCode adds another pair of brackets, resulting in:

[[Cód. Estabelecimento]]

instead of:

[Cód. Estabelecimento]

Environment

  • DBCode version: 1.36.9
  • VS Code (or fork) version: 1.132.0
  • OS: Windows 11
  • Database: Microsoft Fabric Warehouse
  • Connection: Direct

Error Meesages (if applicable)

No error message is displayed.

Screenshots

DBCode:
Image

Fabric Warehouse Editor:
Image

Logs

If available, paste relevant logs from the Output panel (View > Output > DBCode).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions