F# syntax definitions for Sublime Text 2. When installed, these provide syntax highlighting to make it easier to work with F# source code.
- F# source files and scripts (
.fs
,.fsi
,.fsx
)- This file is based on fsharp-tmbundle.
- fslex (
.fsl
) and fsyacc (.fsy
)- These are modified versions of the ocamllex and ocamlyacc definitions which ship with Sublime Text.
-
Bugfixes
-
Some keywords and compiler directives aren't highlighted.
-
Verbatim strings are not yet supported (i.e., they're not highlighted correctly).
-
In the fslex and fsyacc definitions:
-
Some text elements are highlighted correctly (i.e., they're recognized and the correct color/style is applied), but the last character in the token isn't highlighted.
-
If the single-line comment token
//
occurs on the same line as and before the closing token of a multi-line comment*)
, the//
eats the rest of the line -- including the*)
. This causes the multi-line comment not to be closed, so the rest of the file will be highlighted as if it were commented-out. For example:(* Some comment text, with a link below it: http://foobar.com/baz *)
-
-
The following code isn't highlighted correctly when the record instantiation is moved above the
List.foldBack
and the forward pipeline|>
operator is used to apply the record toList.foldBack
. It's likely a scoping-related issue, since TextMate / Sublime Text 2 syntax definitions only allow patterns to be matched within a single line. Scoping constructs must be used to identify multi-line patterns.{ Header = $1; Tokens = []; Types = []; Associativities = []; StartSymbols = []; Rules = $4; } |> List.foldBack (fun f x -> f x) $2
-
-
Future
- Syntax highlighting for F# Interactive when used through SublimeREPL.
- Once the bugs are fixed, I'll create a package and for this and submit it to Package Control so it can be installed from within Sublime Text.
sublime-fsharp is released under the Simplified BSD License. See the LICENSE.md file for full license text.