# HG changeset patch # User Claus Gittinger # Date 1527246813 -7200 # Node ID c2cc33ee6ffbb204c014a68c9eee827fce96e145 # Parent bcb334ba0734c2fdbb0517489bbe3bdc0ee5585f #FEATURE by cg class: GroovySourceHighlighter added: #formatFileContents:elementsInto:using: changed: #format: class: GroovySourceHighlighter class added: #formatFileContents:elementsInto: diff -r bcb334ba0734 -r c2cc33ee6ffb tools/GroovySourceHighlighter.st --- a/tools/GroovySourceHighlighter.st Fri May 18 04:23:04 2018 +0200 +++ b/tools/GroovySourceHighlighter.st Fri May 25 13:13:33 2018 +0200 @@ -122,6 +122,12 @@ "Created: / 04-08-2011 / 23:43:40 / Jan Vrany " ! +formatFileContents:code elementsInto:elements + ^ self new formatFileContents:code elementsInto:elements using: UserPreferences current + + "Created: / 25-05-2018 / 12:53:07 / Claus Gittinger" +! + formatMethod:source in:class ^self formatMethod: nil source: source in: class using: UserPreferences current @@ -210,6 +216,16 @@ "Created: / 04-08-2011 / 23:43:40 / Jan Vrany " ! +formatFileContents:source elementsInto:elements using:prefs + preferences := prefs. + preferences isNil ifTrue:[ + preferences := UserPreferences current. + ]. + ^ self format: source + + "Created: / 25-05-2018 / 12:54:17 / Claus Gittinger" +! + formatMethod:mth source:source in:class using: prefs preferences := prefs. preferences isNil ifTrue:[ @@ -280,11 +296,13 @@ lastPosition0 := scanner tokenStartPosition. ]. ] on: Error do:[:ex| + Transcript showCR:'GroovyHighlighter: ',ex description ]. ^ sourceText "Created: / 02-10-2013 / 14:40:20 / Jan Vrany " "Modified: / 03-10-2013 / 20:27:53 / Jan Vrany " + "Modified: / 25-05-2018 / 12:54:42 / Claus Gittinger" ! ! !GroovySourceHighlighter methodsFor:'queries'!