All Projects → fsharp → Emacs Fsharp Mode

fsharp / Emacs Fsharp Mode

Licence: apache-2.0
F# Emacs mode

Programming Languages

fsharp
127 projects

Projects that are alternatives of or similar to Emacs Fsharp Mode

Abbreviate
Supporting your devops by shortening your strings using common abbreviations and clever guesswork
Stars: ✭ 160 (+0%)
Mutual labels:  hacktoberfest
Manual React
Manual do React - 📗 📒 (PT-BR Tradução) 2020 Edition
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Funnyalgorithms
A repository with a bunch of funny algorithms, beginners friendly
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Influxdb exporter
A server that accepts InfluxDB metrics via the HTTP API and exports them via HTTP for Prometheus consumption
Stars: ✭ 159 (-0.62%)
Mutual labels:  hacktoberfest
Graphite
Development repository for the graphite cookbook
Stars: ✭ 160 (+0%)
Mutual labels:  hacktoberfest
Kubernetes Scripts
A collection of scripts and commands for various Kubernetes tasks
Stars: ✭ 160 (+0%)
Mutual labels:  hacktoberfest
Esp32cam
OV2640 camera on ESP32-CAM, Arduino library
Stars: ✭ 158 (-1.25%)
Mutual labels:  hacktoberfest
Acre2
Advanced Combat Radio Environment 2 (ACRE2) for Arma 3
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
React Native Network Logger
An HTTP network request monitor for React Native with in-app interface for iOS and Android with no native code
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Rubanok
Parameters-based transformation DSL
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Fastboot
FastBoot is a library for rendering Ember.js applications in Node.js.
Stars: ✭ 159 (-0.62%)
Mutual labels:  hacktoberfest
Adsips
PowerShell module to interact with Active Directory using ADSI and the System.DirectoryServices namespace (.NET Framework)
Stars: ✭ 160 (+0%)
Mutual labels:  hacktoberfest
Lint Action
✨ GitHub Action for detecting and auto-fixing lint errors
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Hacktoberfest 2k18 Katas
Game has ended :: Little challenges to up your Hacktoberfest game!
Stars: ✭ 160 (+0%)
Mutual labels:  hacktoberfest
Openpdf
OpenPDF is a free Java library for creating and editing PDF files with a LGPL and MPL open source license. OpenPDF is based on a fork of iText. We welcome contributions from other developers. Please feel free to submit pull-requests and bugreports to this GitHub repository. ⛺
Stars: ✭ 2,174 (+1258.75%)
Mutual labels:  hacktoberfest
Worldedit
🗺️ Minecraft map editor and mod
Stars: ✭ 2,288 (+1330%)
Mutual labels:  hacktoberfest
Yaaf
Easing the form object pattern in Rails applications
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Mobile Toolkit
📱 Shell scripts for Android and iOS device management
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest
Datascience Pizza
🍕 Repositório para juntar informações sobre materiais de estudo em análise de dados e áreas afins, empresas que trabalham com dados e dicionário de conceitos
Stars: ✭ 2,043 (+1176.88%)
Mutual labels:  hacktoberfest
Standup Raven
A Mattermost plugin for communicating daily standups across teams
Stars: ✭ 161 (+0.63%)
Mutual labels:  hacktoberfest

