The Inbox: Tools-jr.966.mcz

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

The Inbox: Tools-jr.966.mcz

commits-2
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.966.mcz

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

Name: Tools-jr.966
Author: jr
Time: 2 May 2020, 12:16:24.578946 am
UUID: eceadafb-7b97-1742-84a2-e714d188a3bb
Ancestors: Tools-mt.965

Avoid inlining of #class for proxies/decorators in Inspector.

The instance variables and indexed variables are accessed by sending a message to the inspected object, which probably passes through any transparent proxies. If the list of variables is just obtained from "object class" (which will not actually send a message to the object), the list will contain the variables of the proxy. Thus, there is a mismatch between the inspector's schema of the object (the fields) and the schema which is queried for values (the schema of the object behind the proxy).

Also send a message to find out the class, so it is aligned with how the values are retrieved.

Also mind this when initializing the styler.

=============== Diff against Tools-mt.965 ===============

Item was changed:
  ----- Method: Inspector>>streamInstanceVariablesOn: (in category 'fields - streaming') -----
  streamInstanceVariablesOn: aStream
 
+ (self object perform: #class "do not inline send of #class, receiver could be a proxy") allInstVarNames doWithIndex: [:name :index |
- self object class allInstVarNames doWithIndex: [:name :index |
  aStream nextPut: ((self newFieldForType: #instVar key: name)
  shouldStyleName: true;
  valueGetter: [:object | object instVarNamed: name];
  valueSetter: [:object :value | object instVarNamed: name put: value];
  yourself)].!

Item was changed:
  ----- Method: Inspector>>updateStyler:requestor: (in category 'user interface - styling') -----
  updateStyler: aStyler requestor: anObject
  "Use this method to update our fieldListStyler and all view stylers."
 
  aStyler
  environment: self environment;
+ classOrMetaClass: (self doItReceiver perform: #class "do not inline send of #class, receiver could be a proxy");
- classOrMetaClass: self doItReceiver class;
  context: self doItContext;
  parseAMethod: false.!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.966.mcz

marcel.taeumel
Hi Jakob.

Thanks for the pointer. I think it is better to focus the proxy support on BasicInspector. What are your thoughts on this?

Best,
Marcel

Am 02.05.2020 00:16:31 schrieb [hidden email] <[hidden email]>:

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.966.mcz

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

Name: Tools-jr.966
Author: jr
Time: 2 May 2020, 12:16:24.578946 am
UUID: eceadafb-7b97-1742-84a2-e714d188a3bb
Ancestors: Tools-mt.965

Avoid inlining of #class for proxies/decorators in Inspector.

The instance variables and indexed variables are accessed by sending a message to the inspected object, which probably passes through any transparent proxies. If the list of variables is just obtained from "object class" (which will not actually send a message to the object), the list will contain the variables of the proxy. Thus, there is a mismatch between the inspector's schema of the object (the fields) and the schema which is queried for values (the schema of the object behind the proxy).

Also send a message to find out the class, so it is aligned with how the values are retrieved.

Also mind this when initializing the styler.

=============== Diff against Tools-mt.965 ===============

Item was changed:
----- Method: Inspector>>streamInstanceVariablesOn: (in category 'fields - streaming') -----
streamInstanceVariablesOn: aStream

+ (self object perform: #class "do not inline send of #class, receiver could be a proxy") allInstVarNames doWithIndex: [:name :index |
- self object class allInstVarNames doWithIndex: [:name :index |
aStream nextPut: ((self newFieldForType: #instVar key: name)
shouldStyleName: true;
valueGetter: [:object | object instVarNamed: name];
valueSetter: [:object :value | object instVarNamed: name put: value];
yourself)].!

Item was changed:
----- Method: Inspector>>updateStyler:requestor: (in category 'user interface - styling') -----
updateStyler: aStyler requestor: anObject
"Use this method to update our fieldListStyler and all view stylers."

aStyler
environment: self environment;
+ classOrMetaClass: (self doItReceiver perform: #class "do not inline send of #class, receiver could be a proxy");
- classOrMetaClass: self doItReceiver class;
context: self doItContext;
parseAMethod: false.!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.966.mcz

Jakob Reschke
Hi Marcel,

Sure. My commit prevents that you erroneously see the vars of the transparent proxy (!) in the regular Inspector. :-)

So the problem is that because of inlined #class you cannot just ignore the existence of proxies in one place to "focus support" for them in another tool.

Kind regards,
Jakob


Marcel Taeumel <[hidden email]> schrieb am Mo., 4. Mai 2020, 11:00:
Hi Jakob.

Thanks for the pointer. I think it is better to focus the proxy support on BasicInspector. What are your thoughts on this?

Best,
Marcel

Am 02.05.2020 00:16:31 schrieb [hidden email] <[hidden email]>:

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.966.mcz

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

Name: Tools-jr.966
Author: jr
Time: 2 May 2020, 12:16:24.578946 am
UUID: eceadafb-7b97-1742-84a2-e714d188a3bb
Ancestors: Tools-mt.965

Avoid inlining of #class for proxies/decorators in Inspector.

The instance variables and indexed variables are accessed by sending a message to the inspected object, which probably passes through any transparent proxies. If the list of variables is just obtained from "object class" (which will not actually send a message to the object), the list will contain the variables of the proxy. Thus, there is a mismatch between the inspector's schema of the object (the fields) and the schema which is queried for values (the schema of the object behind the proxy).

Also send a message to find out the class, so it is aligned with how the values are retrieved.

Also mind this when initializing the styler.

=============== Diff against Tools-mt.965 ===============

Item was changed:
----- Method: Inspector>>streamInstanceVariablesOn: (in category 'fields - streaming') -----
streamInstanceVariablesOn: aStream

+ (self object perform: #class "do not inline send of #class, receiver could be a proxy") allInstVarNames doWithIndex: [:name :index |
- self object class allInstVarNames doWithIndex: [:name :index |
aStream nextPut: ((self newFieldForType: #instVar key: name)
shouldStyleName: true;
valueGetter: [:object | object instVarNamed: name];
valueSetter: [:object :value | object instVarNamed: name put: value];
yourself)].!

Item was changed:
----- Method: Inspector>>updateStyler:requestor: (in category 'user interface - styling') -----
updateStyler: aStyler requestor: anObject
"Use this method to update our fieldListStyler and all view stylers."

aStyler
environment: self environment;
+ classOrMetaClass: (self doItReceiver perform: #class "do not inline send of #class, receiver could be a proxy");
- classOrMetaClass: self doItReceiver class;
context: self doItContext;
parseAMethod: false.!





Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-jr.966.mcz

marcel.taeumel
Ah, I see. :-)

+1

Best,
Marcel

Am 04.05.2020 15:51:26 schrieb Jakob Reschke <[hidden email]>:

Hi Marcel,

Sure. My commit prevents that you erroneously see the vars of the transparent proxy (!) in the regular Inspector. :-)

So the problem is that because of inlined #class you cannot just ignore the existence of proxies in one place to "focus support" for them in another tool.

Kind regards,
Jakob


Marcel Taeumel <[hidden email]> schrieb am Mo., 4. Mai 2020, 11:00:
Hi Jakob.

Thanks for the pointer. I think it is better to focus the proxy support on BasicInspector. What are your thoughts on this?

Best,
Marcel

Am 02.05.2020 00:16:31 schrieb [hidden email] <[hidden email]>:

A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.966.mcz

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

Name: Tools-jr.966
Author: jr
Time: 2 May 2020, 12:16:24.578946 am
UUID: eceadafb-7b97-1742-84a2-e714d188a3bb
Ancestors: Tools-mt.965

Avoid inlining of #class for proxies/decorators in Inspector.

The instance variables and indexed variables are accessed by sending a message to the inspected object, which probably passes through any transparent proxies. If the list of variables is just obtained from "object class" (which will not actually send a message to the object), the list will contain the variables of the proxy. Thus, there is a mismatch between the inspector's schema of the object (the fields) and the schema which is queried for values (the schema of the object behind the proxy).

Also send a message to find out the class, so it is aligned with how the values are retrieved.

Also mind this when initializing the styler.

=============== Diff against Tools-mt.965 ===============

Item was changed:
----- Method: Inspector>>streamInstanceVariablesOn: (in category 'fields - streaming') -----
streamInstanceVariablesOn: aStream

+ (self object perform: #class "do not inline send of #class, receiver could be a proxy") allInstVarNames doWithIndex: [:name :index |
- self object class allInstVarNames doWithIndex: [:name :index |
aStream nextPut: ((self newFieldForType: #instVar key: name)
shouldStyleName: true;
valueGetter: [:object | object instVarNamed: name];
valueSetter: [:object :value | object instVarNamed: name put: value];
yourself)].!

Item was changed:
----- Method: Inspector>>updateStyler:requestor: (in category 'user interface - styling') -----
updateStyler: aStyler requestor: anObject
"Use this method to update our fieldListStyler and all view stylers."

aStyler
environment: self environment;
+ classOrMetaClass: (self doItReceiver perform: #class "do not inline send of #class, receiver could be a proxy");
- classOrMetaClass: self doItReceiver class;
context: self doItContext;
parseAMethod: false.!