-
Notifications
You must be signed in to change notification settings - Fork 249
add introspection and command to generate report #819
Conversation
|
Cool! The generic reflection part feels like it could even be a separate
NPM package.
Please add a date to the generated report, and vim-mode package version,
and if possible also current git commit ID, so it's easy to see if the
report is up to date.
Would it be possible/useful to output as the first part a subclass tree
rather than an unordered list of subclass relationships?
|
Will do, I'm not sure for git commit ID, will try.
I couldn't understand above, how does it like? I want some example. |
|
Now removed TOM-report.md itself from docs/ dir. since its now written under tmpdir. By the way, if this reflection utility be merged, I can add realtime opStack observation feature. |
|
Regarding hierarchy: currently, your output is and I think it would be useful to have it sorted alphabetically and nested by subclassing like this |
|
The more and more I'm looking at this, the more it looks like it could be an Atom package independent of vim-mode, which would take the current project's coffee files and run this type of introspection on their exports. Also, instead of generating a file, how about opening a new text editor and putting the content there? Then the user can choose where to save it, if at all. |
|
Its good idea to save non-named buiffer and let user choose where to save. The independend Package idea is good, maybe me or other person introduce in future. My motivation is to introduce opStack ovservation feature on top of this introspection helper utility function to help developer. Its already very useful to understand where to be fixed while refactoring in my refactor ecoeriment. I can directly spot what class operator is operate on when some operator throw error. |
658b178 to
f441216
Compare
|
Updated first comment to fit to current implementation. Here is the summary of change from first PR.
|
|
This is a really cool technique, but I don't think this code belongs inside of $ generate-introspection-report ~/.atom/packages/vim-mode/lib/*.coffee |
|
Your example seem that command is executed separate process to statically analyze coffee source. The main purpose of this addition is to add Its very useful to developer adding or refactoring vim-mode. Also this introspection report can be used to explain overall change between large commit by comparing to past report. |
This PR introduce new
generate-introspection-reportcommand which generate introspection report as markdown format to untitled buffer.This is not enhancement to Vim feature, this introspection command sometime useful for vim-mode developer to get overview of each TextObject, Operator, Motion.
This introspection parse
Function.toString()to find instance variable assignment andsupercall.Not 100% accurate(parsing JavaScript function written in CoffeScript), but useful.