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

generate snippets for subclasses #61

Closed
wants to merge 2 commits into from

Conversation

salkin-mada
Copy link
Contributor

@salkin-mada salkin-mada commented Mar 18, 2020

"SomeSubClass".class.methods returns nil, class methods comes from the superclass.
I have therefore created an additional do func adding snippets for the subclass containing the methods from the superclass.

.. one small "post_everything" commit sneaked it's way into this PR. sorry :)

closes #60

@davidgranstrom
Copy link
Owner

@salkin-mada Thanks for this! I will look over it during the weekend.

@davidgranstrom
Copy link
Owner

@salkin-mada Hi again, sorry for the late response. I tried out the PR, and it's definitely nice to have more snippets for subclasses!

We do get some additional snippets though that produces some noise (imho), for instance we get *newFromDesc for a lot of subclasses that inherits from MultiOutUGen since there is no way in SuperCollider to specify the scope of methods (private/public) and that particular method is used internally by a lot of *ar/*kr creation methods.

Just to be clear, this was also the case before this PR, only now we get even more :) I'm starting to think that we might need a more granular approach to creating snippets? Maybe by ignoring some methods such as *initClass, and maybe also some of the Abstract* classes, since they shouldn't be instantiated directly in most cases. I'll have to think some more about this some more, but we can continue to discuss this in this PR for now.

@salkin-mada
Copy link
Contributor Author

salkin-mada commented Mar 24, 2020

@davidgranstrom Indeed there is a lot of additional noise, which is really not ideal.
To rethink the approach of how we do this - I am in favor of.
To be able to get all the subclasses and methods we want "for user convenience" is something I would really get excited about.
Lets discuss further and share ideas on how this could be done.
For now I could try to hardcode some exclusions for the most "aggressive" parents and clear some room for the inheritors and the things we really want. Maybe just start with the Ugen subsubclasses i.e. the noise classes etc. But making hardcoded exceptions is def not the way to go in the long run.
Could we somehow begin to formulate exakli what we want?

@salkin-mada
Copy link
Contributor Author

also see #63, a new parser for the classes and methods with more flexibility would be a thing to consider

@davidgranstrom
Copy link
Owner

@salkin-mada Yes, I agree. I think a good start would be to study https://github.com/supercollider/supercollider/blob/develop/SCClassLibrary/scide_scqt/ScIDE.sc in detail and see what/if we could reuse any of the methods.

I'm currently working on better function signature hints ("argument hints") and I think I will need something more robust for that as well than what we have now.

@davidgranstrom
Copy link
Owner

Closing this for now since it probably will be resolved by using better introspection from https://github.com/davidgranstrom/scnvim/tree/topic/arghints-lua

The plan is to generate snippets etc. directly from lua based on the introspection data generated by sclang.

@salkin-mada salkin-mada deleted the snippets branch March 23, 2021 01:41
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

Successfully merging this pull request may close these issues.

Snippets does not include the entire SCClassLibrary
2 participants