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

Add F# module #1334

Merged
merged 4 commits into from
Jul 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Add a Racket module.
* Add a Lua module.
* Auto-install `racket-mode` if needed.
* Add a F# module.

### Changes

Expand Down
1 change: 1 addition & 0 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following programming languages have enhanced support in Prelude:
- [Emacs Lisp](modules/emacs_lisp.md)
- Erlang
- Elixir
- [F#](modules/fsharp.md)
- Go
- Haskell
- JavaScript
Expand Down
11 changes: 11 additions & 0 deletions doc/modules/fsharp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Prelude F#

!!! Note

This module builds on top of the shared [Programming](programming.md) module.

## F# mode

This module uses
[`fsharp-mode`](https://github.com/fsharp/emacs-fsharp-mode) and
`eglot-fsharp` with almost no extra configuration.
48 changes: 48 additions & 0 deletions modules/prelude-fsharp.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
;;; prelude-fsharp.el --- Emacs Prelude: F# programming support.
;;
;; Author: Andre Boechat <andre.boechat@tutanota.com>

;; This file is not part of GNU Emacs.

;;; Commentary:

;; Basic setup for F# programming based on fsharp-mode and Eglot.

;;; License:

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Code:

(require 'prelude-programming)
(prelude-require-packages '(fsharp-mode eglot-fsharp))

(with-eval-after-load 'fsharp-mode
(defun prelude-fsharp-mode-defaults ()
;; A reasonable default path to the F# compiler and interpreter on
;; Unix-like systems.
;; https://github.com/fsharp/emacs-fsharp-mode#compiler-and-repl-paths
(setq inferior-fsharp-program "dotnet fsi --readline-")
(require 'eglot-sharp))

(setq prelude-fsharp-mode-hook 'prelude-fsharp-mode-defaults)

(add-hook 'fsharp-mode-hook (lambda ()
(run-hooks 'prelude-sharp-mode-hook))))

(provide 'prelude-fsharp)

;;; prelude-fsharp.el ends here
1 change: 1 addition & 0 deletions sample/prelude-modules.el
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
(require 'prelude-emacs-lisp)
;; (require 'prelude-erlang)
;; (require 'prelude-elixir)
;; (require 'prelude-fsharp)
;; (require 'prelude-go)
;; (require 'prelude-haskell)
(require 'prelude-js)
Expand Down