GithubHelp home page GithubHelp logo

berdario / fsharpbinding Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fsprojects/zarchive-fsharpbinding

0.0 2.0 0.0 10.58 MB

F# language binding for MonoDevelop.

Home Page: http://fsharp.github.com/fsharpbinding

License: Other

Python 0.29% C# 5.75% Emacs Lisp 23.77% F# 69.42% Shell 0.77%

fsharpbinding's Introduction

F# Language Support for Open Editors

This project contains advanced editing support for F# for a number of open editors

For more information about F# see The F# Software Foundation. Join The F# Open Source Group. We use github for tracking work items and suggestions.

Basic Components

The core component is the FSharp.CompilerBinding.dll. This is used by both fsautocomplete.exe, a command-line utility to sit behind Emacs, Vim and other editing environments, an the MonoDevelop components.

Basic Components - Building

./configure.sh
make

This produces bin/FSharp.CompilerBinding.dll and bin/fsautocomplete.exe. To understand how to use these components, see the other projects.

MonoDevelop support

Adds open source F# support to the open source editor MonoDevelop. Features:

  • Code completion
  • Syntax highlighting
  • Tooltips
  • Debugging
  • Target .NET 3.5, 4.0, 4.5
  • F# Interactive scripting (Alt-Enter execution)
  • Templates (Console Application, Library, Tutorial Project, Gtk Project, Web Programming)
  • Makefile support
  • Supports F# 3.0 type providers (requires F# 3.0)
  • xbuild support for Visual Studio .fsproj and .sln files without change (requires Mono 3.0 and F# 3.0)
  • MonoDevelop also includes C# 5.0 and other features

Requires MonoDevelop 3.0 and later versions

Installation

Install F#. Then install the F# Language Binding via the MonoDeveop Add-in manager.

MonoDevelop --> Add-in manager --> Gallery --> Language Bindings --> F# Language Binding

Using the ASP.NET MVC 4 Template

On Windows, you need to install ASP.NET MVC 4 from here. You can then create a project from the template, build it, and run.

On Mac and Linux the template includes a copy of the basic ASP.NET MVC 4 core DLLs.

Building and installing from scratch

Normally you should get the binding from the repository. If you want to build and install it yourself and develop it, try this:

cd monodevelop
./configure.sh
make 
make install

Can't get it to work?

Don't give up! Add an issue to the issue tracker. You issue will be seen by the developers.

Notes for Developers

To check things are working try a few different things somewhat at random:

  • Check the F# templates are appearing
  • Create a console project (NOTE: retarget it to .NET 4.0 using right-click->options->General)
  • Check there are completion lists in the console project e.g. for 'System.' and 'System.Console.WriteLine(' and 'List.'
  • Check you can build the console project
  • Check you can run the console project
  • Check you can "debug-step-into" the console project
  • Check you can set a break point in the console project
  • Check there are type tips showing when you move the mouse over code identifiers
  • Load an existing .fsproj (e.g. see MonoDevelop.FSharpBinding/tests/projects/...) and check if completion works etc.
  • Run xbuild on a few .fsproj (this is nothing to do with the binding, it is just fsharp/fsharp)

There are a couple of known issues, see https://github.com/fsharp/fsharpbinding/issues.

On windows, use the file MonoDevelop.FSharpBinding\MonoDevelop.FSharp.windows.fsproj. Be aware that this is not the original file, which is MonoDevelop.FSharp.orig. The windows file is created automatically now and then to help development on Windows.

On Mac/Linux, please develop using the 'Makefile' with Mono 3.0 and FSharp 3.0. There is an old Makefile for the days before xbuild works, but this is not used to prepare distributions.

If you make changes to the binding, then loss of completion lists etc. can be disturbing and hard to debug. There are some debugging techniques. To launch MD you can use /Applications/MonoDevelop.app/Contents/MacOS/MonoDevelop --new-window --no-redirect

To enable some logging you can use export FSHARPBINDING_LOGGING=*

Emacs support

The Emacs integration currently only supports working with a single file

Features:

  • Interactive F# buffer
  • Indentation
  • Syntax highlighter

Installation

fsharp-mode is available on MELPA.

To download it,package.el is the built-in package manager in Emacs 24+. On Emacs 23 you will need to get package.el yourself if you wish to use it.

If you're not already using MELPA, add this to your ~/.emacs.d/init.el (or equivalent) and load it with M-x eval-buffer.

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)

And then you can install fsharp-mode with the following command:

M-x package-install [RET] fsharp-mode [RET]

or by adding this bit of Emacs Lisp code to your Emacs initialization file(.emacs or init.el):

(when (not (package-installed-p 'fsharp-mode))
  (package-install 'fsharp-mode))

If the installation doesn't work try refreshing the package list:

M-x package-refresh-contents [RET]

Manual installation

In order to install the F# mode, you have to tell Emacs where to find it. This is done by adding some commands to the init file.

Copy the fsharpbinding/emacs/ directory in your ~/.emacs.d directory (or a place of your choice) and rename it to fsharp Assuming you now have a ~/.emacs.d/fsharp directory, copy the following lines to your init file (usually ~/.emacs or init.el).

(setq load-path (cons "~/.emacs.d/fsharp" load-path))
(setq auto-mode-alist (cons '("\\.fs[iylx]?$" . fsharp-mode) auto-mode-alist))
(autoload 'fsharp-mode "fsharp" "Major mode for editing F# code." t)
(autoload 'run-fsharp "inf-fsharp" "Run an inferior F# process." t)

Configuration

If fsc and fsi are in your path, that's all you need. Otherwise, you can add these two following lines to set the path to the compiler and interactive F#.

On Windows (adapt the path if needed):

(setq inferior-fsharp-program "\"c:\\Program Files\\Microsoft F#\\v4.0\\Fsi.exe\"")
(setq fsharp-compiler "\"c:\\Program Files\\Microsoft F#\\v4.0\\Fsc.exe\"")

On Unix (adapt the path if needed):

(setq inferior-fsharp-program "mono ~/fsi.exe --readline-")
(setq fsharp-compiler "mono ~/fsc.exe")

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:

  • C-c C-r: Evaluate region
  • 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

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.

Notes for People Preparing Releases

The addin gets released to http://addins.monodevelop.com under project 'FSharp' (project index 48). Contact @sega, @tpetricek or @funnelweb to make an update.

To build the .mpack files to upload to this site, use:

cd monodevelop
./configure.sh
make packs

The files go under pack/...

The build process builds several versions of the addin for specific different versions of MonoDevelop. MonoDevelop APIs can change a bit and are not binary compatible. We try to keep up with (a) the latest version available as an Ubuntu package (b) the latest version available in the 'Stable' channel on Windows and Mac (c) the latest version available in the 'Beta' channel on Windows and Mac

When developing generally use (c)

The build is performed against the MonoDevelop binaries we depend on in dependencies/..., which have been snarfed from MonoDevelop installs.

fsharpbinding's People

Contributors

anjemz avatar berdario avatar bojanrajkovic avatar dmohl avatar funnelweb avatar isiguta avatar jrwren avatar karthikvishnu avatar mavnn avatar migueldeicaza avatar mithunder avatar psfblair avatar puffnfresh avatar quasilord avatar rneatherway avatar scottstephens avatar slluis avatar ssrb avatar suprdewd avatar tpetricek avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.