[Gambas-devel] PrettyPrinter for use in IDE
Charlie
karl.reinl at ...16...
Tue Sep 21 19:56:00 CEST 2004
ron schrieb:
>On Sunday 19 September 2004 21:57, Charlie Reinl wrote:
>
>
>>Salut,
>>
>>I send you the PrettyPrinter, included into the IDE, for that I had to change
>>FEditor.form and *.class.
>>
>>These files comme with the code.
>>
>>If you like to have a go, please, don't do it in your
>> ../gambas-0.99/app/gambas make a copy from that directory
>>
>>Then merge the changes by copiing PPinstall/app/gambas/* to your test-IDE
>>
>>You find the PrettyPrinter in the Contextmenu of the IDE-Editor.
>>
>>You should NOT work on real projects, try it with copys of your projects
>>first. OR on your copy of the IDE.
>>
>>Attention: the PrettyPrinter in the Editor menu is not managed, so you can
>> change you sourcecode during debugging !!!!
>>
>>Aamicalement
>>Charlie
>>
>>
>>
>
>I did and I'm happy :)
>Good work Charlie, how survive your keyboard and fingers?
>I'll keep it in the editor for further usage/testing.
>
>Some notes:
>
>1)
>The DIM in a procedure code blocks.
>If I check only 'Indent every..' the DIM's are aligned indented.
>If I check 'Align in Dim (...)' it is not done anymore.
>'Align in Dim' must checked for the global part to get it table like,
>but then the DIM is not indent anymore in the proc's.
>
OK I see,have to fix it.
>
>2)
>Delete empty lines is nice but keep at least 1 line on top of the procedure.
>In the editor you can see it easy by the small line but not on paper.
>
Yeah, Benoît talked also about, but I thought the blue line is good. (
working on white Background)
And I'v never printed gambas-sourcecode
OK
>
>3)
>After 'Indent All' the are blank lines add to the end of the file.
>Maybe strip all blank lines at the end, but leave 1 line.
>As room for the paste code during cut/past operations.
>
>
Yes i know, I had the problem in the C-variant.
They are not added, I just shift the lines up ( 2 counters , 1 for the
line to read , 1 for the line to write to)
But I think that will be the lst job I do , just before finish it.
>
>4)
>May be try to separate the options for the global section end the procedure blocks.
>
I think that should be an Option, no. (Sorry do you have a name for this?)
>
>5)
>I belive 'Adjust All' and 'Adjust Proc' are better, it's a taste.
>label 'Indenting Options' may be better 'Adjusting options.
>The Adjust instead Indent is because not everything is indented
>but more reformat in position in/out-denting :)
>
You talk about PrettyPrinter Settings. The Buttons etc ?
>
>6)
>One tip for 'Deleting empty lines', I like to keep after a 'END??' a blank line.
>Rule: if instr(line,"end") and instr(nextline,"end")=false then add/keep blank line.
>The third IF statement block.
>This solves also the the separation between procedures.
>
>
You mean , in case if there is not, add one ?
>Example for the point 6.
>
>PRIVATE SUB DoIt(sFile AS String)
>DIM sLine AS String
>DIM bWriteLine AS Boolean
>
> IF today = 12 THEN today = 13
>
> IF chkEmpty.value AND Trim(sLine) <> "" THEN ' comment
> sLine = RTrim$(sLine)
> bWriteLine = TRUE
> ENDIF
>
>' SUB / Function END
> IF Upper$(Trim(sLine)) = Upper$("END") THEN
> IF chkLineSep THEN
> sLine = sLine & CONST_LINE
> bWriteLine = TRUE
> ENDIF
> END IF
>
>' Select Case
> SELECT CASE i
> CASE 1
> MsgBox "1"
> ' can you solve here to a blank line. ?
> CASE 2
> IF x = 3 THEN Message.Info("2")
> Message.Info("3")
> Message.Info("4")
>
> DEFAULT
> Message.Info("Arg...")
>
> END SELECT
>
> WITH i
> i = i
> END WITH
>
>END
>
>
>
Amicalement
Charlie
More information about the Devel
mailing list