-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[circt-verilog-lsp] Add inlay hints support for Verilog LSP server #8303
base: dev/hidetou/lsp-features/vscode
Are you sure you want to change the base?
[circt-verilog-lsp] Add inlay hints support for Verilog LSP server #8303
Conversation
This commit adds inlay hint support to the Verilog LSP server. It currently supports two ways of displaying inlay hints: 1. Built-in inlay hints for function calls and module instantiations, showing port types and directions (in/out/inout). 2. User-provided inlay hints through a custom LSP extension method "verilog/putUserProvidedInlayHints", allowing clients to add contextual information to Verilog symbols. The implementation includes: - Protocol extensions for user-provided inlay hints - Visitor pattern for traversing the AST to find hint locations - Support for refreshing hints when they are updated
@@ -521,14 +652,20 @@ struct VerilogIndexer : slang::ast::ASTVisitor<VerilogIndexer, true, true> { | |||
isDefinition); | |||
} | |||
|
|||
// Handle references to the left-hand side of a parent assignment. | |||
void visit(const slang::ast::LValueReferenceExpression &expr) { | |||
// Handle named values, such as references to declared variables. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change must be moved to #8280.
"text":"module test(); wire foo; reg bar; endmodule" | ||
}}} | ||
// ----- | ||
// Find definition of `out` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Find definition of `out` |
@@ -241,7 +274,7 @@ export class CIRCTContext implements vscode.Disposable { | |||
}; | |||
|
|||
// Configure file patterns relative to the workspace folder. | |||
let filePattern: vscode.GlobPattern = "**/*." + languageName; | |||
let filePattern: vscode.GlobPattern = "**/*.(sv|v)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be moved to vscode PR
This commit adds inlay hint support to the Verilog LSP server. It currently supports two ways of displaying inlay hints:
Built-in inlay hints for function calls and module instantiations, showing port types and directions (in/out/inout).
User-provided inlay hints through a custom LSP extension method "verilog/putUserProvidedInlayHints", allowing clients to add contextual information to Verilog symbols.
The implementation includes: