Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jack-pappas/sublime-fsharp

F# syntax highlighting for Sublime Text 2
https://github.com/jack-pappas/sublime-fsharp

Last synced: 27 days ago
JSON representation

F# syntax highlighting for Sublime Text 2

Awesome Lists containing this project

README

        

### F# Syntax Definitions for Sublime Text 2 ###

F# syntax definitions for [Sublime Text 2](http://www.sublimetext.com/). When installed, these provide syntax highlighting to make it easier to work with F# source code.

---
### Supports ###

- **F# source files and scripts** (`.fs`, `.fsi`, `.fsx`)
- This file is based on [fsharp-tmbundle](https://code.google.com/p/fsharp-tmbundle/).
- **fslex** (`.fsl`) and **fsyacc** (`.fsy`)
- These are modified versions of the ocamllex and ocamlyacc definitions which ship with Sublime Text.

---
### TODO ###

- 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:

```fsharp
(* 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 to `List.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.

```fsharp
{ 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.

---
### License ###

**sublime-fsharp** is released under the [Simplified BSD License](http://opensource.org/licenses/BSD-2-Clause). See the LICENSE.md file for full license text.