eirikpre / VSCode-SystemVerilog

SystemVerilog support in VS Code
MIT License
128 stars 50 forks source link

Limit search scope to package when looking for definitions #70

Closed tovine closed 4 years ago

tovine commented 5 years ago

Example use case:

my_package::MY_PARAMETER

When looking up MY_PARAMETER in this case it will search the entire project for matching parameters, while if I'm looking up my_package it finds it immediately. In this case I'd expect it to first look up my_package and then check if MY_PARAMETER exists within (instead of searching the entire project for a matching MY_PARAMETER).

Not sure if this is hard to implement or if it's already implemented in #68, but this would definitely be a nice feature to have.

A next level of improvement would be to have it search all imported packages if my_package:: is omitted from MY_PARAMETER, but that's probably a little bit harder. 🙂

eirikpre commented 4 years ago

Somewhat solved with 0.9.2 (now released). It will search for the package with Go to symbol in Workspace then use Go to symbol in that file for the symbol name. This should also work for any kind of object in a package as long as Go to symbol picks it up.