The F# compiler services package is a component derived from the F# compiler source code that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications.
PM> Install-Package FSharp.Compiler.Service
The project currently exposes the following services that are tested & documented on this page. The libraries contain additional public API that can be used, but is not documented here.
F# Language tokenizer - turns any F# source code into a stream of tokens. Useful for implementing source code colorization and basic tools. Correctly handle nested comments, strings etc.
Processing untyped AST - allows accessing the untyped abstract syntax tree (AST). This represents parsed F# syntax without type information and can be used to implement code formatting and various simple processing tasks.
Using editor (IDE) services - expose functionality for auto-completion, tool-tips, parameter information etc. These functions are useful for implementing F# support for editors and for getting some type information for F# code.
Working with signatures, types, and resolved symbols - many services related to type checking return resolved symbols, representing inferred types, and the signatures of whole assemblies.
Working with resolved expressions - services related to working with type-checked expressions and declarations, where names have been resolved to symbols.
Working with projects and project-wide analysis - you can request a check of an entire project, and ask for the results of whole-project analyses such as find-all-references.
Hosting F# interactive - allows calling F# interactive as a .NET library from your .NET code. You can use this API to embed F# as a scripting language in your projects.
Hosting the F# compiler - allows you to embed calls to the F# compiler.
File system API - the
FSharp.Compiler.Servicecomponent has a global variable representing the file system. By setting this variable you can host the compiler in situations where a file system is not available.
NOTE: The FSharp.Compiler.Service API is subject to change when later versions of the nuget package are published
Some of the projects using the F# Compiler Services are:
- The Visual F# Power Tools
- The Xamarin and MonoDevelop Tools for F#
- The Emacs Plugin for F#
- The Vim Plugin for F#
- iFSharp - iPython-style notebook engine for F#
- CloudSharper - Online web and mobile programming with big data and charting
- Tsunami - Tsunami enhances applications and workflows with the power of Type Safe Scripting
- FQuake3 - integrates F# as an interactive game scripting engine
- FCell - Deliver the power of .NET from within Microsoft Excel
- FSharpLint - Lint tool for F#
- FsReveal - FsReveal parses markdown and F# script file and generate reveal.js slides
- Elucidate - Visual Studio extension for rich inlined comments using MarkDown
- FSharp.Formatting - F# tools for generating documentation (Markdown processor and F# code formatter)
- FAKE - "FAKE - F# Make" is a cross platform build automation system
- FsLab Journal - Template that makes it easy to do interactive data analysis using F# Interactive and produce nice HTML reports of your work
This project is a fork of the fsharp/fsharp which has been modified to expose additional internals useful for creating editors and F# tools and also for embedding F# interactive.
The F# source code is copyright by Microsoft Corporation and contributors, the extensions have been implemented by Dave Thomas, Anh-Dung Phan, Tomas Petricek and other contributors. The source code is available under the Apache 2.0 license.