#770 Cursor jumps to method definition when an error is detected

closed-fixed
Editor (491)
9
2009-02-10
2008-08-18
No

Hello,

when I'm typing and an error is somewhere in the document (in a class), the cursor jumps to a method definition & selects it, which by the time I realize it I've written code over the name.

For example, if I'm editing somewhere and then I go change something somewhere else (even a line above), or even if the syntax is ok and I'm in the middle of writing a statement, the error detection kicks in and my cursor jumps to another method definition & selects it an I overwrite it.

This sort of looks like the bug in ticket #1886641, except my outline doesn't get selected but a method's def does. This is really annoying I have to say...

Here's my info:

- System Linux, Ubuntu 8.04
- Eclipse version : 3.2.2
- PyDev version 1.3.18
- PyDev error log :

eclipse.buildId=M20070212-1330
java.version=1.6.0_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86

Error
Mon Aug 18 09:23:02 CEST 2008
Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench.texteditor".

java.lang.NoClassDefFoundError: org/eclipse/ui/texteditor/spelling/SpellingAnnotation
at org.python.pydev.editor.PyReconciler$SpellingProblemCollector.accept(PyReconciler.java:76)
at org.eclipse.jdt.internal.ui.text.spelling.SpellingEngine$SpellEventListener.handle(SpellingEngine.java:64)
at org.eclipse.jdt.internal.ui.text.spelling.engine.DefaultSpellChecker.fireEvent(DefaultSpellChecker.java:276)
at org.eclipse.jdt.internal.ui.text.spelling.engine.DefaultSpellChecker.execute(DefaultSpellChecker.java:251)
at org.eclipse.jdt.internal.ui.text.spelling.TextSpellingEngine.check(TextSpellingEngine.java:43)
at org.eclipse.jdt.internal.ui.text.spelling.SpellingEngine.check(SpellingEngine.java:77)
at org.eclipse.jdt.internal.ui.text.spelling.DefaultSpellingEngine.check(DefaultSpellingEngine.java:70)
at org.eclipse.ui.texteditor.spelling.SpellingService$1.run(SpellingService.java:103)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.texteditor.spelling.SpellingService.check(SpellingService.java:108)
at org.python.pydev.editor.PyReconciler.reconcile(PyReconciler.java:203)
at org.python.pydev.editor.PyReconciler.initialReconcile(PyReconciler.java:157)
at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:103)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:170)

- Eclipse install location : /usr/lib/eclipse/
- Project location where the bug appears : ~/Documents/Code/Python/Arimaz

Thank you!
Gabriel

Discussion

