You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Syntax Colorizer doesn't recognise computation expressions with generic types #110
The default syntax highlighter will highlight a computation expression without a generic type parameter, but once a generic type parameter is provided then the syntax highlighter will not colour the computation expression. See the following code for example (In the default Visual Studio dark theme ceBoolBuilder is coloured blue, but ceBuilder<System.DateTimeKind> is not):
typeTestCE<'T>()=memberthis.ReturnFrom(value)=if System.String.IsNullOrEmpty(value)then
None
elselettypeT= typeof<'T>if typeT.IsEnum then
box (System.Enum.Parse(typeT, value))|> Some
elseif typeT = typeof<bool>then
box (bool.Parse(value))|> Some
else None
letceBuilder<'T>= TestCE<'T>()letceBoolBuilder= TestCE<bool>()letexampleIncorrect= ceBuilder<System.DateTimeKind>{return! System.DateTimeKind.Local.ToString()}letexampleCorrect= ceBoolBuilder {return!"true"}
Image
comments
coza99 wrote Sep 3, 2014 at 3:54 AM [x]
This is also true if the builder function is parameterized. Taking the case from above an example
@ashtonkj do you still have the image from when you originally filed this one? Seems like it's broken now: http://namelessinteractive.com/media/Example.png
Hi @latkin. Image attached.Sorry for the delay, just installed windows 10 and broke everything else (not window's fault, driver issue caused me to have to do a clean install). As you can see the parameterised ceBuilder<System.DateTimeKind> doesn't highlight as a keyword, whereas the ceBoolBuilder does.
Activity
latkin commentedon Jan 27, 2015
@ashtonkj do you still have the image from when you originally filed this one? Seems like it's broken now:
http://namelessinteractive.com/media/Example.pngashtonkj commentedon Jan 29, 2015
Hi @latkin. Image attached.Sorry for the delay, just installed windows 10 and broke everything else (not window's fault, driver issue caused me to have to do a clean install). As you can see the parameterised ceBuilder<System.DateTimeKind> doesn't highlight as a keyword, whereas the ceBoolBuilder does.
dsyme commentedon Jan 29, 2015
FWIW this was a known limitation when we implemented this colorization feature.
ashtonkj commentedon Jan 29, 2015
@dsyme does that mean it won't be changed?
dsyme commentedon Jan 29, 2015
@ashtonkj Not necessarily! It may not be that hard
dsyme commentedon Jan 29, 2015
But would reduce the priority
dsyme commentedon Jan 9, 2016
Closing this as "by design" - perhaps Visual F# Power Tools can do something here.