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

[WIP] autocomplete-plus support #91

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ssfrr
Copy link
Contributor

@ssfrr ssfrr commented Sep 29, 2017

This is a first cut at autocomplete support. It assumes you're using
supercolliderjs with my recent socket PR.

Here it pulls the list of class names and documentation summaries right after
booting the server, and queries for class methods on-the-fly.

I agree with your comment elsewhere that loading the class info from a file
would be nice so we can still auto-complete if SCLang is crashing or otherwise
unavailable. The balance is basically making sure that the autocompletion is
up-to-date whenever possible, so if the user adds a Quark or custom class it
should show up after their next reboot. In general a reasonable fallback plan
seems like:

  1. Use fresh data (from the last SCLang boot) whenever possible
  2. If SCLang didn't boot successfully, use a cached copy from the last boot
  3. If there are no cached copies, load from a default file that ships with the
    package with all the classes that ship with SC.

I'll test out whether getting all the class methods is fast enough to do it
up-front rather then at autocomplete-time.

Still more to do (this is somewhat aspirational, we'll see how far I get):

  • handle inherited methods
  • merge Class.prop and Class.prop_ methods with some
    readable/writable indication
  • figure out cacheing for when SCLang is unavailable
  • better feedback when you're in the middle of an argument list
    (maybe snippet support?)
  • add variable support - if we can statically figure out the class of a
    variable it would be great to be able to autocomplete instance
    members/methods
  • incorporate the regular text-based autocomplete so we also complete
    identifiers in the file.

I'll add a demo gif shortly. :)

@ssfrr
Copy link
Contributor Author

ssfrr commented Sep 29, 2017

I started this before those other PRs were merged, so I'll need to rebase.

Here's a gif:

atom supercollider autocomplete demo

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.

1 participant