anchor.diff:              let toolTipInfo = new TooltipInformation(SignatureMarkup = signature)
               match xmldoc with
               | Full(summary) -> toolTipInfo.SummaryMarkup <- summary
  -            | Lookup(key, filename) ->
  -                match filename with
  -                | Some f ->
  -                    let markup = TipFormatter.findDocForEntity(f, key)
  -                    match markup with
  -                    | Some summaryText -> toolTipInfo.SummaryMarkup <- Tooltips.getTooltip Styles.simpleMarkup summaryText
  -                    | _ -> ()
  -                | _ -> ()
  -            | _ -> ()
  -
  +            | Lookup(key, potentialFilename) ->
  +                let summary = 
  +                    maybe {let! filename = potentialFilename
  +                           let! markup = TipFormatter.findDocForEntity(filename, key)
  +                           let summary = Tooltips.getTooltip Styles.simpleMarkup markup
  +                           return summary}
  +                summary |> Option.iter (fun summary -> toolTipInfo.SummaryMarkup <- summary)
  +            | EmptyDoc -> ()
               result.AddOverload(toolTipInfo)
               result.RepositionWindow ()                  
               result :> _
  
positive.code:         if docText = null || offset >= docText.Length || offset < 0 then null else
  
          let projFile, files, args, framework = MonoDevelop.getCheckerArgs(extEditor.Project, fileName)
          let tyResOpt =
              MDLanguageService.Instance.GetTypedParseResultWithTimeout
                   (projFile,
                    fileName, 
                    docText, 
                    files,
                    args,
                    AllowStaleResults.MatchingSource,
                    ServiceSettings.blockingTimeout,
                    framework) |> Async.RunSynchronously
          LoggingService.LogInfo "TooltipProvider: Getting tool tip"
          match tyResOpt with
          | None -> LoggingService.LogWarning "TooltipProvider: ParseAndCheckResults not found"
                    null
          | Some tyRes ->
          // Get tool-tip from the language service
          let line, col, lineStr = MonoDevelop.getLineInfoFromOffset(offset, editor.Document)
          let tip, symbolUse = async {let! tooltip = tyRes.GetToolTip(line, col, lineStr)
                                      let! symbol = tyRes.GetSymbol(line, col, lineStr)
                                      return tooltip, symbol} |> Async.RunSynchronously
  
          let typeTip =
              match symbolUse with
              | Some symbolUse -> 
                  match symbolUse.Symbol with
                  | :? FSharpEntity as fse ->
                      try
                          let displayName = fse.DisplayName
  
                          let modifier = match fse.Accessibility with
                                         | a when a.IsInternal -> Highlight.asKeyword "internal "
                                         | a when a.IsPrivate -> Highlight.asKeyword "private "
                                         | _ -> ""
  
                          let attributes =
                              // Maybe search for modifier attributes like abstract, sealed and append them above the type:
                              // [<Abstract>]
                              // type Test = ...
                              String.Join ("\n", fse.Attributes 
                                                 |> Seq.map (fun a -> let name = a.AttributeType.DisplayName.Replace("Attribute", "")
                                                                      let parameters = String.Join(", ",  a.ConstructorArguments |> Seq.filter (fun ca -> ca :? string ) |> Seq.cast<string>)
                                                                      if String.IsNullOrWhiteSpace parameters then "[<" + name + ">]"
                                                                      else "[<" + name + "( " + parameters + " )" + ">]" ) 
                                                 |> Seq.toArray)
  
                          let signature =
                              let typeName =
                                  match fse with
                                  | _ when fse.IsFSharpModule -> "module"
                                  | _ when fse.IsEnum         -> "enum"
                                  | _ when fse.IsValueType    -> "struct"
                                  | _                         -> "type"
  
                              let enumtip () =
                                  Highlight.asSymbol " =" + "\n" + 
                                  Highlight.asSymbol "|" ++
                                  (fse.FSharpFields
                                  |> Seq.filter (fun f -> not f.IsCompilerGenerated)
                                  |> Seq.map (fun field -> field.Name) //TODO Fix FSC to expose enum filed literals: field.Name + (hl " = " cs.KeywordOperators) + hl field.LiteralValue cs.UserTypesValueTypes*)
                                  |> String.concat ("\n" + Highlight.asSymbol "| " ) )
                 
  
                              let uniontip () = 
                                  Highlight.asSymbol " =" + "\n" + 
                                  Highlight.asSymbol "|" ++
                                  (fse.UnionCases 
                                  |> Seq.map (fun unionCase -> 
                                                  if unionCase.UnionCaseFields.Count > 0 then
                                                     let typeList =
                                                        unionCase.UnionCaseFields
                                                        |> Seq.map (fun unionField -> unionField.Name ++ Highlight.asSymbol ":" ++ Highlight.asUserType (escapeText (unionField.FieldType.Format symbolUse.DisplayContext)))
                                                        |> String.concat (Highlight.asSymbol " * " )
                                                     unionCase.Name ++ Highlight.asKeyword "of" ++ typeList
                                                   else unionCase.Name)
  
                                  |> String.concat ("\n" + Highlight.asSymbol "| " ) )
                                                       
                              let typeDisplay = modifier + Highlight.asKeyword typeName ++ Highlight.asUserType displayName
                              let fullName = "\n\nFull name: " + fse.FullName
                              match fse.IsFSharpUnion, fse.IsEnum with
                              | true, false -> typeDisplay + uniontip () + fullName
                              | false, true -> typeDisplay + enumtip () + fullName
                              | _ -> typeDisplay + fullName
  
                          ToolTip(signature, getSummaryFromSymbol symbolUse, getSegFromSymbolUse editor symbolUse)
                      with exn -> ToolTips.EmptyTip
  
                  | :? FSharpMemberFunctionOrValue as func ->
                      try
                      if func.CompiledName = ".ctor" then 
                          if func.EnclosingEntity.IsValueType || func.EnclosingEntity.IsEnum then
                              //TODO: Add ValueType
                              ToolTips.EmptyTip
                          else
                              //TODO: Add ReferenceType
                              ToolTips.EmptyTip
  
                      elif func.FullType.IsFunctionType && not func.IsPropertyGetterMethod && not func.IsPropertySetterMethod && not symbolUse.IsFromComputationExpression then 
                          if isOperator func.DisplayName then
                              //TODO: Add operators, the text will look like:
                              // val ( symbol ) : x:string -> y:string -> string
                              // Full name: Name.Blah.( symbol )
                              // Note: (In the current compiler tooltips a closure defined symbol will be missing the named types and the full name)
                              ToolTips.EmptyTip
                          else
                              //TODO: Add closure/nested functions
                              if not func.IsModuleValueOrMember then
                                  //represents a closure or nested function
                                  ToolTips.EmptyTip
                              else
                                  let signature =
  
                                      let backupSignature = func.FullType.Format symbolUse.DisplayContext
                                      let argInfos =
                                          func.CurriedParameterGroups 
                                          |> Seq.map Seq.toList 
                                          |> Seq.toList 
  
                                      let retType = Highlight.asUserType (escapeText(func.ReturnParameter.Type.Format symbolUse.DisplayContext))
  
                                      //example of building up the parameters using Display name and Type
                                      let signature =
                                          let padLength = 
                                              let allLengths = argInfos |> List.concat |> List.map (fun p -> p.DisplayName.Length)
                                              match allLengths with
                                              | [] -> 0
                                              | l -> l |> List.max
  
                                          match argInfos with
                                          | [] -> retType //When does this occur, val type within  module?
                                          | [[]] -> retType //A ctor with () parameters seems to be a list with an empty list
                                          | [[single]] -> "   " + single.DisplayName + Highlight.asSymbol ":" ++ Highlight.asUserType (escapeText (single.Type.Format symbolUse.DisplayContext))
                                                          + "\n   " +  Highlight.asSymbol "->" ++ retType
                                          | many ->
                                              let allParams =
                                                  many
                                                  |> List.map(fun listOfParams ->
  
                                                                  listOfParams
                                                                  |> List.map(fun (p:FSharpParameter) ->
                                                                                  "   " + p.DisplayName.PadRight (padLength) + Highlight.asSymbol ":" ++ Highlight.asUserType (escapeText (p.Type.Format symbolUse.DisplayContext)))
                                                                                  |> String.concat (Highlight.asSymbol " *" ++ "\n"))
                                                  |> String.concat (Highlight.asSymbol " ->" + "\n") 
                                              allParams +  "\n   " + (String.replicate (max (padLength-1) 0) " ") +  Highlight.asSymbol "->" ++ retType
  
                                      let modifiers = 
                                          if func.IsMember then 
                                              if func.IsInstanceMember then
                                                  if func.IsDispatchSlot then "abstract member"
                                                  else "member"
                                              else "static member"
                                          else
                                              if func.InlineAnnotation = FSharpInlineAnnotation.AlwaysInline then "inline val"
                                              elif func.IsInstanceMember then "val"
                                              else "val" //does this need to be static prefixed?
  
                                      Highlight.asKeyword modifiers ++ func.DisplayName ++ Highlight.asSymbol ":" + "\n" + signature
  
                                  ToolTip(signature, getSummaryFromSymbol symbolUse, getSegFromSymbolUse editor symbolUse)                            
  
                      else
                          //val name : Type
                          let signature =
                                  let retType = Highlight.asUserType (escapeText(func.ReturnParameter.Type.Format symbolUse.DisplayContext))
                                  let prefix = 
                                      if func.IsMutable then Highlight.asKeyword "val" ++ Highlight.asKeyword "mutable"
                                      else Highlight.asKeyword "val"
                                  prefix ++ func.DisplayName ++ Highlight.asSymbol ":" ++ retType
  
                          ToolTip(signature, getSummaryFromSymbol symbolUse, getSegFromSymbolUse editor symbolUse)
                      with exn -> ToolTips.EmptyTip
  
                  | _ -> ToolTips.EmptyTip
  
              | None -> ToolTips.EmptyTip
          
          //As the new tooltips are unfinished we match ToolTip here to use the new tooltips and anything else to run through the old tooltip system
          // In the section above we return EmptyTip for any tooltips symbols that have not yet ben finished
          match typeTip with
          | ToolTip(signature, summary, textSeg) -> TooltipItem ((signature, summary), textSeg)
          | EmptyTip ->
  
          match tip with
          | None -> LoggingService.LogWarning "TooltipProvider: TootipText not returned"
                    null
          | Some (ToolTipText(elems),_) when elems |> List.forall (function ToolTipElementNone -> true | _ -> false) -> 
              LoggingService.LogWarning "TooltipProvider: No data found"
              null
          | Some(tiptext,(col1,col2)) -> 
              LoggingService.LogInfo "TooltipProvider: Got data"
              //check to see if the last result is the same tooltipitem, if so return the previous tooltipitem
              match lastResult with
              | Some(tooltipItem) when
                  tooltipItem.Item :? ToolTipText && 
                  tooltipItem.Item :?> ToolTipText = tiptext && 
                  tooltipItem.ItemSegment = TextSegment(editor.LocationToOffset (line, col1 + 1), col2 - col1) -> tooltipItem
              //If theres no match or previous cached result generate a new tooltipitem
              | Some(_) | None -> 
                  let line = editor.Document.OffsetToLineNumber offset
                  let segment = TextSegment(editor.LocationToOffset (line, col1 + 1), col2 - col1)
                  let tooltipItem = TooltipItem (tiptext, segment)
                  lastResult <- Some(tooltipItem)
                  tooltipItem
        with exn -> LoggingService.LogError ("TooltipProvider: Error retrieving tooltip", exn)
                    null
  
      override x.CreateTooltipWindow (editor, offset, modifierState, item) = 
          let doc = IdeApp.Workbench.ActiveDocument
  
negative.code:             if String.IsNullOrWhiteSpace xmlDocSig then XmlDoc.EmptyDoc
              else Lookup(xmlDocSig, symbolUse.Symbol.Assembly.FileName)
  
      let getTooltipFromSymbol (symbolUse:FSharpSymbolUse option) editor =
          match symbolUse with
          | Some symbolUse -> 
              match symbolUse.Symbol with
              | :? FSharpEntity as fse ->
                  try
                      let displayName = fse.DisplayName
  
                      let modifier = match fse.Accessibility with
                                     | a when a.IsInternal -> Highlight.asKeyword "internal "
                                     | a when a.IsPrivate -> Highlight.asKeyword "private "
                                     | _ -> ""
  
                      let attributes =
                          // Maybe search for modifier attributes like abstract, sealed and append them above the type:
                          // [<Abstract>]
                          // type Test = ...
                          String.Join ("\n", fse.Attributes 
                                             |> Seq.map (fun a -> let name = a.AttributeType.DisplayName.Replace("Attribute", "")
                                                                  let parameters = String.Join(", ",  a.ConstructorArguments |> Seq.filter (fun ca -> ca :? string ) |> Seq.cast<string>)
                                                                  if String.IsNullOrWhiteSpace parameters then "[<" + name + ">]"
                                                                  else "[<" + name + "( " + parameters + " )" + ">]" ) 
                                             |> Seq.toArray)
  
                      let signature =
                          let typeName =
                              match fse with
                              | _ when fse.IsFSharpModule -> "module"
                              | _ when fse.IsEnum         -> "enum"
                              | _ when fse.IsValueType    -> "struct"
                              | _                         -> "type"
  
                          let enumtip () =
                              Highlight.asSymbol " =" + "\n" + 
                              Highlight.asSymbol "|" ++
                              (fse.FSharpFields
                              |> Seq.filter (fun f -> not f.IsCompilerGenerated)
                              |> Seq.map (fun field -> field.Name) //TODO Fix FSC to expose enum filed literals: field.Name + (hl " = " cs.KeywordOperators) + hl field.LiteralValue cs.UserTypesValueTypes*)
                              |> String.concat ("\n" + Highlight.asSymbol "| " ) )
             
  
                          let uniontip () = 
                              Highlight.asSymbol " =" + "\n" + 
                              Highlight.asSymbol "|" ++
                              (fse.UnionCases 
                              |> Seq.map (fun unionCase -> 
                                              if unionCase.UnionCaseFields.Count > 0 then
                                                 let typeList =
                                                    unionCase.UnionCaseFields
                                                    |> Seq.map (fun unionField -> unionField.Name ++ Highlight.asSymbol ":" ++ Highlight.asUserType (escapeText (unionField.FieldType.Format symbolUse.DisplayContext)))
                                                    |> String.concat (Highlight.asSymbol " * " )
                                                 unionCase.Name ++ Highlight.asKeyword "of" ++ typeList
                                               else unionCase.Name)
  
                              |> String.concat ("\n" + Highlight.asSymbol "| " ) )
                                                   
                          let typeDisplay = modifier + Highlight.asKeyword typeName ++ Highlight.asUserType displayName
                          let fullName = "\n\nFull name: " + fse.FullName
                          match fse.IsFSharpUnion, fse.IsEnum with
                          | true, false -> typeDisplay + uniontip () + fullName
                          | false, true -> typeDisplay + enumtip () + fullName
                          | _ -> typeDisplay + fullName
  
                      ToolTip(signature, getSummaryFromSymbol symbolUse, getSegFromSymbolUse editor symbolUse)
                  with exn -> ToolTips.EmptyTip
  
              | :? FSharpMemberFunctionOrValue as func ->
                  try
                  if func.CompiledName = ".ctor" then 
                      if func.EnclosingEntity.IsValueType || func.EnclosingEntity.IsEnum then
                          //TODO: Add ValueType
                          ToolTips.EmptyTip
                      else
                          //TODO: Add ReferenceType
                          ToolTips.EmptyTip
  
                  elif func.FullType.IsFunctionType && not func.IsPropertyGetterMethod && not func.IsPropertySetterMethod && not symbolUse.IsFromComputationExpression then 
                      if isOperator func.DisplayName then
                          //TODO: Add operators, the text will look like:
                          // val ( symbol ) : x:string -> y:string -> string
                          // Full name: Name.Blah.( symbol )
                          // Note: (In the current compiler tooltips a closure defined symbol will be missing the named types and the full name)
                          ToolTips.EmptyTip
                      else
                          //TODO: Add closure/nested functions
                          if not func.IsModuleValueOrMember then
                              //represents a closure or nested function
                              ToolTips.EmptyTip
                          else
                              let signature =
  
                                  let backupSignature = func.FullType.Format symbolUse.DisplayContext
                                  let argInfos =
                                      func.CurriedParameterGroups 
                                      |> Seq.map Seq.toList 
                                      |> Seq.toList 
  
                                  let retType = Highlight.asUserType (escapeText(func.ReturnParameter.Type.Format symbolUse.DisplayContext))
  
                                  //example of building up the parameters using Display name and Type
                                  let signature =
                                      let padLength = 
                                          let allLengths = argInfos |> List.concat |> List.map (fun p -> p.DisplayName.Length)
                                          match allLengths with
                                          | [] -> 0
                                          | l -> l |> List.max
  
                                      match argInfos with
                                      | [] -> retType //When does this occur, val type within  module?
                                      | [[]] -> retType //A ctor with () parameters seems to be a list with an empty list
                                      | [[single]] -> "   " + single.DisplayName + Highlight.asSymbol ":" ++ Highlight.asUserType (escapeText (single.Type.Format symbolUse.DisplayContext))
                                                      + "\n   " +  Highlight.asSymbol "->" ++ retType
                                      | many ->
                                          let allParams =
                                              many
                                              |> List.map(fun listOfParams ->
  
                                                              listOfParams
                                                              |> List.map(fun (p:FSharpParameter) ->
                                                                              "   " + p.DisplayName.PadRight (padLength) + Highlight.asSymbol ":" ++ Highlight.asUserType (escapeText (p.Type.Format symbolUse.DisplayContext)))
                                                                              |> String.concat (Highlight.asSymbol " *" ++ "\n"))
                                              |> String.concat (Highlight.asSymbol " ->" + "\n") 
                                          allParams +  "\n   " + (String.replicate (max (padLength-1) 0) " ") +  Highlight.asSymbol "->" ++ retType
  
                                  let modifiers = 
                                      if func.IsMember then 
                                          if func.IsInstanceMember then
                                              if func.IsDispatchSlot then "abstract member"
                                              else "member"
                                          else "static member"
                                      else
                                          if func.InlineAnnotation = FSharpInlineAnnotation.AlwaysInline then "inline val"
                                          elif func.IsInstanceMember then "val"
                                          else "val" //does this need to be static prefixed?
  
                                  Highlight.asKeyword modifiers ++ func.DisplayName ++ Highlight.asSymbol ":" + "\n" + signature
  
                              ToolTip(signature, getSummaryFromSymbol symbolUse, getSegFromSymbolUse editor symbolUse)                            
  
                  else
                      //val name : Type
                      let signature =
                              let retType = Highlight.asUserType (escapeText(func.ReturnParameter.Type.Format symbolUse.DisplayContext))
                              let prefix = 
                                  if func.IsMutable then Highlight.asKeyword "val" ++ Highlight.asKeyword "mutable"
                                  else Highlight.asKeyword "val"
                              prefix ++ func.DisplayName ++ Highlight.asSymbol ":" ++ retType
  
                      ToolTip(signature, getSummaryFromSymbol symbolUse, getSegFromSymbolUse editor symbolUse)
                  with exn -> ToolTips.EmptyTip
  
              | _ -> ToolTips.EmptyTip
  
          | None -> ToolTips.EmptyTip
  
  type TooltipResults =
  | ParseAndCheckNotFound
  | NoToolTipText
  | NoToolTipData
  | Tooltip of TooltipItem
  
  /// Resolves locations to tooltip items, and orchestrates their display.
  /// We resolve language items to an NRefactory symbol.
  type FSharpTooltipProvider() = 
  