Skip to content

Named port completion omits compatible signals with parameterized widths #138

@FukangZ

Description

@FukangZ

Summary

Completion inside a named port connection does not suggest compatible in-scope signals when the port and candidate signals use parameterized packed widths such as [WIDTH-1:0].

This affects a common RTL workflow: connecting reusable parameterized modules by named ports.

Environment

  • OS: Windows
  • VS Code version: 1.120.0
  • Vizsla extension version: 0.1.4

Minimal Reproduction

Create a workspace with these files:

completion-parameterized-width/
  .vscode/
    settings.json
  vizsla.toml
  top.sv

.vscode/settings.json:

{
  "editor.wordBasedSuggestions": "off",
  "editor.snippetSuggestions": "none"
}

vizsla.toml:

#:schema https://pascal-lab.github.io/vizsla/schemas/v1/vizsla.schema.json

top_modules = ["top"]

sources = [
  "top.sv",
]

top.sv:

module leaf #(
  parameter int WIDTH = 8
) (
  input  logic             clk,
  input  logic [WIDTH-1:0] data_i,
  output logic [WIDTH-1:0] data_o
);
endmodule

module top;
  localparam int WIDTH = 8;

  logic clk;
  logic [WIDTH-1:0] data_i;
  logic [WIDTH-1:0] data_o;

  leaf #(
    .WIDTH(WIDTH)
  ) u_leaf (
    .clk(),
    .data_i(),
    .data_o()
  );
endmodule

Reproduction Steps

  1. Open the completion-parameterized-width/ directory in VS Code.
  2. Wait until Vizsla is ready.
  3. Open top.sv.
  4. Put the cursor inside the empty .data_i() connection:
.data_i()
  1. Trigger completion with Ctrl+Space.
  2. Repeat inside .data_o().
  3. As a control case, trigger completion inside .clk().

Expected

Inside .data_i() and .data_o(), Vizsla should suggest compatible in-scope signals:

data_i
data_o

Both candidate signals and target ports use the same parameterized packed width:

logic [WIDTH-1:0] data_i;
logic [WIDTH-1:0] data_o;

Actual

No variable candidates are shown inside .data_i() or .data_o().

The .clk() control case can still produce a suggestion for clk, so completion itself is active. The issue appears specific to signals whose type width depends on a parameter or localparam.

Metadata

Metadata

Assignees

No one assigned

    Labels

    known-limitThis is a known limit and may be implemented in future.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions