News for hackers. Stuff that matters.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by statictype on Thursday January 12, 2012 @09:23PM (#3458903)
Seems to me that the ducked-typed nature of Python makes it pretty much impossible to determine this information in a text editor.

    class A(object): def read(): return 'A'

    class B(object): def read(): return 'B'

    def doit(i):
        if i==1: obj = A()
        else: obj = B()
        return obj.read()
When you put your cursor over the .read() in obj.read(), where does it point to?
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by modeless on Friday January 13, 2012 @12:21AM (#3459301)
You're not thinking big enough. Imagine a rewinding debugger that records a complete execution of your program. Then whenever your cursor moves, the debugger could step to a point when that line of code was executing and give you autocomplete suggestions based on the state of the program at that time.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by statictype on Friday January 13, 2012 @01:38AM (#3459466)
Doesn't solve the problem.

The same function can get called a 1000 times and take different paths each time. Which method is your hypothetical rewinding debugger going to show? (Leaving aside the big gaping hole of how your program is executing while you are typing it out).

The problem of deciding which method actually gets called by static analysis in a text editor (and it would have to be static analysis) is literally impossible for dynamic languages - pretty much by definition.

Re:Sublime Text 2 Beta released with Auto-complete and Impro... by modeless on Friday January 13, 2012 @02:04AM (#3459518)
You are far too pessimistic; a few very simple heuristics would work great in most cases. It doesn't have to be perfect. Something imperfect would be miles better than nothing, which is what we have now for dynamic languages.
Re:Sublime Text 2 Beta released with Auto-complete and Impro... by malkomalko on Friday January 13, 2012 @09:36AM (#3460653)
how about just a popup box that lets you choose where you would like to go?

I see this type of situation as something that shouldn't happen very frequently.

Also, you could take this one step further and have it split screen the methods in multiple files if you like.