[Pharo-dev] Browse class from playground raises a DNU

Stephane Ducasse stepharo.self at gmail.com
Wed Nov 8 15:53:28 EST 2017


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




More information about the Pharo-dev mailing list