swift-emacs / swift-mode

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

Self documented for swift mode (newbie question) #151

Closed dupuchba closed 4 years ago

dupuchba commented 5 years ago

Hello friends,

I am trying to learn Swift and coming from a LISP background I am quite "in love" with emacs. My natural instinct was to look for a REPL workflow while learning swift and I found this mode.

Here are few questions that I have after having tried this mode, if one of you could respond it would be awesome :-) :

I guess I am trying to feel the limits of working on iOS projects with emacs and swift-mode as I really don't want to work with Xcode :D

Any comments are welcomed

taku0 commented 5 years ago

is the send-form-to-repl workflow possible and desirable with swift ?

You can run a REPL (C-c C-z), debug iOS apps (swift-mode:debug-ios-app), or debug Swift modules swift-mode:debug-swift-module. Use Send buffer to REPL command (C-c C-f) or Send region to REPL command (C-c C-r) to send statements from a buffer. I don't used to REPL workflow, so comments are welcome.

what about package / namespace / module in the REPL, it does not seem to handle it but I suppose the language does

You cannot define a module with REPL while you can import modules. See :help target modules search-paths for how to manage module search paths.

could it be possible to load documentation in a buffer as doc/apropos/find-doc in most LISPs

You could use langserver-swift or sourcekit-lsp. I haven't tried them yet.