1 2 > >> (Page 1 of 2)
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-08-18

    Logged In: YES
    user_id=617340
    Originator: NO

    Can you check if that happens in 1.3.19 (I believe that problem in the PyReconciler was fixed in 1.3.19 -- although I'm not sure if that was your real problem)

    Also, if it happens, can you paste some code and specific steps so that I can try to reproduce it?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-08-18
    • status: open --> pending
     
  • Gabriel Rossetti

    • status: pending --> open
     
  • Gabriel Rossetti

    Logged In: YES
    user_id=1987766
    Originator: YES

    I just updated, I'll use it for a day or two and tell you if it was fixed or not. Thanks

     
  • john-scott

    john-scott - 2008-08-19

    Logged In: YES
    user_id=2185483
    Originator: NO

    Sorry, I did not notice this duplicate.
    I am in fact running pydev 1.3.19 with Eclipse 3.4.0

    In my case, it is not predictable when it will happen. In my example in my original ticket I showed a simple example from a Django project I'm working on, here is the slightly more fleshed out example:

    class MyModel(models.Model):
    somefield = models.CharField()

    def __unicode__(self):
    return self.somefield

    Now, if I was writing the return line for the first time, I might make it to 'return self.' and once I hit the dot separator, sometimes the autocomplete dialog pops up, sometimes the cursor jumps up to the method name (__unicode__ in this example). It's not consistent so it's hard to trigger manually. When I tried to manually trigger it last night, I had to start typing the 'return self.' line and experiment typing the attribute name, backspacing and starting over again until it would happen. Not convenient, but the only suggestion I have. I could be wrong, but I don't believe this has ever happened in a class definition where the cursor jumps up to the class name. It only seems to happen with methods/functions.

     
  • Gabriel Rossetti

    Logged In: YES
    user_id=1987766
    Originator: YES

    Ok, it happened again so 1.3.19 doesn't fix it. As for sample code, mine has nothing special, just classes and methods and attributes :-). Here's an example of the current code that triggered the error :

    class Example(MyBaseClass):
    def __init__(self):
    pass
    def __privateMethod1(self):
    pass

    def __privateMethod2(self):
    for in in range(4):
    for j in range(4):
    if(i == j):
    print "equal"
    elif(i < j):
    print "smaller"
    else:
    print "bigger"
    print "another inst"
    reactor. <-- this made the cursor jump, when the '.' was entered

    def publicMethod1(self):
    pass

    This example is bogus, it was just to show the class's structure, I get this error though :

    Severity and Description Path Resource Location Creation Time Id
    Encountered "\n" at line 235, column 17. Was expecting one of: "or" ... "and" ... "not" ... "is" ... "in" ... "lambda" ... "if" ... "else" ... "elif" ... "while" ... "for" ... "try" ... "except" ... "def" ... "class" ... "finally" ... "print" ... "pass" ... "break" ... "continue" ... "return" ... "yield" ... "from" ... "del" ... "raise" ... "global" ... "exec" ... "assert" ... "as" ... <NAME> ... Arimaz/src/arimaz/mydeskfriend/services MdfAudioSkinDemoService.py line 234 1219239193531 27225

    john-scott's comments are true for my problem too.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-08-20

    Logged In: YES
    user_id=617340
    Originator: NO

    Just a doubt: if the 'link with editor' is unchecked in the outline, does it still do that?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-08-20
    • status: open --> pending
     
  • john-scott

    john-scott - 2008-08-20

    Logged In: YES
    user_id=2185483
    Originator: NO

    I'll uncheck that option and see how it goes. shouldn't take more than a couple of hours of work before i can say whether this had any effect.

     
  • Gabriel Rossetti

    Logged In: YES
    user_id=1987766
    Originator: YES

    It wasn't enabled/checked on mine, so it's not that

     
  • Gabriel Rossetti

    • status: pending --> open
     
  • ratsberg

    ratsberg - 2008-08-27

    Logged In: YES
    user_id=1779052
    Originator: NO

    I've got this bug with a system quite different from the bug reporters one:

    Pydev 1.3.20
    Eclipse 3.4.0
    Debian Etch/Testing,64Bit
    Sun Java 1.6.0 64Bit

    The bug came up with the update to Pydev 1.3.20; I've never noticed it with 1.3.19 and earlier.
    It appears very insistent sometimes, making work nearly impossible - but it's still not reproduceable. I've tried to swich off something (code completition,typing options) but that did not help.

    (What a strange animal.)

     
  • bryancole

    bryancole - 2008-08-29

    Logged In: YES
    user_id=1328144
    Originator: NO

    This bug is driving me insane!!!

    The cursor locate / selection jumps to whichever item in the Outline view is currently selected. If Link with Editor is on, then this item is always the current 'def', so the cursor selection jumps to this (and I invariably end up typing over my method name...ggrrrrr...). If Link-with-Editor is OFF, then any other item in the Outline may be selected, so the cursor jumps to that.

    If I switch off "Link with Editor" and actively deselect all items from Outline view (using crtl-click) then the problem goes away.

    Unfortunately, the problem is not evident for all .py files. It seems to happen mostly with large files (>1000 loc, in the case of the file I'm currently working on). This makes it difficult to post an example.

    I'm using Fedora8, Java-1.6.0_06, Eclipse-3.4, and the problem has been evident for the last few versions of pydev, from approximately 1.3.16 through to 1.3.20. I also have the latest Mylyn installed.

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-08-29

    Logged In: YES
    user_id=617340
    Originator: NO

    I've tried to reproduce it quite a lot and still haven't been able to do it... I'll actually be out this next week (until September 7th), but I just wanted to say that this bug is currently my top priority...

    Also, I wanted to say that this doesn't seem to happen on Sun JVM 1.5 + Eclipse 3.3.2 (I'm actually changing my environment to Java 1.6 and Eclipse 3.4 to see if I can reproduce it, because it doesn't seem possible with my current config)

    Cheers,

    Fabio

     
  • Gabriel Rossetti

    Logged In: YES
    user_id=1987766
    Originator: YES

    Hi Fabio,

    thanks for looking into this! Try to switch to java 1.6 first, we all have it (well, john-scott I don't know), but our eclipse versions differ (well, only mine does :-)). My version is older than yours and theirs is younger, your's should be fine (unless they changed something in version 3.3.x and undid it in the next release).

    cheers,
    Gabriel

    PS
    I use sun's virtual machine to run eclipse, not GCJ

     
  • Mike Auty

    Mike Auty - 2008-09-09

    I'm also experiencing this, eclipse-3.4.0 (Build id: I20080617-2000), pydev-1.3.20, sun-jdk-1.6.0.07, no mylin. The trigger appears to be on autocompletion, almost always when typing at speed (making it even more frustrating). The first character is written after the dot, then the cursor jumps as if the current outline view item had been double clicked, and all subsequent keypresses start overwriting the function/method/class name (which is automatically selected when the outline view element is double clicked). Does anyone know if this has been reported elsewhere as an upstream eclipse problem (as is, does it affect other plugins, or is just pydev experiencing this)?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-09-12

    Humm... I've been trying to reproduce this bug without success for a while now and it just occurred to me that I'm trying to reproduce that in windows... So, I wanted to ask: is there someone with this bug in windows or are the reports only related to linux?

    And if on Linux, is there some report that's not using the sun-jdk 1.6?

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-09-12
    • priority: 5 --> 9
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-09-15

    Hi... Is there someone that'd be willing to debug Pydev to see that (I've been trying to reproduce it in my machine for some time already without any success -- on windows, linux, java 1.6, java 1.5, eclipse 3.4 and 3.3), so, I think a better approach would be on a machine where that's happening already.

    If someone is up to it, please download the pydev code (there's a guide at http://pydev.sourceforge.net/developers.html ), start eclipse with debugging support (http://pydev.blogspot.com/2007/09/debugging-eclipse.html ), attach a java remote debugger to it and place a breakpoint in:
    org.eclipse.jface.text.TextViewer.setSelectedRange(int, int)

    And try to reproduce the bug and see if it gets there (note that if that's reproduced and doesn't pass through there, I can give more advice on the places for breakpoints), and if it gets, post details on the stack that gets there, variables, etc.

    Note that the eclipse SDK is needed for that (because JDT support is needed for the remote debugging) -- but there'll be 2 instances of Eclipse running, so, one of those can be your current environment, and a separate workspace that actually has the Pydev code (and this one must be the SDK).

     
  • Gabriel Rossetti

    Hello Fabioz,

    I willing but not right at the moment, because I have to get some more RAM first, one instance of eclipse + firefox + virtualbox already causes my system to use up 20% swap, so two instances :-)

    Gabriel

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2008-10-13

    Did the last release stop this bug? -- no comments anymore?

     
  • Gabriel Rossetti

    I'm upgrading now, I'll keep you up to date.

    Gabriel

     
  • Håkan Johansson

    I can confirm that this bug still exist in PyDev 1.3.24.

    OS: Red Hat 4 Linux 64bit
    Java: jre1.6.0_07_x86_64
    Eclipse: 3.4.1

    For me it only happens with very large files.
    The workaround with deselecting everything in the Ouline view works.

     
  • kiilerix

    kiilerix - 2008-11-26

    I see something which I think is this issue.

    The problem comes reguarly when I enable Link with Editor.

    Fedora 10 with
    eclipse-pydev-1.3.24-1.fc10.noarch
    eclipse-platform-3.4.1-5.fc10.i386
    java-1.6.0-openjdk-1.6.0.0-4.b12.fc10.i386

    fabioz: Is the debugging info you requested on 2008-09-15 still relevant?

     
1 2 > >> (Page 1 of 2)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks