Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FamixNG support for mooseIcon methods #2420

Closed
fuhrmanator opened this issue Oct 28, 2021 · 2 comments
Closed

FamixNG support for mooseIcon methods #2420

fuhrmanator opened this issue Oct 28, 2021 · 2 comments

Comments

@fuhrmanator
Copy link
Contributor

When using Moose on our TypeScript models, we notice we don't get the cool icons for Method, Class, Interface, Attribute like in the FAMIX compatibility entities. Diving deeper, I see that the mooseIcon methods appear to have been added manually to those respective FAMIX compatibility entities.

I'm now wondering if it's possible to get the support for the mooseIcon methods via FamixNG (trying to minimize the manual intervention in the generated classes). For example, mooseIcon in FAMIXClass looks like:

mooseIcon
	^ self isInterface 
		ifTrue: [ MooseIcons famixInterface ]
		ifFalse: [ MooseIcons famixClass ]

Is there a way/example of how to generate this via the DSL?

@fuhrmanator
Copy link
Contributor Author

So, I spent some time using the Models browser (Moose-IDE) looks great by the way. I can see the icons are more or less working without the mooseIcon method into the entities, so maybe you can close this?

Still, it would be nice to know how to specify custom methods in the MM from the DSL, again to avoid the problem of manually-added things to a metamodel which requires some documenting if you want to reproduce them.

A quick internet search got me to ClassDescription>>#compileSilently: which is an extension used by Fuel, etc. to programmatically add a method to a class. I guess one could add methods this way after the metamodel is generated. I couldn't find a hook in the FamixMetamodelGenerator where to put such code (after entities are generated, something like #postLoadDoIt in Baselines?). Maybe this could be a blog topic?

@anneetien
Copy link
Contributor

Great idea to enable the addition of methods in the generator! and to write a blog post on it.
I close this issue, since it is no more relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants