7ute / symbols-list

An alternate symbol list sidebar for Atom.io text editor
GNU General Public License v3.0
32 stars 24 forks source link

Long lists problem #60

Open dimitrik-fr opened 7 years ago

dimitrik-fr commented 7 years ago

Seems like when symbol lists become very long, they are no more shown correctly.. - e.g. you may see function names only, but no more other tags (or other tags, but not functions) -- is it a known issue ?

Rgds, -Dimitri

mbuc82 commented 7 years ago

Hello @dimitrik-fr ,

thanks a lot for this report. As far as i know, this behavior is not know. Do you have any screenshots or testfiles we can use for debugging?

Thanks in advance!

Regards Marco

dimitrik-fr commented 7 years ago

Hi Marco,

so far, I'll try to provide you a test case -- this is from an auto-generated LUA file containing a list of functions + some "fixme" comments.

here is how looking a file with 50 functions:

screenshot

and now the same, but with 100 functions:

screenshot

as you can see, the "fixme" tags are no more here in the second case..

how to reproduce: I think you can observe it with any big file, but in case I'm doing something wrong, I'll present here exactly the steps I'm doing ;-))

first of all, I've added into your "symbols-list/lib/symbols-list-regex.coffee" file the regex info for LUA:

    lua:
        regex:
            function: /^(?:local|[^\n\S])*function +([\w]+)/gmi
            todo: /(?:\/\*|--\s)[ ]*todo\:[ ]*(.+?)[ ]*(?:\*\/)?(?:[\r\n])/gmi
            fixme: /(?:\/\*|--\s)[ ]*fixme\:[ ]*(.+?)[ ]*(?:\*\/)?(?:[\r\n])/gmi
            hack: /(?:\/\*|--\s)[ ]*hack\:[ ]*(.+?)[ ]*(?:\*\/)?(?:[\r\n])/gmi

then, here are 2 test LUA files (one with 50 functions, and another with 100 functions) - I changed extension from .lua to .txt to let github upload the files correctly:

don't know if this will help, but if in the list of regex patterns I'll place the "fixme" line before "function", all will work as expected (as amount of "fixme" in the file lower than "function") - so looks like some internal overflow somewhere..

hope the test case will help to get it fixed ;-))

Rgds, -Dimitri

dimitrik-fr commented 6 years ago

Any chances to get it fixed ? -- the issue is really annoying making periodically whole list of functions (or other symbols) disappearing..

Rgds, -Dimitri

dimitrik-fr commented 6 years ago

So, far, as the problem still remains in the latest release as well, I decided to dig it myself in the source code and seems like I've found THE reason why such is happening..

in your function "recursiveScanRegex" you're using the "recursive_time_limit = 500.0" which seems to limit the time of overall execution for this function.. -- which is fine when you're editing small files with few functions / tags / etc.. -- but as soon as the file is big and having many elements, such a hardcode timeout is finishing by giving completely random results : on every file save you could see some names to disappear from the list, then re-appear again on the next file save, and so on..

changing 500.0 to 5000.0 "fixing" the issue (all names are present).

But I'd say, it will be much more better to propose this "time limit value" as a config option to:
1) make people aware about
2) let them to decide themselves on how long they wish to wait..

Rgds, -Dimitri