SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Pretty Printer

Last post 04-10-2009 4:58 AM by Chamini. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 03-15-2009 5:40 PM

    Pretty Printer

     Hello,

     

    Can someone tell me exactly what it is ?

     

    Thx, 

     

  • 03-15-2009 5:59 PM In reply to

    Re: Pretty Printer

     The part of NRefactory that generates source code from the abstract source tree is called 'pretty printer' (the OutputVisitor and OutputFormatter classes). It is currently only used in the 'Extract Method' refactoring and when converting code between C#<->VB; but eventually we want to have a 'reformat code' option on top of it.

  • 03-23-2009 8:47 AM In reply to

    Re: Pretty Printer

    Hi..

     I'm really interested on the idea of Pretty Printer for GSoC 2009. While studying the source under src\Libraries\NRefactory, I felt I need more clarity on the idea. Is PrettyPrinter only meant for formatting the source code? Is ultimate objective of the PrettyPrinter project is giving very declarative interface to SD user for reformatting code? Also, I didnt find a mentor assigned for project. If there is anyone, I will be glad to have his/her guidance.

    Thanks in advance..

  • 03-24-2009 1:12 AM In reply to

    Re: Pretty Printer

    Hi,

    the pretty printer project means giving the user more options how code generated by SharpDevelop looks like (when refactorings touch code), and should also provide a "format code" command that reformats the current document according to the user's settings.

    The main work will be in these aspects:

    1. Create a user interface for the available formatting options. Please do not use XML Forms like existing SharpDevelop option panels - simply create a Windows Forms or WPF user control.

    2. Improve NRefactory output options (e.g. maximum line length).

    3. Improve preserving the position of comments. At least in the most common cases, should "stay in position" (currently NRefactory will move comments onto their own line).
  • 03-28-2009 12:28 AM In reply to

    Re: Pretty Printer

    Hi,

    Thanx a lot for the previous reply.

    I'm studying the code while referring to SharpDevelop Architecture Documents and NRefactory articals from web. It will be a great help for me if you can guide me in the following areas regarding PrettyPrinter.

    -          Where should reformat option reside? I mean, shall we give it a Menu option (like ‘Format’ under SD’s Edit menu) and a position in right click popup menu which will prompt a little form for Reformating..? Also, I hope it’ll be assigned a keyboard short cut.

    -          May I list some of options that will be available in the reformat form that I’ve counted in my research up to now,

    1.      Code to reformat: (user will chose one of three option below)

    o        File ‘PATH/Example/example.cs’

    o        All files in directory ‘PATH/Example’

    o        Selected text

    2.      Comments:

    o        Should stay in position

    o        Move accordingly

    3.      Maximum line length:

    Please correct me, in any case.

    Thanx in advance.. :) 

  • 03-28-2009 1:22 AM In reply to

    Re: Pretty Printer

     Actually, the formatting options should be part of Tools>Options. There are already some rudimentary options unter "Coding>Code Generation". This can be expanded a lot. All kinds of braces placing options, spacing issues; a preview of how code is going to look like with the selected options...

    These options should not only be used for the new "Reformat code" command, but also for existing commands that generate code (refactorings, maybe automatically reformat new files added to the project?).

    Take a look at the PrettyPrintOptions class in NRefactory to get an overview of the options already supported. "Maximum line length" was just an example of an additional option.

    Yes, the command should be a menu option (Edit>Format would be fitting), and should get a shortcut.

     

    About NRefactory:

    Basically, NRefactory is just a Abstract Source Tree (AST) for C# and VB, with input (code parsing) and output (code generation).
    The output part should be pretty easy to understand - though you'll first have to know the visitor pattern.
    The input part requires understanding of parsers (lexical analysis, LL(1)-parsing).
    The AST classes themselves just represent language constructs. Read the C# / VB language specifications to see all the constructs and their syntax.

     

  • 03-31-2009 10:21 AM In reply to

    Re: Pretty Printer

    Hi,

    I plan to make the reformatting options available using a visitor interface(say IPretteyPrintOptionsVisitor) where the PrettyPrintOptions class will be modified for reformatting options to accomplish the reusability of reformatting options. I have included as that in the gsoc application.Please correct me in any case.

    Normal 0 false false false EN-US X-NONE TA

    Also, plz let me know if I should discuss the application content in the forum, before posting to google.

    Thanx in  advance

  • 04-09-2009 9:24 PM In reply to

    Re: Pretty Printer

    Hi,

    I have been reading on technotes provided with SD before starting coding. These days I'm researching how to write an extention for SharpDevelop,whether my project should be a modificetion of existing pretty printer or a new AddIn.

    I tried to subscribe to developement mailing list by following the link given below. But, my subscription was rejected with the reason "No reason mentioned" although there wasn't any place to metion the reason for joining.
     https://lists.sourceforge.net/lists/listinfo/sharpdevelop-contributors

    If it is not restricted for us to get the subscription, please help me to get that because I'm keen to sharpen my knowledge on #develop development activities.

    Thanx in advance..

  • 04-09-2009 10:31 PM In reply to

    Re: Pretty Printer

     We require new contributors to sign a JCA (joint copyright assignment) before contributing to SharpDevelop.

    See http://wiki.sharpdevelop.net/JoiningTheTeam.ashx

    Though I don't know why the list cannot even be read by the public. But there's not much traffic on that list anyways - excluding the automatic mails on build errors, only 30 mails this year.

    There used to be a public SharpDevelop mailing list, but that got replaced by the forums.

  • 04-10-2009 4:58 AM In reply to

    Re: Pretty Printer

    Hi,

     Thank you very much for the guidance. 

     After reading the e-mail for all #develop gsoc applicans, I thought of attaching my CV. It is available in my web site

    http://sites.google.com/site/chaminihasangacse/

    or u can directly sownlowad it from the following link,

    http://sites.google.com/site/chaminihasangacse/Home/CV_Chamini.pdf?attredirects=0

    Cheers..

Page 1 of 1 (10 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.