tomasr / viasfora

A Visual Studio Extension containing miscellaneous improvements to the editor.
Other
557 stars 90 forks source link

F# Request: Activating Rainbow lines for functions and PM #308

Closed akhansari closed 3 years ago

akhansari commented 3 years ago

I wonder if it would be possible to activate rainbow lines for functions and patterns.

For exemple, when inside fib or inside | x -> :

let fib n =
    let lookup = Array.create (n+1) 0
    let rec f = fun x ->
        match x with
        | 1 | 2 -> 1
        | x ->
            match lookup.[x] with
            | 0 ->
                lookup.[x] <- f(x-1) + f(x-2)
                lookup.[x]
            | x -> x
    f(n)
tomasr commented 3 years ago

It would be hard, I think, since | is also used in other contexts. I am not sure I could figure out the meaning of one | without syntactic analysis,...