svls icon indicating copy to clipboard operation
svls copied to clipboard

Support "Go to definition" and "Go to declaration"

Open SeanMcLoughlin opened this issue 3 years ago • 3 comments

I see that the goto_definition and goto_declaration methods for the LanguageServer trait are not implemented in the SVLS backend. So "go to definition" and "go to declaration" in the VSCode extension will not work.

Has there been any work on this? I can contribute to this if sv-parser provides enough info to support this feature. I'm reading up on this to see what work would need to be done to implement this. It's probably the one feature preventing me from switching from DVT to VSCode for SystemVerilog development full-time.

SeanMcLoughlin avatar Mar 06 '21 19:03 SeanMcLoughlin

I think something needs to take the AST from sv-parser and convert it into a symbol table. As far as I can tell, this isn't done yet in sv-parser.

The symbol table can hold the locations in each file for each symbol. From there, the symbol table needs to be searched to find matching definitions or declarations.

Not sure if this is something that'd make sense to be in sv-parser, or if it should be in another crate (i.e. sv-symbol-table) that depends on sv-parser.

SeanMcLoughlin avatar Mar 07 '21 00:03 SeanMcLoughlin

I think the symbol table creation should be in another crate because sv-parser is parsing library to provide AST. I want to work on it, but I don't have enough time now.

dalance avatar Mar 07 '21 01:03 dalance

Okay. I'll try to look into adding this crate to sv-parser.

SeanMcLoughlin avatar Mar 08 '21 21:03 SeanMcLoughlin