[[http://melpa.org/#/fsharp-mode][file:http://melpa.org/packages/fsharp-mode-badge.svg]] [[https://stable.melpa.org/#/fsharp-mode][file:https://stable.melpa.org/packages/fsharp-mode-badge.svg]] [[https://github.com/fsharp/emacs-fsharp-mode/actions][file:https://github.com/fsharp/emacs-fsharp-mode/workflows/CI/badge.svg]]

  • fsharp-mode

Provides support for the F# language in Emacs. Includes the following features:

  • Syntax highlighting and indentation
  • Support for F# Interactive
  • Via [[https://github.com/joaotavora/eglot/issues][Eglot]] LSP-client integration:
    • Displays type signatures and tooltips
    • Flymake
    • Completion
    • Jump to definition [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html][Find Identifier References]] (Xref)

** LSP mode

The current version of =fsharp-mode= installs =fsautocomplete.exe= automatically via =eglot-fsharp.el= (part of this mono repo, [[https://melpa.org/#/eglot-fsharp][eglot-fsharp on melpa]]) or [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]] (untested).

=fsharp-mode= is tested with Emacs 26.1+ and NET Core 2.1 (LTS)

** Installation

*** Package

=fsharp-mode= is available on [[https://melpa.org][MELPA]] and can be installed using the built-in package manager.

If you're not already using MELPA, add the following to your init.el:

#+BEGIN_SRC elisp ;;; Initialize MELPA (require 'package) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (unless package-archive-contents (package-refresh-contents)) (package-initialize)

;;; Install fsharp-mode (unless (package-installed-p 'fsharp-mode) (package-install 'fsharp-mode))

(require 'fsharp-mode) #+END_SRC

If you are a user of [[https://github.com/jwiegley/use-package][use-package]] you can instead do

#+BEGIN_SRC elisp (use-package fsharp-mode :defer t :ensure t) #+END_SRC

*** From source

I recommend to use [[https://cask.github.io/why-cask.html][Cask]]. Add this to your =Cask= file:

#+BEGIN_SRC elisp (depends-on "fsharp-mode" :git "https://github.com/fsharp/emacs-fsharp-mode.git") #+END_SRC

** Eglot integration

The =eglot-fsharp= integration is not part of [[https://melpa.org/#/fsharp-mode][fsharp-mode on melpa]].

It is available via the seperate package [[https://melpa.org/#/eglot-fsharp][eglot-fsharp on melpa]].

Add to your config: #+BEGIN_SRC elisp (require 'eglot-fsharp) #+END_SRC

and execute =M-x eglot=

** Projects

=fsharp-mode= has support for Emacs build-in project management via =project.el=

** Configuration

*** Compiler and REPL paths

The F# compiler and interpreter should be set to good defaults for your OS as long as the relevant executables can be found on your PATH or in other standard locations. If you have a non-standard setup you may need to configure these paths manually.

On Windows:

#+BEGIN_SRC elisp (setq inferior-fsharp-program "c:\Path\To\Fsi.exe") #+END_SRC

On Unix-like systems, you must use the --readline- flag to ensure F# Interactive will work correctly with Emacs. Typically =fsi= and =fsc= are invoked through the shell scripts =fsharpi= and =fsharpc=:

#+BEGIN_SRC elisp (setq inferior-fsharp-program "path/to/fsharpi --readline-") #+END_SRC

*** Key Bindings

If you are new to Emacs, you might want to use the menu (call =menu-bar-mode= if you don't see it). However, it's usually faster to learn a few useful bindings:

| Key binding | Description | |------------------+-------------------------------------------| | =C-c C-r= | Evaluate region | | =C-c C-f= | Load current buffer into toplevel | | =C-c C-e= | Evaluate current toplevel phrase | | =C-M-x= | Evaluate current toplevel phrase | | =C-M-h= | Mark current toplevel phrase | | =C-c C-s= | Show interactive buffer | | =C-c C-c= | Compile with fsc | | =C-c x= | Run the executable | | =C-c C-a= | Open alternate file (.fsi or .fs) | | =C-c l= | Shift region to left | | =C-c r= | Shift region to right | | =C-c = | Move cursor to the beginning of the block | | =C-c C-d=, =M-.= | Jump to definition of symbol at point | | =C-c C-b=, =M-,= | Return to where point was before jump. |

To interrupt the interactive mode, use =C-c C-c=. This is useful if your code does an infinite loop or a very long computation.

If you want to shift the region by 2 spaces, use: =M-2 C-c r=

In the interactive buffer, use ==M-RET= to send the code without explicitly adding the =;;= thing.

** Editor

In order to change tab size it is possible to put this in emacs profile:

#+BEGIN_SRC elisp (setq-default fsharp-indent-offset 2) #+END_SRC

Because the F# language is sensitive to indentation, you might wan't to highlight indentation:

#+BEGIN_SRC elisp (add-hook 'fsharp-mode-hook 'highlight-indentation-mode) #+END_SRC

** Troubleshooting

=fsharp-mode= is still under development, so you may encounter some issues. Please report them so we can improve things! Open an issue on [[https://github.com/fsharp/emacs-fsharp-mode/][Github]].

*** No autocompletion in FSX files

The root cause is documented in this Ionide issue: [[https://github.com/ionide/ionide-vscode-fsharp/issues/1244][4.2.0 - No auto complete or typechecking in FSX files]]

As a workaround can add a reference to the facade netstandard assembly (path is platform/SDK-dependent).

On Arch Linux using [[https://aur.archlinux.org/packages/dotnet-sdk-lts-bin][dotnet sdk lts]] add this to your =fsx= file: #+BEGIN_SRC fsharp #r "/opt/dotnet/sdk/2.1.801/ref/netstandard.dll" #+END_SRC

*** Project file issues

If your project file does not seem to be being parsed correctly, so that you have missing references or other incorrect intellisense results, it is possible to obtain a detailed log of LSP events in this buffers:

  • =EGLOT (PROJECT/fsharp-mode) stderr=
  • =EGLOT (PROJECT/fsharp-mode) output=
  • =EGLOT (PROJECT/fsharp-mode) events=

** Contributing

This project is maintained by the [[http://fsharp.org/][F# Software Foundation]], with the repository hosted on [[https://github.com/fsharp/emacs-fsharp-mode][GitHub]].

Pull requests are welcome. Please run the test-suite with =make test= before submitting a pull request.

*** Maintainers

The maintainers of this repository appointed by the F# Core Engineering Group are:

  • [[https://github.com/juergenhoetzel][Jürgen Hötzel]], [[http://github.com/forki][Steffen Forkmann]], [[http://github.com/kjnilsson][Karl Nilsson]] and [[http://github.com/guillermooo][Guillermo López-Anglada]]
  • The primary maintainer for this repository is [[https://github.com/juergenhoetzel][Jürgen Hötzel]]

Previous maintainers:

  • [[https://github.com/rneatherway][Robin Neatherway]]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].