Browse class from playground raises a DNU

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Browse class from playground raises a DNU

Stephane Ducasse-3
Hi

I'm the only one to experience a isVariable DNU when typing a class
name and pressing command B in playground?

Example

PointCURSORHERE


[node isVariable] whileFalse: [
(node := node parent) ifNil: fallbackBlock ].


in findClassFromAST
"Try to make a class name out of the current text selection"

| node fallbackBlock className |
"Preserve original behavior - although could consider building AST
from selection"
self hasSelection ifTrue: [
^(self selection string copyWithoutAll: CharacterSet crlf) trimBoth ].
fallbackBlock := [^nil].

node := self bestNodeInTextAreaOnError: fallbackBlock.
[node isVariable] whileFalse: [
(node := node parent) ifNil: fallbackBlock ].
className := node name.
[ className first isUppercase ] whileFalse: [
(className := className allButFirst) ifEmpty: fallbackBlock  ].
^className