facebook

JavaScript Formatter not applying rules in MyEclipse 2017 CI7

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #531056 Reply

    Thomas Legault
    Participant

    The JavaScript formatter doesn’t apply the rules properly since I upgraded to 2017 CS. I am now running CI7 see config details attached.

    Applying the uploaded formatter rules to the JS snippet below in Eclipse Mars/Neon results in the original code staying the same.

    Here is the original code:

    function FieldSet( caption )
    {
    	this.TableLayout( );
    }
    
    copyPrototype(FieldSet, TableLayout);
    
    FieldSet.prototype.createHTMLContainer = function( )
    {
    	return fieldSet;
    }

    Here is the formatted code. Note that it
    1) Took out spaces after opening ( and before closing ) of arguments
    2) It has removed new line before { of second function definition added to a prototype.
    3) Took out the space between the method call with () no arguments
    4) Took out the space between the function arguments with () no arguments

    function FieldSet(caption)
    {
    	this.TableLayout();
    }
    
    copyPrototype(FieldSet, TableLayout);
    
    FieldSet.prototype.createHTMLContainer = function() {
    	return fieldSet;
    }

    i.e. here is the same formatted code with the mistakes identified

    function FieldSet([1]caption[1])
    {
    	this.TableLayout([3]);
    }
    
    copyPrototype(FieldSet, TableLayout);
    
    FieldSet.prototype.createHTMLContainer = function([4]) [2]{
    	return fieldSet;
    }
    Attachments:
    You must be logged in to view attached files.
    #531063 Reply

    Thomas Legault
    Participant

    Re-attaching the formatter xml that can be imported in eclipse as a text file as the original XMl file was rejected for security reasons.

    Attachments:
    You must be logged in to view attached files.
    #531198 Reply

    support-swapna
    Moderator

    Thomas,

    Sorry that you are seeing this issue. Thank you for the details. With the code snippet you shared I see the formatter does not work if I select the code block and format. The formatter works if I do a Ctrl+A on the JS file and then format.

    While we investigate further, can you please give us some more details?

    1. Can you please clarify how you are formatting the code? Are you selecting the code block and invoking Ctrl+Shift+F?

    2. Can you please check if selecting all the contents of the JS file in the editor using Ctrl+A and then invoking Format works?

    3. Please share with us the .log file located at workspace dir/.metadata/.log for further investigation. Also share with us the version details of your previous MyEclipse installation.

    Apologies for inconvenience caused.

    –Swapna
    MyEclipse Support

    #531200 Reply

    Thomas Legault
    Participant

    Hello,

    1. I just hit Ctrl+Shift+F. I also have the formatting to be automatically applied when the file is saved.

    2. I tried the CTRL-A and the formatting is still incorrect.

    3. The log file is attached (myeclipse-2017.log). I closed MyEclipse, deleted the log file, opened myeclipse, formatted a JS file and saved it to produce a clean log. Config from MyEclipse 2015 is attached.

    Attachments:
    You must be logged in to view attached files.
    #531309 Reply

    support-swapna
    Moderator

    Thomas,

    Thank you for the details and the log file. We could replicate the problem with formatting at our end.
    I have filed a bug for the dev team to work on it. We will keep you posted when the fix is out.

    Apologies for inconvenience caused. Thank you for reporting it.

    –Swapna
    MyEclipse Support

    #535204 Reply

    Thomas Legault
    Participant

    Hello Swapna,

    Can I get a bug # to track this issue? Do you know when it will be fixed?

    Thanks
    Thomas

    #535260 Reply

    Brian Fernandes
    Moderator

    Thomas,

    We do not have a public tracker, so unfortunately I cannot provide a link.

    As far as getting a fix is concerned, we are in the end-game stages for the upcoming CI 8 release, so we’re not going to be able to get the fix into this release.

    I will prioritize the investigation and hopefully the fix as well for the CI 9 release, which should be a little over a month away.

    #541820 Reply

    Brian Fernandes
    Moderator

    Thomas,

    On further investigation of this problem – we’ve decided that the best approach would be a “redo” of the JavaScript formatter, to fix this issue and a few others. With the current formatter, it would not be viable to fix this specific issue.

    To be realistic, the earliest time this will happen is in the MyEclipse 2018 stream – as it is a large change to make at the end of the 2017 stream.

    I will let you know when I have further updates for this particular problem, sincerely apologies for this delay and the inconvenience caused.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: JavaScript Formatter not applying rules in MyEclipse 2017 CI7

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