ColdBox / vscode-coldbox

VSCode support for ColdBox
MIT License
6 stars 4 forks source link

Feature Request: Support Wirebox Injection Definition #21

Open homestar9 opened 3 years ago

homestar9 commented 3 years ago

This VS code plugin makes developing Coldbox apps so much better! Thank you for all the time you've spent working on this. One thing that I feel would be a great addition would be if we could "CTRL + Click" directly to a method in an injected property.

For example, let's say you have the following ColdBox handler:

component {
  property name="userService" inject="UserService";

  function index( event, rc, prc ) {
    prc.user = userService.getById( 1 );
  }

}

The idea would be if VS Code could understand that userService.getById() belongs to the UserService model and could take the user right to the definition of getById() in models/UserService.cfc. Unfortunately, this probably adds quite a bit of complexity because there's no way to know from the injection DSL where UserService lives unless the extension would also understand all of Coldbox's conventions. However, this would be pretty slick if it were possible.

lmajano commented 3 years ago

I would love this @homestar9 But I think this might be under the realm of @KamasamaK and the cfml plugin, where it can somehow map variables (that ;are objects) back to a mapping. Not sure what the best approach is, or if there are such things in other dynamic language editors like if you are using php or groovy? Thoughts @KamasamaK ??