mozilla :: #komodo

7 Aug 2017
16:03Kronuzmorning
16:03lagboxmorning
16:04Kronuzhey, when someone with deep knowledge of codeintel comes around, could you let me know please?
16:05KronuzI found a bug in python's tree evaluator, but I'm not sure is that relevant for python in particular, but for ECMAScript is making a big difference
16:05* lagbox slowly backs away
16:06Kronuz:P
17:48nathanrwhat's the bug?
19:05Kronuzhi nathanr
19:07Kronuzthe problem is in tree_python
19:09Kronuz_hit_from_first_part
19:10Kronuznathanr, there is a loop there where it tries to find the first token starting in the given scope
19:10Kronuzit checks if the elem's name is the same as the first token inside the loop (`if first_token == elem.get("name"):`)
19:10Kronuzand if so, it returns (elem, scoperef) with one consumed token
19:13Kronuzit's all fine there... until that check happens to find an element with that name *after* going to a parent scope
19:14nathanrok, and how did this affect ECMAScript?
19:14Kronuzin that case it returns the wrong scope, something like a hit of this form: ((<variable &#39;sep&#39;>, (<blob &#39;x&#39;, [&#39;sep&#39;])), 1)
19:14Kronuz(notice the scoperef has &#39;sep&#39; and returns the element &#39;sep&#39;)
19:14Kronuzthat&#39;s because it doesn&#39;t get the parent scope before returning it
19:15Kronuzwhat&#39;s more
19:15KronuzI don&#39;t think that check is necessary *inside* the loop
19:16Kronuzso the if can be moved out of the loop, as it probably should only checked once (to see if the token requested is the element itself)
19:17Kronuznathanr, something like: https://github.com/Kronuz/KomodoEdit/blob/master/src/codeintel/lib/codeintel2/tree_python.py#L505
19:17nathanrhmm
19:17Kronuzbecause in the loop it&#39;ll check both inside names and imports
19:18nathanrI&#39;d need to read through the code to wrap my head around this properly, would you mind opening a bug for it?
19:18Kronuzyes, I will as soon as I get some time
19:20nathanrappreciate it
19:21nathanrlet me know when your ECMAScript scanner hits the shelves, I&#39;ll be sure to reference it in our discussions on if and how to open source codeintel v3
19:31Kronuzsure :)
19:32Kronuzit&#39;s working better and better now
19:32Kronuz(even python code intelligence had a few issues I&#39;m finding along the way)
20:11nathanrheh, good thing you&#39;re not referencing javascript
20:11nathanrthere&#39;d be more than a few
8 Aug 2017
No messages
   
Last message: 13 days and 23 hours ago