Jump to content

Use of 'name' attribute in YAML container.


Gerard Murphy

Recommended Posts

Hi,

 

I'm thinking about the feasibility of implementing an external parser for Semantic Merge for F# - this *might* handle code that defines anonymous functions.

 

Looking at the container definition in the description of the generated YAML file, is it absolutely necessary to populate the 'name' attribute - or can the core Semantic Merge engine work with anonymous containers?

 

My guess is that it can, because the names can change for a construct between files due to renaming, but I'd like to check first....

 

 

Regards,

 

Gerard

Link to comment
Share on other sites

  • 3 weeks later...
Hi Gerard,

 

It sounds good!

 

The name of the declaration (container or terminal node) is required but you can set a default value.

SemanticMerge uses this field for two purposes:

* identify the declaration and show it on GUI.

* improve the matching declaration process; it tries to match declarations with the same name (of course, they must be the same type), otherwise it tries by similitude.

In other words, when you specify the name of the declarations you make the matching process easier but this is not always possible.

 

Please, write us if you need a trial license for the external languages :)

 

Best regards,

Míryam

Link to comment
Share on other sites

Hi Míryam,

 

OK - I'll see if I can use the function arguments as a substitute for the name: so for "(fun x y -> .........)", the name would be "fun x y", likewise "(function (x, y) -> .....)" becomes "function (x, y)". This help match up refactorings that move anonymous functions.

 

If there's a problem with whitespace in the name, I'll think of a workaround or perhaps just fall back to stating 'anonymous function' as a name.

 

Thank you for the trial license offer - I've got a fully paid license for Semantic Merge for C#, I'm not sure what will happen if I'm implementing an F# plugin myself. :-)

 

I'll give it a try when I've got something ready to test and I'll be in touch if I need an additional generic license.

 

Kind Regards,

 

Gerard

Link to comment
Share on other sites

  • 2 months later...

Hi Míryam,

 

Thanks for your help both here and via E-mail: I've managed to get a proof-of-concept going; some screenshots are attached.

 

The source code for the plugin as at GitHub: https://github.com/sageserpent-open/SemanticMergeFSharpPlugin

 

Perhaps some other people would be interested in forking the repository and filling out the support for the F# constructs handled by the plugin, I can see https://plasticscm.uservoice.com/forums/196398-semanticmerge/suggestions/3839730-f-support ?

 

I will write an introduction to the plugin with a view of getting other developers to contribute in the next week or so...

 

Kind Regards,

 

Gerard

post-3416-0-43839100-1407670971_thumb.jpg

post-3416-0-93383900-1407670989_thumb.jpg

post-3416-0-39302400-1407671009_thumb.jpg

post-3416-0-88976500-1407671029_thumb.jpg

post-3416-0-95499400-1407671059_thumb.jpg

post-3416-0-39696900-1407671079_thumb.jpg

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...