swift-emacs / swift-mode

Emacs support for Apple's Swift programming language.
GNU General Public License v3.0
370 stars 47 forks source link

How to use running Docker swift container as REPL #155

Closed stardiviner closed 5 years ago

stardiviner commented 5 years ago

My Linux installed swift binary failed many times. So I give up. Until it is easy to install on my Arch Linux. I use Swift Docker image to get a running Swift REPL. and other swift binaries. But I don't know how to use running Docker swift container as swift REPL and binary path.

taku0 commented 5 years ago

To change the command temporary:

  1. C-u M-x run-swift.
  2. Enter docker run --rm --privileged -it swift swift.

To save the command for future sessions:

  1. M-x customize-group.
  2. Enter swift-mode:repl.
  3. Change Swift Mode:Repl Executable to docker run --rm --privileged -it swift swift.
  4. Click State and Save for Future Sessions.
  5. M-x run-swift.
stardiviner commented 5 years ago

Thanks, this works even send code to REPL. But the repl buffer name is same with command. Can you add code to always rename REPL buffer to a specific name like *swift* as other REPL buffer does.

taku0 commented 5 years ago

It is intentional to distinguish multiple processes with different command line parameters like iOS app debugger and Swift module debugger processes. How about *Swift [docker run --rm --privileged -it swift swift]*?

stardiviner commented 5 years ago

It is intentional to distinguish multiple processes with different command line parameters like iOS app debugger and Swift module debugger processes.

I see. Thanks

How about Swift [docker run --rm --privileged -it swift swift]?

That's better. so that other Emacs packages like ob-swift can match it simpler. Thanks

taku0 commented 5 years ago

Updated 348e1539775a118f82533b5c5999054ad6b79a1d