Skip to content

Commit

Permalink
Merge c0509ae
Browse files Browse the repository at this point in the history
  • Loading branch information
syrel committed Apr 26, 2021
2 parents 51899ba + c0509ae commit f739f24
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ GtDefineMethodFixItAction >> methodSource [
with: node arguments
do: [ :eachSelectorPart :arg |
stream
nextPutAll: eachSelectorPart value;
nextPutAll: eachSelectorPart selector;
space.
baseName := arg isVariable
ifTrue: [ arg variableName ]
Expand Down
27 changes: 27 additions & 0 deletions src/GToolkit-Pharo-Coder-AddOns/GtPharoZincStyler.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Class {
#name : #GtPharoZincStyler,
#superclass : #GtGenericPharoStyler,
#category : #'GToolkit-Pharo-Coder-AddOns-Zinc'
}

{ #category : #accessing }
GtPharoZincStyler >> visitKeywordMessage: aMessage [
super visitKeywordMessage: aMessage.
(aMessage selector = #'username:password:'
and: [ aMessage arguments last isLiteral and: [
aMessage arguments last isString ] ] ) ifFalse: [ ^ self ].
self
attribute: (BrTextReplacingAttribute new withCharacter: $*)
from: aMessage arguments last startPosition + 1
to: aMessage arguments last stopPosition - 1.
(text
from: aMessage arguments last startPosition + 1
to: aMessage arguments last stopPosition - 1)
onCursorEnter: [ :aTextEditor :anEvent :aFromIndex :aToIndex |
(aTextEditor text from: aFromIndex to: aToIndex)
clearAttributesOfClass: BrTextReplacingAttribute ]
leave: [ :aTextEditor :anEvent :aFromIndex :aToIndex |
(aTextEditor text from: aFromIndex to: aToIndex)
clearAttributesOfClass: BrTextReplacingAttribute;
attribute: (BrTextReplacingAttribute new withCharacter: $*) ]
]
6 changes: 6 additions & 0 deletions src/GToolkit-Pharo-Coder/GtPharoSourceCoder.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -619,3 +619,9 @@ GtPharoSourceCoder >> variableNodeToReferencesFilter: aVariableNode ifFound: aFo

^ aFoundBlock value: (self referencesFilterForLiteral: aVariableName asSymbol)
]

{ #category : #accessing }
GtPharoSourceCoder >> zincAddOnFor: anAST into: coderAddOns [
<gtAstCoderAddOns: 100>
coderAddOns addStyler: GtPharoZincStyler new
]
5 changes: 5 additions & 0 deletions src/GToolkit-Pharo-Parser/GtPharoLiteralNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ GtPharoLiteralNode >> isLiteral [
^ true
]

{ #category : #testing }
GtPharoLiteralNode >> isString [
^ false
]

{ #category : #accessing }
GtPharoLiteralNode >> literalValue [
^ self subclassResponsibility
Expand Down
5 changes: 5 additions & 0 deletions src/GToolkit-Pharo-Parser/GtPharoStringLiteralNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ GtPharoStringLiteralNode >> guessType: completionStrategy [
^ String
]

{ #category : #testing }
GtPharoStringLiteralNode >> isString [
^ true
]

{ #category : #accessing }
GtPharoStringLiteralNode >> literalValue [
| aString |
Expand Down

0 comments on commit f739f24

Please sign in to comment.