After an update to the latest nightly build, the properties view suddenly shows all kind of properties that it shouldn’t:

For example, if I have the Entity lang instance

 module example
 // no entities

and select example, then I get the following properties:

Constructor   -
Defines       / Module:"example"#0/
Name          example
Refers to     -
Target        - 
Type          -

Sometimes it even produces multiple properties with the same name (and value -).

Submitted by Oskar van Rest on 23 March 2014 at 05:44

On 23 March 2014 at 13:31 Daco Harkes commented:

The properties view shows all properties by default, and if the property is undefined it shows a -.

If you want it to skip the undefined properties then change get-all-editor-properties to get-editor-properties.

editor-properties:
	(target, position, ast, path, project-path) ->
		<get-all-editor-properties(pp-Stratego-string |<language>, project-path)>target

The sometimes multiple properties with the same name and value: I don’t know, havent seen that before. That should not be possible based on the stratego code. Can you specify when this happens?


On 23 March 2014 at 21:47 Oskar van Rest commented:

It’s actually quite nice to have this option between showing all properties and only the defined ones. It’s just that these duplicates constantly generate IndexOutOfBoundsExceptions because Eclipse can’t handle multiple properties with the same name. I should probably detect and warn the user when there are multiple properties with the same name (in case the user creates a custom properties view), but it should also be fixed in get-all-editor-properties.

These are the properties that are generated for my language:
[("Target","-"),("Constructor","RelPhraseRef/1"),("Name","-"),("Defines","-"),("Refers to","-"),("Type","-"),("Term","-"),("Term","-"),("Term","-"),("Rel","-"),("Rel","-"),("Class","-")]
I haven’t been able yet to come up with a small example in which it happens yet.


On 24 March 2014 at 00:51 Daco Harkes commented:

Yes, that actually why I created the all option.

I’m still wondering why you could have duplicated properties.
First it gets all the properties nabl-props := [Type()|<nabl-props-custom>] and then it tries to get a value for each property. So I would not expect duplicates here.

Log in to post comments