Skip to content

Conversation

@ya-uhs
Copy link

@ya-uhs ya-uhs commented Jan 18, 2026

Summary

Add LSP inlay hint support to display port direction (input/output/inout) and type information for named port connections in module instantiations.

Example

For code like:

module child(input clk, input [7:0] data, output valid);
endmodule

module top;
  child inst (
    .clk(sys_clk),
    .data(bus_data),
    .valid(is_valid)
  );
endmodule

The editor will display hints like:

012722

Changes

  • Add inlay-hint.cc and inlay-hint.h implementing GenerateInlayHints()
  • Register textDocument/inlayHint handler in verilog-language-server.cc
  • Add inlayHintProvider capability
  • Add tests for inlay hint functionality

Testing

  • Added 3 test cases in verilog-language-server_test.cc:
    • InlayHintEmptyWhenModuleNotFound - returns empty when module not in symbol table
    • InlayHintEmptyForSimpleModule - returns empty when no instantiations
    • InlayHintWithModuleDefinition - returns hints with correct direction info

All existing tests pass.

- Introduced `inlay-hint` library for generating inlay hints for port connections.
- Updated `VerilogLanguageServer` to handle inlay hint requests.
- Added tests for inlay hint functionality to ensure correct behavior.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 18, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

ya-uhs and others added 3 commits January 26, 2026 00:10
- Remove unused includes: str_cat.h, verilog-nonterminals.h
- Add missing includes: <utility>, syntax-tree-search.h, line-column-map.h

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant