bscan / RakuNavigator

Raku language support and language server
MIT License
51 stars 3 forks source link

Parse Symbol Table for Imported Functions #4

Open bscan opened 2 years ago

bscan commented 2 years ago

The Perl Navigator parses the symbol table to find imported functions, and then gets the file and line number from them. I would like to do something similar for Raku, but parsing the symbol table is not finding the results I need. I use nqp to parse and compile code in https://github.com/bscan/RakuNavigator/blob/master/server/src/raku/navigator.raku and then I would like to dump the symbol table. The following snippet works from within a script, but I would like to parse the symbol table from the $compiled code instead. Pull requests are more than welcome.

for ::.kv -> $k, $v {
    if ($k.starts-with('&')) {
         print $k, $v.signature.gist(), $v.file, $v.line;
    }
}