• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - Skill
  3. How can I perform auto format Cadence Skill, such as indent...

Stats

  • Replies 7
  • Subscribers 18
  • Views 6769
  • Members are here 0
More Content

How can I perform auto format Cadence Skill, such as indent, align...

Zest
Zest over 6 years ago

The official tools 'SKILL IDE' do not have this feature.

Sometimes my 1st edtion skill source code's format looks like a mess and it will take me a long time to do the code format work like indent,align ...

So my question :

Is there any plugins OR ways to do auto format Cadence Skill source code?

THX!

  • Cancel
  • Sign in to reply
Parents
  • B Bruekers
    B Bruekers over 6 years ago

    First start with a good text editor which can handle indentation and folding correctly.  The issue is that the SKILL dialect of LISP is a not very well known language, so a specific language file for SKILL are rare.

    Some time ago I've switched from NP++ to sublime, it makes a big difference in configuring and using it for coding. You can code your SKILL language file in such way that you can even x-ref functions, so jumping to the definition and see where it is used throughout the project. 

    Further, if you pp() (pretty print) your function then you will always get a 'default' format. However you will lose all your comments and in most cases the pp() result also makes it less readable.

    Assume that you've defined a test() procedure. Just use pp(test) to pretty print this function.  If you pass a port as 2nd variable to pp() then you can print it to an file outport.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Zest
    Zest over 6 years ago in reply to B Bruekers

    Hi Bruekers

    Append a further question.Is there anyway I can stream out pp() log to a temp file, then use this temp file to overwrite my 1st ugly-format skill source code?

    by doing this, I can automatically refresh my skill code format.

    ex:

    load(MyPreocedure.il)

    pp(MyPreocedure) > TEMP.txt

    sh("cp  MyPreocedure.il MyPreocedure.bk.il -f")

    sh("mv TEMP.txt  MyPreocedure.il -f")

    the phrase

    'pp(MyPreocedure) > TEMP.txt'  does not work for now   :(

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Zest
    Zest over 6 years ago in reply to B Bruekers

    Hi Bruekers

    Append a further question.Is there anyway I can stream out pp() log to a temp file, then use this temp file to overwrite my 1st ugly-format skill source code?

    by doing this, I can automatically refresh my skill code format.

    ex:

    load(MyPreocedure.il)

    pp(MyPreocedure) > TEMP.txt

    sh("cp  MyPreocedure.il MyPreocedure.bk.il -f")

    sh("mv TEMP.txt  MyPreocedure.il -f")

    the phrase

    'pp(MyPreocedure) > TEMP.txt'  does not work for now   :(

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • B Bruekers
    B Bruekers over 6 years ago in reply to Zest

    This should work:

    load(MyPreocedure.il)
    when(p = outfile("./TEMP.txt")
        pp(MyPreocedure p)
        close(p)
    )
    sh("cp  MyPreocedure.il MyPreocedure.bk.il -f")
    sh("mv TEMP.txt  MyPreocedure.il -f")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Zest
    Zest over 6 years ago in reply to B Bruekers

     pp(MyPreocedure p) stream out the string "MyPreocedure" to port p, instead of the actual procedure name which MyPreocedure point to,

    I tried using pp(stringToSymbol(name_procedure) p)

    but it still does not work

    Thank you again for your kindness reply :)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information