CSIDE Import doesn't respect original source importing

I've noticed a quirk with the CSIDE import process. It does odd things with the indents of your Oscript. When you write a new function in a new package, typically it puts your function prototype at tab 1, and (if you're using the code generation widget), the next line is at tab 2, and the end function is at tab 1 again. Now, if you take that ospace and import it on a different CSIDE instance, it will respect the position of the function prototype, but it will push out all your code, adding a second tab (for a total of three tabs), and put your end statement for the function at tab position 2, not 1. The following figure illustrates:

The problem is that if you have developers import from the ospace multiple times, the indentation is cumulative and you end up with the source tabbed over in some cases, almost the entire width of the page over. Thus making the code very difficult to read. I noticed a similar behaviour with script objects. WHen your oscript is interpreted as type Script (code written between script and endscript tags), it indents out even further. If you correct it in your source, the next person who imports will get the extra indents back.

I know everyone should just share the source meaning that you import once to get your environment built then replace the code, but I tend to work with different teams, some of whom still try to work as was done in Builder, where you edit the .OLL file. meaning I almost never get the source of the latest version of the module.
Anyway, not sure if this is a known issue, or if there's a fix for the import, or if the only workaround is to get everyone on board with editing only in the Oscript tab of your Eclipse project (which also lends itself better to source control).
just my observations on the import process in CSIDE.
-Hugh

Comments

  • Hi Hugh - no, I've not seen that before. I've opened a ticket over here ( OIDE-1964 ) to see if I can figure out what's going on. Two questions for you:

    1. what version of CSIDE / Eclipse / Content Server are you using?
    2. does the formatting correct itself in any way if you reformat via ctrl+shift+F ?

    ... I'll update this thread once I get a feeling for what is going on over here. Thanks, Dave

    @siegel: vi is an editor with two modes: one which destroys your input and the other which beeps at you

    1. I'm using the latest version - the CSIDE 16.2.11 release;
    2. This does work for the indenting. In the case of script tags, I have a bunch of scripts that have been imported multiple times and each time adds more lines. That aspect didn't correct itself, but the Ctrl-Shift-F is brilliant. It just cut my reformatting down to 1/10 the time. Where is that documented?

    -Hugh

  • Where is that documented?

    At this point the only "how to use" documentation we have is @ https://knowledge.opentext.com/knowledge/cs.dll/fetch/-15106263/15106294/15106295/16376487/67794710/67790529/cside/index.html . Commands such as this are not included there, as Ctrl-Shift-F is a 'standard' keyboard combo in Eclipse. However adding things such as this would not hurt. As such I've opened a doc task ( OIDE-1965 ) to improve this.

    I'll let you know how both aspects discussed here progress. Thanks, Dave

    @siegel: vi is an editor with two modes: one which destroys your input and the other which beeps at you

  • Hi Dave,

    I ran into this problem as well. Core modules have this problem as well. Here is a screenshot of a new CS 16.2.11. No optional modules. Eclipse 2019-09. CSIDE 16.2.11.

    ctrl+shift+F would fix it most of the time. I found the last "end" statement not fixed in all the times I tried, and more problematic with multiple functions in one script.

  • BTW, I did not import the contentmove module.

  • Dave Carpeneto
    edited March 23, 2020 #7

    K, thanks for the examples. I'll see what can be seen on this over her & will let you know what is seen.

    @RayTsui : can you confirm the steps you took to result in this odd indentation, since you say you don't see this on import? Thx for clarifying :-)

    @siegel: vi is an editor with two modes: one which destroys your input and the other which beeps at you

  • If I had to guess, I'd say that internally OT DEV has imported this module or at least this function a few times, and on each rebuilt, the indent wasn't fixed. In my practice, this often happens to lesser used functions because when you see something that badly formatted, you tend to fix it, if only so you can read it.
    -Hugh