Fsharp: Computation expression name is not colored in the "preview" mode until it's clicked

Created on 21 Nov 2015  路  11Comments  路  Source: dotnet/fsharp

1

Area-IDE Language Service Severity-Low bug

Most helpful comment

All 11 comments

Almost a feature :) "Go on punk.... click me...."

:smile:

While I see the problem and it is a bug, I'm going to close this as "won't fix", at least until we find some more major ramification of the problem.

@dsyme it's a trivial bug, but it's a bug

:(

Instead of closing it, why not just label it as minor and up-for-grabs?

OK, reopening

Perhaps related, and making this but a trifle more relevant: if the computation expression name is function / constructor call, it is not colored as a computation expression name at all.

Example code to repro (VS2015, F# 4.0):

type MaybeBuilder1() =
    member __.Bind(x, f) = match x with None -> None | Some a -> f a
    member __.Return(x) = Some x

type MaybeBuilder2(rt) =
    member __.Bind(x, f) = match x with None -> rt, None | Some a -> rt, f (a)
    member __.Return(x) = rt, Some x


[<AutoOpen>]
module TBuilders = 

    let may = MaybeBuilder1
    let may2 = MaybeBuilder2
    let may2a = new MaybeBuilder2(42)

    let test1 = 
        may() {
            return 1
        }

    let test2 = 
        may2(42) {
            return "test"
        }

    let test2a = 
        may2a {
            return "test"
        }

coloring of builders

An addition to this: F# files do not "previewable" in VS 2017, so we cannot even verify if this bug is still reproducible (however, as we use Roslyn API for syntax highlighting in VS 2017, it's likely to be fixed).

This bug has never reproduced in VS 2017.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ctaggart picture ctaggart  路  3Comments

Szer picture Szer  路  3Comments

enricosada picture enricosada  路  3Comments

vasily-kirichenko picture vasily-kirichenko  路  3Comments

Tarmil picture Tarmil  路  4Comments