2graphic / sinap-ide

Sinap IDE development project.
7 stars 1 forks source link

Made validateEdge check type. #358

Closed slaymaker1907 closed 7 years ago

slaymaker1907 commented 7 years ago

Also added sinap-core as explicit dependency since we need 3.11.4 or higher. Note that we now create a fake edge for use with validateEdge.

slaymaker1907 commented 7 years ago

Going to just merge this if no one reviews by Sunday.

Sheyne commented 7 years ago

We don't need to worry about the CoreElement being deleted as long as there is a reference to it. It may be removed from the environment though. On Wed, May 10, 2017 at 10:03 AM CJ Dimaano notifications@github.com wrote:

@ilargierdi commented on this pull request.

In app/models/graph-controller.ts https://github.com/2graphic/sinap-ide/pull/358#discussion_r115782634:

  • return validateEdge(this.plugin, source, destination, undefined);
  • }
  • if (!likeVal) {
  • likeVal = new ElementValue(this.activeEdgeType, this.core.environment);

In that regard, is it possible to get the type information from the arguments of validateEdgeHandler? If so, maybe rename validateEdge to typecheckEdge, only pass element types to typecheckEdge and remove the plugin parameter, then return typecheckEdge(...) && (plugin.validateEdge ? plugin.validateEdge(...) : true) in validateEdgeHandler.

I think this still does not address your concern, though. If like is provided as a previously deleted edge, is there any way to get its type information from the environment? I'm not sure this is currently possible.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/2graphic/sinap-ide/pull/358#discussion_r115782634, or mute the thread https://github.com/notifications/unsubscribe-auth/AApdvm_RM53JfRpcKJr0Cdx4Fl-HRoZ1ks5r4d_hgaJpZM4NQNtc .