Buffer autoreload on external file change event


#1

Hello! Thanks for the great software! I like the look of the built-in text editor, but also would like to use an external editor (namely, RubyMine). I see, it’s possible to load file into buffer, but this action then needs to be done after each edit-save, which feels a bit tedious. Maybe there is an option for monitoring file changes (e.g. inotify) or some other way to automate this? (e.g. bash, AppleScript)
It would be cool to autoload file and maybe even autoplay after that!


#2

I don’t know anything about this software but there is an Atom plugin that works well to play with SP.


#3

Thanks! This was enough clue for implementing it via OSC::Client.


#4

Wow. Very nice! Is it easy to implement some kind of intelligent auto-completion using RubyMine? (Some kind of extended version of the auto-completion in the vanilla-IDE)


#5

Since Sonic Pi syntax is Ruby, I guess it would be enough to create stubs (kinda like “C headers” files) for indexing it. That’s how it’s done for the standard library:

=begin
This is a machine generated stub using stdlib-doc for <b>module Enumerable</b>
Sources used:  ruby-2.3.7
Created by IntelliJ Ruby Stubs Generator.
=end

# ...docs...
module Enumerable
  # ...docs...
  def to_a(*args)
    #This is a stub, used for indexing
  end
...

#6

I was able to extract YARD docs from sources!
Careful, it’s ~7000 lines :slight_smile: