[squeak-dev] The Trunk: ShoutCore-ct.88.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Nov 25 15:47:42 UTC 2021


Marcel Taeumel uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-ct.88.mcz

==================== Summary ====================

Name: ShoutCore-ct.88
Author: ct
Time: 2 November 2021, 2:19:23.507566 pm
UUID: 0945b74c-2a5d-204a-8da8-84c6af50f872
Ancestors: ShoutCore-mt.85

Forwards orphane preference #syntaxHighlightingAsYouType to 'TextStyler defaultFor: #Smalltalk'.

Note that not all places in the system use the TextStyler abstraction until now. I'm preparing a changeset that fixes this.

=============== Diff against ShoutCore-mt.85 ===============

Item was changed:
  SHTextStyler subclass: #SHTextStylerST80
  	instanceVariableNames: 'classOrMetaClass workspace font parser formatAssignments environment sourceMap processedSourceMap pixelHeight attributesByPixelHeight parseAMethod context'
+ 	classVariableNames: 'SyntaxHighlightingAsYouTypeAnsiAssignment SyntaxHighlightingAsYouTypeLeftArrowAssignment TextAttributesByPixelHeight'
- 	classVariableNames: 'SyntaxHighlightingAsYouType SyntaxHighlightingAsYouTypeAnsiAssignment SyntaxHighlightingAsYouTypeLeftArrowAssignment TextAttributesByPixelHeight'
  	poolDictionaries: ''
  	category: 'ShoutCore-Styling'!
  
  !SHTextStylerST80 commentStamp: 'tween 8/27/2004 10:55' prior: 0!
  I style Smalltalk methods and expressions.
  
  My 'styleTable' class instance var holds an array ofArrays which control how each token is styled/coloured. See my defaultStyleTable class method for its structure.
  My styleTable can be changed by either modifying the defaultStyleTable class method and then executing SHTextStylerST80 initialize ; or by giving me a new styleTable through my #styleTable: class method.
  
  My 'textAttributesByPixelSize' class instance var contains a dictionary of dictionaries.
  	The key is a pixelSize and the value a Dictionary from token type Symbol to TextAttribute array.
  	It is created/maintained automatically.
  	
  I also install these 3 preferences when my class initialize method is executed....
  	#syntaxHighlightingAsYouType  - controls whether methods are styled in browsers
  	#syntaxHighlightingAsYouTypeAnsiAssignment - controls whether assignments are formatted to be :=
  	#syntaxHighlightingAsYouTypeLeftArrowAssignment - controls whether assignments are formatted to be _
  
  I reimplement #unstyledTextFrom: so that TextActions are preserved in the unstyled text 
  	
  	
  	
  	
  	 
  	
  !

Item was changed:
  ----- Method: SHTextStylerST80 class>>syntaxHighlightingAsYouType (in category 'preferences') -----
  syntaxHighlightingAsYouType
  	<preference: 'syntaxHighlightingAsYouType'
  		category: 'browsing'
  		description: 'Enable, or disable, Shout - Syntax Highlighting As You Type. When enabled, code in Browsers and Workspaces is styled to reveal its syntactic structure. When the code is changed (by typing some characters, for example), the styling is changed so that it remains in sync with the modified code.'
  		type: #Boolean>
+ 
+ 	^ (TextStyler defaultFor: #Smalltalk) = self!
- 	^SyntaxHighlightingAsYouType ifNil: [true]!

Item was changed:
  ----- Method: SHTextStylerST80 class>>syntaxHighlightingAsYouType: (in category 'preferences') -----
  syntaxHighlightingAsYouType: aBoolean
+ 
+ 	self syntaxHighlightingAsYouType = aBoolean ifTrue: [^ self].
+ 	
+ 	TextStyler
+ 		default: (aBoolean ifTrue: [self] ifFalse: [nil])
+ 		for: #Smalltalk.!
- 	SyntaxHighlightingAsYouType := aBoolean.!



More information about the Squeak-dev mailing list