facebook

[Closed] annoying behaviour of javascript editor

  1. MyEclipse Archived
  2.  > 
  3. Web 2.0 / AJAX
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #245264 Reply

    rateoty
    Member

    hello,

    if I edit inside a javascript function and type the {
    then the cursor jumps to the name of that function and selects it.
    This is extremly annoying, because one always overwrites the name of the function with the code one wants to type after the opening {.

    Example:

    function doit(){
    var comment=document.getElementById(‘comment’).value;
    if (comment!=null){

    having typed this, doit will be selected.

    regards Jürgen

    eclipse:
    Version: 3.1.1
    Build id: M20050929-0840
    myEclipse:
    Version: 4.1.0
    Build id: 20060122-4.1-GA

    WindowsXP

    #245335 Reply

    Riyad Kalla
    Member

    Moving to Web 2 and investigating

    #245336 Reply

    Riyad Kalla
    Member

    rateoty,
    Can you paste an example file (stand along javascript or html, whatever you were editing) that caused this and also tell me your Javascript editor settings? I just tried this locally and can’t reproduce it.

    #245366 Reply

    rateoty
    Member

    hello,

    this below is a small part of a bigger file. I copied it to a new file and still can reproduce the behaviour in the new file.
    When i remove the ‘}’ after the if(1<2), the showTranserElements will be selected. Same, if I remove the entire function and input it as an empty function. When afterwards I insert the ‘if (1<2){‘ , it will do as I have described.

    Not sure if this is worth mentioning: I’m using a german keybord layout – the ‘{‘ is on the AltGr+7, the ‘}’ on AltGr+0

    regards. Jürgen

    —————————————————————————————————————————————–

    function showTranserElements(){
    if(1<2){}
    }

    function setStyleClass(eId,styleClass){
    var elem;
    try {
    elem = document.getElementById(eId);
    if (elem===null){
    return false;
    }
    if (elem.className){
    elem.className=styleClass;
    return false;
    }
    elem.style.className=styleClass;
    }
    catch (e) {
    return false;//nothing to do if elemet doesn’exist or method isn’t supported
    }
    return false;
    }

    #245383 Reply

    Riyad Kalla
    Member

    Jurgen,
    I cannot reproduce this. Let’s try something here:

    1) File > switch workspace > C:\tempworkspace > hit OK
    2) Create a new Web Project
    3) Create a new javascript file, paste in the code youg ave me above
    4) Go remove the ‘}’ bracket after the if(i<2){ portion of the code, what happens?

    #245394 Reply

    rateoty
    Member

    hello,

    at the first glance, the problem doesn’t occur.
    BUT: another one and apparently connected one, does:
    I pasted the code, deleted the bracket – the error is marked as it should be.
    Then I inserted the bracket again. In a new line I inserted
    var a=
    I saved, then deleted the
    a=
    and whoops the function name is selected again.

    This kind of behaviour I can reproduce in the original setting to.

    So to me it looks like a validation problem.

    regards Jürgen

    #245399 Reply

    Riyad Kalla
    Member

    Hmm I can’t reproduce this either. I tried selecting a= and hitting delete AND pressing backspace to remove the “a=” and neither one caused the function name to be selected, here is my snippet, what am I doing wrong?

    function showTranserElements(){
    if(1<2){
    var a=
    }
    }

    #245738 Reply

    rateoty
    Member

    hi,
    I don’t know, what’s the difference between your and my setting. Sometimes the behaviour will not show, sometimes it does. Strange enough, it differs even with different functions.
    regards Jürgen

    #245964 Reply

    haobaba1
    Member

    @rateoty wrote:

    hello,

    at the first glance, the problem doesn’t occur.
    BUT: another one and apparently connected one, does:
    I pasted the code, deleted the bracket – the error is marked as it should be.
    Then I inserted the bracket again. In a new line I inserted
    var a=
    I saved, then deleted the
    a=
    and whoops the function name is selected again.

    This kind of behaviour I can reproduce in the original setting to.

    So to me it looks like a validation problem.

    regards Jürgen

    I can vouch that this is a real problem, and an extremely annoying one at that. The only reason I never said anything is because I know that don’t want to spend the time reproducing it.

    #246096 Reply

    Riyad Kalla
    Member

    No need guys with Brian’s help we reproduced this internall, we are filing it and looking into it now.

    The workaround is to turn off the alpha-sorting in the outline view (what is happening very quickly is the outline view is changing structure and a select is occuring in that view, which highlights the method in the editor).

    #247785 Reply

    rateoty
    Member

    hello,
    is there a schedule, when a fix will be available? Since some of my scripts are rapidly getting lengthy, without alphabetically sorting them is not very convenient working.

    regards Jürgen

    #247792 Reply

    Riyad Kalla
    Member

    This was fixed in 4.1.1 Jurgen, please upgrade and let us know.

    #248144 Reply

    rateoty
    Member

    hello,

    after upgrading it works like it should. thanks.

    regards Jürgen

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: [Closed] annoying behaviour of javascript editor

You must be logged in to post in the forum log in