Skip to content

Go-to-definition selects typedef class forward declaration instead of real class body in UVM sources #2466

@PuzzyGong

Description

@PuzzyGong

Description

When using verible-verilog-ls inside VS Code with UVM source code, the Go to Definition command often jumps to the forward declaration

typedef class uvm_sequence_base;

inside uvm_pkg.sv, instead of the actual class … endclass definition located in uvm_sequence_base.svh.

This happens for many UVM types (e.g. uvm_objection, uvm_sequencer, uvm_component, etc.).

Renaming these typedef class uvm_*; lines (for example, to typedef class uvm_rename_*;) immediately makes Go-to-Definition jump to the correct class body, which suggests the language server returns multiple definition locations and VS Code chooses the first one (the typedef).

Steps to Reproduce

  1. Open a UVM workspace in VS Code.
  2. Open any file that references uvm_sequence_base.
  3. Invoke Go to Definition

Actual Result

Cursor jumps to the declaration:

typedef class uvm_sequence_base;

in uvm_pkg.sv

Expected Result

Cursor should jump to the actual class definition:

class uvm_sequence_base extends uvm_sequence_item;
  ...
endclass

in uvm_sequence_base.svh.

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