HTD / NST

New Source Tree Komodo Addon
32 stars 20 forks source link

Specific string breaking NST list #57

Open felixkk opened 6 years ago

felixkk commented 6 years ago

I know this plugin is dead, and I wonder if someone will read this one day, but still :

I noticed the method list was incomplete in one of my file : I got only the 3 first methodes and then nothing.

I deleted line by line to find the cause, and it seems to be this line :

$dir = glob($dir.'/*ZZPFORM');

And more exactly these two combined characters : */

Deleting "/*", I got all my methods back in the list.

So there is probably a problem with the parser...

felixkk commented 6 years ago

I may have found an impressive fix :

Just added "# */" after that line.

Looks like NST thinks that my string is the start of a comment... It should check first if this comment is not placed inside a string !

HTD commented 6 years ago

Please kindly issue a pull request, I will accept ASAP.

felixkk commented 6 years ago

Unfortunatly, this is not a fix for the plugin code itself, but a comment that needs to be placed at the end of problematic lines in class files.

I'm not skilled enough in regex and js to make a proper patch. I looked at NST.js and found some code related to comments in the parse function, but it looks like only python is concerned.

HTD commented 6 years ago

I'm afraid I can't help then, because regular expression were a completely crazy way to that. This code is unmaintainable for several reasons, one is new sane parser (lexer) is needed, then - Komodo has probably changed a lot since I last checked so it probably wouldn't even work with the current version so I would have no way of testing this without making it compatible first.

Of course, it would be fun to do, but unfortunately no time in near future for that. Maybe some day. Talking about python, maybe the next version will be entirely in python, since I got allergic to JS :) If it's possible, IDK if Komodo UI API can be handled with python alone.