icecoder/ICEcoder

Enhance indexer data & jump to file by filename.

Opened this issue · 0 comments

At present we only index the names of classes and functions, the file they are defined in, the file extension, as well as start (line & ch) to end (line & ch). In the case of functions we also index the params.

This has proven very useful so users can CTRL+right click on a class/function to jump to the file where it's defined, plus also hover over the params to see the values it's looking to accept.

Howevever, it would also be good to index the full list of files, so you can CTRL+right click on a flie name and it will jump to that file too.

Extend the phpGrep function in indexer.php to note the list of file paths too whilst it's indexing the classes and functions as it's going through all dirs already so may as well note them at the same time. It should have the file name as the array key and the value would be an array of the occurances, eg:

`banner-anim.js` => [
    '/var/www/site/public/assets/js'
];

Then when a user CTRL+right clicks on a word, we can consider not only if it's a class/function but also if it's a filename (eg they've clicked on banner-anim.js). If there is just 1 value (in the above case '/var/www/site/public/assets/js it can jump straight to it. If there's more than 1 value it can show it as options under where you've clicked and you can choose the option to jump to.

This leads onto further improvements in #902.