anchor.diff:  open System.Diagnostics
   open MonoDevelop.Core
   open MonoDevelop.Debugger
  +open MonoDevelop.Ide
  +open MonoDevelop.Ide.Editor.Extension
  +open MonoDevelop.Ide.Gui
   open MonoDevelop.Ide.Gui.Content
   open MonoDevelop.Ide.CodeCompletion
   open MonoDevelop.Ide.CodeTemplates
   open Microsoft.FSharp.Compiler
   open Microsoft.FSharp.Compiler.SourceCodeServices
   open FSharp.CompilerBinding
  -open ICSharpCode.NRefactory.Completion
   open MonoDevelop.FSharp.NRefactory
   open ICSharpCode.NRefactory.TypeSystem
   open ExtCore.Control
  
positive.code:                       icon,
                        "Evaluates to the current line number, considering <tt>#line</tt> directives.",
                        CompletionCategory = compilerIdentifierCategory, 
                        DisplayFlags = DisplayFlags.DescriptionHasMarkup) :> ICompletionData
         CompletionData("__SOURCE_DIRECTORY__",
                        icon,
                        "Evaluates to the current full path of the source directory, considering <tt>#line</tt> directives.",
                        CompletionCategory = compilerIdentifierCategory, 
                        DisplayFlags = DisplayFlags.DescriptionHasMarkup) :> _
         CompletionData("__SOURCE_FILE__",
                        icon,
                        "Evaluates to the current source file name and its path, considering <tt>#line</tt> directives.",
                        CompletionCategory = compilerIdentifierCategory,
                        DisplayFlags = DisplayFlags.DescriptionHasMarkup) :> _ ]
  
    // Until we build some functionality around a reversing tokenizer that detect this and other contexts
    // A crude detection of being inside an auto property decl: member val Foo = 10 with get,$ set
    let isAnAutoProperty (editor: Mono.TextEditor.TextEditorData) offset =
      let lastStart = editor.FindPrevWordOffset(offset)
      let lastEnd = editor.FindCurrentWordEnd(lastStart)
      let lastWord = editor.GetTextBetween(lastStart, lastEnd)
  
      let prevStart = editor.FindPrevWordOffset(lastStart)
      let prevEnd = editor.FindCurrentWordEnd(prevStart)
      let previousWord = editor.GetTextBetween(prevStart, prevEnd)
      lastWord = "get" && previousWord = "with"
  
    let getCompletionData (symbols:FSharpSymbolUse list list) =
        let categories = Dictionary<string, Category>()
  
negative.code:       let symbolToCompletionData (symbols : FSharpSymbolUse list) =
            match symbols with
            | head :: tail ->
                let cd = FSharpMemberCompletionData(head.Symbol.DisplayName, symbolToIcon head, head, tail) :> CompletionData
                match tryGetCategory head with
                | Some c -> let category = getOrAddCategory c
                            cd.CompletionCategory <- category
                | None -> ()
                cd
            | _ -> null //FSharpTryAgainMemberCompletionData() :> ICompletionData
  
        symbols |> List.map symbolToCompletionData
  
    override x.CompletionLanguage = "F#"
    override x.Initialize() = 
        do x.Editor.SetIndentationTracker (FSharpIndentationTracker(base.Editor))
        base.Initialize()
  
    /// Provide parameter and method overload information when you type '(', '<' or ','
    override x.HandleParameterCompletionAsync (context, _completionChar, token) =
      //TODO refactor computation to remove some return statements (clarity)
      Async.StartAsTask (cancellationToken = token, computation = async {
      try
          if suppressParameterCompletion then
             suppressParameterCompletion <- false
             return null
          else
          let docText = x.Editor.Text
          let offset = context.TriggerOffset
          
          // Parse backwards, skipping (...) and { ... } and [ ... ] to determine the parameter index. 
          // This is an approximation.
          let startOffset =
              let rec loop depth i = 
                  if (i <= 0) then i else
                  let ch = docText.[i] 
                  if ((ch = '(' || ch = '{' || ch = '[') && depth > 0) then loop (depth - 1) (i-1) 
                  elif ((ch = ')' || ch = '}' || ch = ']')) then loop (depth+1) (i-1) 
                  elif (ch = '(' || ch = '<') then i
                  else loop depth (i-1) 
              loop 0 (offset-1)
          
          if docText = null || offset > docText.Length || startOffset < 0 || offset <= 0 || isAnAutoProperty x.Editor offset then return null 
          else
          LoggingService.LogDebug("FSharpTextEditorCompletion: Getting Parameter Info, startOffset = {0}", startOffset)
          
          let projFile, files, args = MonoDevelop.getCheckerArgs(x.DocumentContext.Project, x.DocumentContext.Name)
          
          // Try to get typed result - within the specified timeout
          let! methsOpt =
              async {let! tyRes = MDLanguageService.Instance.GetTypedParseResultAsync (projFile, x.DocumentContext.Name, docText, files, args, AllowStaleResults.MatchingFileName) 
                     let line, col, lineStr = MonoDevelop.getLineInfoFromOffset(startOffset, x.Editor)
                     let! methsOpt = tyRes.GetMethods(line, col, lineStr)
                     return methsOpt }
          
          match methsOpt with 
          | Some(name, meths) when meths.Length > 0 -> 
              LoggingService.LogInfo ("FSharpTextEditorCompletion: Getting Parameter Info: {0} methods", meths.Length)
              //TODO Convert meths to ParameterHintingData
              let data = ResizeArray()
              return ParameterHintingResult(data, startOffset) 
          | _ -> LoggingService.LogWarning("FSharpTextEditorCompletion: Getting Parameter Info: no methods found")
                 return null 
      with ex ->
          LoggingService.LogError ("FSharpTextEditorCompletion: Error in HandleParameterCompletion", ex)
          return null})
  
    override x.KeyPress (descriptor:KeyDescriptor) =
        // Avoid two dots in sucession turning inte ie '.CompareWith.' instead of '..'
        let suppressMemberCompletion = lastCharDottedInto && descriptor.KeyChar = '.'
        lastCharDottedInto <- false
        if suppressMemberCompletion then true else
        // base.KeyPress will execute RunParameterCompletionCommand
        // so suppress it here.  
        suppressParameterCompletion <- descriptor.KeyChar <> '(' && descriptor.KeyChar <> '<' && descriptor.KeyChar <> ','
        
        let result = base.KeyPress (descriptor)
  
        suppressParameterCompletion <- false
        if (descriptor.KeyChar = ')' && x.CanRunParameterCompletionCommand ()) then
            base.RunParameterCompletionCommand ()
  
        result
  
    // Run completion automatically when the user hits '.'
    // (this means that completion currently also works in comments and strings...)
    override x.HandleCodeCompletionAsync(context, completionChar, token) =
        if completionChar <> '.' then null else
  
        // We generally avoids forcing a re-typecheck on '.' presses by using
        // TryGetRecentTypeCheckResults. Forcing a re-typecheck on a user action can cause a 
  