alhassy / repl-driven-development

Press "C-x C-e" to send any piece of code (in any language) to a REPL in the background, within Emacs!
GNU General Public License v3.0
63 stars 2 forks source link

scripting java-eval doesn't listen to region-end and region-start #4

Closed jasonjckn closed 1 year ago

jasonjckn commented 1 year ago

i'm scripting

(java-eval (point-min) (point-max))

but instead of evaling the ~whole buffer, it just evals 1 line. i'll attach video. https://drive.google.com/file/d/1--STaBpRak0V7V5t73fopxzJ11tPBhjJ/view?usp=sharing

however this works

(java-eval-string (s-trim-left (buffer-substring-no-properties beg end)))
alhassy commented 1 year ago

Please confirm that this issue has been resolved in the latest version of this package, version 1.0.11.

  1. Get the latest version of the package with M-x package-refresh contents then M-x package-upgrade RET repl-driven-development.
  2. Make a buffer with multi-line contents, such as

    String shout(String string) {
      return string.toUpperCase();
      }
    
      shout("hello")
  3. Execute M-: (java-eval (point-min) (point-max))
  4. See HELLO emitted in an overlay.
jasonjckn commented 1 year ago

Confirmed, its fixed :)

Thank you for this wonderful package.

--

This works nicely with treesit & combobulate, which you can use to figure out where the function definition begins and ends. https://drive.google.com/file/d/1-A15QtrVW0OmPBHBP6XuzPQGWJR6PLjq/view?usp=sharing